从 gfortran 移植到 ifort 时出现编译错误
我正在尝试将程序从 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编译器无需重命名文件即可工作?
I'm trying to port a program from gfortran to ifort (Intel Fortran Compiler 11). I'm stuck with 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 run 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 problem o_O?
EDIT: Renaming the 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 make the intel fortran compiler work without having to rename the files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要查找的选项是
-Tf
和-fpp
(以及可选的-fixed
或-free
。从ifort -help
中,相关行是:因此,总而言之,如果您有需要预处理的固定格式源,则可以使用:
编译文件
a.ff
。The options you're looking for are
-Tf
and-fpp
(and optionally-fixed
or-free
. Fromifort -help
, the relevant lines are:So, all in all, if you have fixed-form source which needs preprocessing, you would use:
to compile file
a.ff
.