2009-06-21 113 views
4

我试图将程序从gfortran移植到ifort(Intel Fortran编译器11)。我坚持两个文件只与gfortran编译:从gfortran移植到ifort时编译错误

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

当我尝试使用这些文件运行英特尔Fortran编译器,我得到:

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) 

并没有对象文件被创建。

现在,我该如何解决这个问题o_O?

编辑:重命名的文件扩展名从FF到FPP

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

帮助:

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:有没有一种方法,使英特尔Fortran编译器工作,而不必重命名文件?

回答

5

你要找的选项-Tf-fpp(和可选-fixed-freeifort -help,相关的线路有:。

-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 

所以,一切的一切,如果你有固定格式源代码这就需要预处理,你可以使用:

ifort -fpp -fixed -Tfa.ff 

编译文件a.ff

相关问题