Creators of Quality Software Randy and Alysia Schwarz P.O. Box 1308 Richland, WA 99352
|
Creating a Fortran console application that calls a C program with an external library (X11.lib) using Intel Fortran 10.1, with Visual Studio 2008
Below is an example of compiling a Fortran Console program that calls a C program and also calls an external library file (X11.lib). These are the steps I need to go through to get my code to compile. Many of these steps are specific to my code (X windows graphics, preprocessor definitions) and can be ignored if they do not apply to your application.
Open Visual Studio 2008. It should allow for compiling Intel programs. If not please properly install the Intel Fortran software. (see separate instructions on this)
Create a new Fortan console application (File->New->Project), then select Intel Fortran and click on “Console Application” then select “Empty Project”. Make sure you select the location and set the file name before clicking OK. My application is called mcnpx_26f.
Select OK.
4. Add The Fortran files to the Fortran project.
You need to obtain the Fortran files for compiling. If you have a patch file, you need to run that first.
Right click on source file, select Add->New Folder
Rename the folder to the proper directory name. Add the following directories:
i. dedx
ii. f77main
iii. fluka89
iv. gvaviv
v. hexs
vi. histp
vii. lcs
viii. mcnpf
ix. meshtal
x. spabi
Add the files by right clicking on the folder and selecting Add->Existing Item.
5. Right click on the Fortran project and select Properties
6. Under Fortran->General
a.
Set the include directory for the
include files. This is specific to
your system. Below is what I use.
Additional Include Directories:
F:\
b. Preprocessor Definitions:
CHEAP; DEC; XS64; MESHTAL; RADIOG; CEM;
HISTP; SPABI; DFACT; INCL; CINDER; PLOT; MCPLOT; GKSSIM; XLIB
Contact Information
Email: randyschwarz@mcnpvised.com