Search code examples
compilationfortranfortran77

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). 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?


Solution

  • 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.