Erreur de compilation lors du transfert de gfortran à ifort
-
06-07-2019 - |
Question
J'essaie de porter un programme de gfortran à ifort (Intel Fortran Compiler 11). Je suis coincé avec deux fichiers qui ne compilent qu'avec gfortran:
gfortran -x f77 -c daedrid.ff
gfortran -x f77-cpp-input -c daedris.ff
quand j'essaie de lancer le compilateur forel Intel avec ces fichiers, je reçois:
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)
et aucun fichier d'objet n'est créé.
Maintenant, comment puis-je résoudre ce problème o_O?
EDIT: renommer les extensions de fichier de ff à fpp
cp daedrid.ff daedrid.fpp
cp daedrid.ff daedrid.fpp
aide:
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: Y a-t-il un moyen de faire fonctionner le compilateur Intel Fortran sans avoir à renommer les fichiers?
La solution
Les options que vous recherchez sont -Tf
et -fpp
(et éventuellement -fixé
ou -free
. Dans ifort -help
, les lignes appropriées sont les suivantes:
-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
En résumé, si vous avez une source de formulaire fixe qui nécessite un prétraitement, vous utiliserez:
ifort -fpp -fixed -Tfa.ff
pour compiler le fichier a.ff
.