Reputation: 1
I was using the makefile code (below), with a Fortran77 compiler it worked to my satisfaction but I attempted to use the same code in partnership with an Intel Fortran Compiler (IFORT) and it does not work well at all.
Can anyone offer any suggestions on improving the code?
OBJ = change.o twopt.o ddmath.o cklib.o
f77 = pgf77
opt = -O4
.f.o:
$(f77) $(opt) -c $*.f
stagdri: $(OBJ)
pgf77 -o change.exe $(OBJ)
strip change.exe
Upvotes: 0
Views: 4029
Reputation: 6915
This is a pretty simple makefile and the only real change needed is to change f77 = pfg77
to f77 = ifort
. I'm not sure that ifort will like the -O4
option (O3 is the highest level in documentation for ifort), so you might change that just to make sure you get optimization.
There are two other issues not related to the makefile that could be causing you problems.
The intel compilers run on the command line require that you run a script to setup the intel environment. Make sure you are running that script before making the project. On linux this is source /opt/intel/bin/compilervars.sh intel64
for the 64 bit environment and default installation path.
ifort can be quite picky in some ways and reject code that is accepted by pgf or gfortran. You may need to tighten up your code or find compiler arguments to relax the compiler, where applicable.
To provide any specific help beyond these generalities, the actual errors produced by the compiler or by make need to be provided.
Upvotes: 2