Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 Discussions

How to compile and link Fortran 90

ucb
Beginner
1,412 Views
Hello,
I have a Fortran 90 source code. It can be correctly compiled and linked
in Compaq Visual Fortran (Window) and Portland Group Compilers (pgf90 atlinux or unix).
NOW, I have to recompile and link it in Intel Fortran Itanium Compiler for Itanium, version 8.1. I use a similar method as pgf90, but not work:
In pgf90, I can use: pgf90 -O -o SFF SFF.for
But here: ifort -O -o SFF SFF.for Does not work
Then, I use: ifort -c SFF.for
this can generate a file SFF.o
After this, I do not know how to make this file to a .exe file. If some one could help me this, I really appreciate it. Thanks,
Greg
0 Kudos
5 Replies
TimP
Honored Contributor III
1,412 Views
As neither the former released Compaq nor Portland compilers support Itanium, you may be using the wrong ifort. If you are to run on 32-bit Windows, you need the 32-bit compiler, with the Microsoft C++ library and link; if on EM64T or AMD64 64-bit Windows, the fce version of ifort, which is a separate download, and currently requires Microsoft PSDK build 1289. The Itanium Windows compiler also requires a PSDK to link and make .exe, but should be less critical about which build of PSDK. From the sketchy information you provided, it looks like you may not have installed the Microsoft link and library support. The compiler installer warns you about that when installing.

If you are set up correctly on Windows,
ifort SFF.for
will make
SFF.exe
0 Kudos
ucb
Beginner
1,412 Views
Thanks.
I use a cluster machine. The compiler is supposed to install correctly.
I just login to the far-end computers, and transfer my source code to
there.
I compile it using the command ifort SFF.for or ifort -O SFF.for. No warn
is given. But I still can not generate the exe file.
If some one has the experience to compile the code in the cluster machine, could you help me about this. Thanks.
0 Kudos
Steven_L_Intel1
Employee
1,412 Views
This is the Linux section of the forum, so I am assuming you are on Linux? Linux executables don't tend to have a .exe file type. Generally they have no file extension at all.

If you type:

ifort SFF.for

you will get an executable named a.out - this is a Linux/UNIX convention. If you want to name it something else, the typical method would be:

ifort -o SFF SFF.for

This would create an executable named SFF

I would strongly recommend that you read the first few chapters, at least, of the Intel Fortran User Manual to get a feel for how the compiler is invoked.
0 Kudos
ucb
Beginner
1,412 Views
Your explanation is clear. And I know I can generate the .out file.
But I do not know how to run it on the cluster machine. Thanks.
0 Kudos
TimP
Honored Contributor III
1,412 Views
If you are compiling to run on an MPI cluster, and you have built MPI parallelization into your program, you generally use the compiler wrappers and run commands provided by that MPI implementation. For example, for Intel MPI with ifort,
mpiifort -o sff sff.for
mpiexec -n 4 ./sff
There generally aren't practical ways of making a plain Fortran program run parallel on a cluster.
0 Kudos
Reply