多个系统上的 Fortran 编译
我有一个 Fortran 程序,可以在我拥有的所有三个操作系统(它们是 i386、ia64 和 x86_64 系统)上使用 f77、f95 或 ifort 进行编译。但是,我希望能够仅编译两种类型的可执行文件,以便我可以共享程序而不是代码。当我在其中一台计算机上进行编译并尝试在另一台计算机上运行编译后的二进制文件时,我收到错误消息无法执行二进制文件
。有谁知道我能做些什么吗?
I have a Fortran program, which I can compile using f77, f95 or ifort on all the three operating systems that I have (they are i386, ia64 and x86_64 systems). However, I want to be able to compile only two types of executables, so that I can share the program and not the code. When I compile on one of the computers and try running the compiled binary on another I get the error message cannot execute binary file
. Does anyone have any idea what can I do about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望机器本机运行它们,则不能这样做。您拥有三种不同的架构,因此您需要三种不同的二进制文件。
但是,x86_64(通常称为 amd64)确实能够运行 i386 代码,但性能略有下降。因此,如果您愿意放弃 64 位,理论上您可以放弃 amd64 二进制文件,而只在该机器上使用 i386 二进制文件。您需要在计算机上安装 i386 仿真环境才能使其工作。
ia64 可能支持类似的东西;我不知道ia64。
If you want the machines to run them natively, you can't do this. You've got three different architectures, so you need three different binaries.
However, x86_64 (more commonly called amd64) does have the ability to run i386 code, with a slight performance penalty. So if you're willing to give up 64-bit-ness, you could theoretically give up the amd64 binary and just use the i386 one on that machine. You will need to install the i386 emulation environment on the machine to make this work.
It's possible that ia64 supports something similar; I don't know ia64.