views:

1241

answers:

1

I'm trying to port a program from gfortran to ifort (Intel Fortran Compiler 11). I'm stuck with two files that only compile with gfortran:

gfortran -x f77 -c daedrid.ff
gfortran -x f77-cpp-input -c daedris.ff

when I try to run intel fortran compiler with these files, I get:

ifort -fpp -c daedrid.ff
ifort: warning #10147: no action performed for specified file(s)
ifort -fpp -c daedris.ff
ifort: warning #10147: no action performed for specified file(s)

and no object files are created.

Now, how can I solve this problem o_O?

EDIT: Renaming the file extensions from ff to fpp

cp daedrid.ff daedrid.fpp
cp daedrid.ff daedrid.fpp

helps:

ifort -fpp -c daedrid.fpp
daedrid.fpp(1483): (col. 9) remark: LOOP WAS VECTORIZED.
daedrid.fpp(1490): (col. 11) remark: LOOP WAS VECTORIZED.
daedrid.fpp(1499): (col. 13) remark: LOOP WAS VECTORIZED.
ifort -fpp -c daedris.fpp
daedris.fpp(1626): (col. 9) remark: LOOP WAS VECTORIZED.

http://www.rcac.purdue.edu/userinfo/resources/black/userguide.cfm#compile_fortran_cpp

UPDATE: Is there a way to make the intel fortran compiler work without having to rename the files?

+4  A: 

The options you're looking for are -Tf and -fpp (and optionally -fixed or -free. From ifort -help, the relevant lines are:

-Tf<file>     compile file as Fortran source

-fpp[n]    run Fortran preprocessor on source files prior to compilation
     n=0   disable running the preprocessor, equivalent to no fpp
     n=1,2,3  run preprocessor

-[no]fixed,-FI specifies source files are in fixed format
-[no]free, -FR specifies source files are in free format

So, all in all, if you have fixed-form source which needs preprocessing, you would use:

ifort -fpp -fixed -Tfa.ff

to compile file a.ff.

FX