Errore di compilazione durante il porting da gfortran a ifort
-
06-07-2019 - |
Domanda
Sto provando a trasferire un programma da gfortran a ifort (Intel Fortran Compiler 11). Sono bloccato con due file che vengono compilati solo con gfortran:
gfortran -x f77 -c daedrid.ff
gfortran -x f77-cpp-input -c daedris.ff
quando provo a eseguire il compilatore Intel fortran con questi file, ottengo:
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)
e nessun file oggetto viene creato.
Ora, come posso risolvere questo problema o_O?
MODIFICA: Rinominare le estensioni dei file da ff a fpp
cp daedrid.ff daedrid.fpp
cp daedrid.ff daedrid.fpp
aiuta:
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
AGGIORNAMENTO: Esiste un modo per far funzionare il compilatore Intel fortran senza dover rinominare i file?
Soluzione
Le opzioni che stai cercando sono -Tf
e -fpp
(e facoltativamente -fixed
o -free . Da
ifort -help
, le righe pertinenti sono:
-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
Quindi, tutto sommato, se si dispone di una fonte a modulo fisso che necessita di preelaborazione, si utilizzerà:
ifort -fpp -fixed -Tfa.ff
per compilare il file a.ff
.