views:

65

answers:

1

Heys, I've been following stackoverflow for a time, but for the first time I have a question that I haven't found the answer to here =)

I've got a quick and a tiny question. I have a fortran program, which I can compile using f77, f95 or ifort, doesn't matter. It compiles properly on all the three operating systems that I have (one of them have i386 systems, one of them ia64 and one of them x86_64).

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 in one of the computers, and try in the other, I got "cannot execute binary file" error. Does anyone have any idea about what can I do ?

+2  A: 

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.

David Given
wow, i thought i had tried all the possibilities, but didnt try that one apparently. i386 code does really work at x86_64. i'll guess i have to make a seperate one for ia64.
fizboz