gpt4 book ai didi

从 gfortran 移植到 ifort 时出现编译错误

转载 作者:行者123 更新时间:2023-12-01 00:06:47 24 4
gpt4 key购买 nike

我正在尝试将程序从 gfortran 移植到 ifort(英特尔 Fortran 编译器 11)。我被两个只能用 gfortran 编译的文件卡住了:

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

当我尝试使用这些文件运行 intel 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

更新:有没有办法让 intel fortran 编译器工作而不必重命名文件?

最佳答案

您正在寻找的选项是 -Tf-fpp (以及可选的 -fixed-free 。来自 ifort -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 .

关于从 gfortran 移植到 ifort 时出现编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1024733/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com