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?
2
votes
Which operating systems are you referring to?
- Marcelo Cantos
Linux machine1 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:12:36 EST 2009 x86_64 x86_64 x86_64 GNU/Linux Linux machine2 2.6.5-7.276-sn2 #1 SMP Mon Jul 24 10:45:31 UTC 2006 ia64 ia64 ia64 GNU/Linux Linux machine3 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:54:53 EST 2006 i686 i686 i386 GNU/Linux
- fizboz
1 Answers
4
votes
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.