英文:
Compile legacy fortran77 code as python module using f2py
问题
我能成功编译FORTRAN77代码,但只有在指定-std=legacy
时才能成功:
gfortran -o -std=legacy -o model.exe model.FOR
没有-std=legacy
会出现严重错误。我希望在尝试构建一个Python模块时能够类似地指定一个与陈旧的FORTRAN77代码兼容的传统编译器。目前,以下调用会生成与省略-std=legacy
时相同的致命错误:
f2py -c -m pymodel model.FOR --fcompiler=gnu95
有关如何确保f2py使用与陈旧的FORTRAN77代码兼容的传统编译器的建议?
英文:
I am able to successfully compile FORTRAN77 code, but only when specifying -std=legacy
in
gfortran -o -std=legacy -o model.exe model.FOR
Without -std=legacy
, I get some fatal errors. I wish to similarly specify a legacy compiler when attempting to build a python module. Presently the following call generates the same fatal errors as those when omitting -std=legacy
using gfortran.
f2py -c -m pymodel model.FOR --fcompiler=gnu95
Any suggestions on how to ensure f2py uses a legacy compiler compatible with antiquated FORTRAN77 code?
答案1
得分: 1
Vladimir F提供了一个很好的参考。当将感兴趣的参数传递给--opt="__"
时,f2py编译:
f2py -c --opt='-std=legacy' -m pymodel model.FOR --fcompiler=gnu95
英文:
> Are you actually just asking how to pass that flag to the compiler? stackoverflow.com/questions/28380548/…
Vladimir F provided a good reference. f2py compiles when passing the argument of interest into --opt="__"
:
f2py -c --opt='-std=legacy' -m pymodel model.FOR --fcompiler=gnu95
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论