在使用 Python 代码中的 f2py 模块时出现的问题

6

我有一个FORTRAN代码,需要使用以下编译命令。

gfortran -c interp.f -ffixed-format -ffix-line-length-none

我使用Python中的f2py模块编译了相同的内容。
from numpy import f2py

f2py.compile(open('interp.f').read(),modulename='interp',extra_flags='-ffixed-format -ffix-line-length-none',verbose=0)

无法编译该模块。出现错误,提示在“-ffized-format”处的无效文件格式。
请帮忙解决。

你可以尝试使用 extra_flags="--opt='-O3 -ffixed-format -ffix-line-length-none'" (虽然我不能保证它能正常工作)。 - mgilson
抱歉,我在我的帖子中也是指 extra_flags。我会尝试一下,谢谢。 - Andy Stow Away
1
另外,根据文档的快速查看,应该是extra_args - mgilson
1个回答

1

-ffixed-format-ffix-line-length-none似乎不是有效的gfortran选项。建议改用-ffixed-form-ffixed-line-length-none


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接