简体   繁体   English

在多个系统上进行Fortran编译

[英]Fortran compilation on multiple systems

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). 我有一个Fortran程序,可以在我拥有的所有三个操作系统(它们分别是i386,ia64和x86_64系统)上使用f77,f95或ifort进行编译。 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 . 当我在一台计算机上进行编译并尝试在另一台计算机上运行已编译的二进制文件时,我收到错误消息cannot execute binary file Does anyone have any idea what can I do about this? 有谁知道我该怎么办?

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. 但是 ,x86_64(通常更称为amd64)确实具有运行i386代码的能力,但性能略有下降。 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. 因此,如果您愿意放弃64位功能,则理论上可以放弃amd64二进制文件,而仅在该计算机上使用i386。 You will need to install the i386 emulation environment on the machine to make this work. 您需要在计算机上安装i386仿真环境才能完成此工作。

It's possible that ia64 supports something similar; ia64可能支持类似的功能; I don't know ia64. 我不知道ia64。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM