Compilation error when porting from gfortran to ifort

I am trying to port a program from gfortran to ifort (Intel Fortran Compiler 11). I am stuck in 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 start the 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 o_O problem?

EDIT: Rename 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 get the Intel fortran compiler to work without renaming files?

+4
source share
1 answer

The options you are looking for are -Tf and -fpp (and optionally -fixed or -free ). From ifort -help corresponding 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, in general, if you have a fixed form source that requires preprocessing, you should use:

 ifort -fpp -fixed -Tfa.ff 

to compile a.ff file.

+5
source

Source: https://habr.com/ru/post/1286547/


All Articles