Re: Fortran Binary files AMD64 x i686
On Tuesday 11 October 2005 14:31, Marcelo Vitola wrote:
> Dear list,
>
> I have some problems with a FORTRAN binary file creates in amd64 (kernel
> 2.6.8-11-amd64-k8, g77 version 3.3.5) when I try to read it in a Pentium IV
> (kernel 2.6.8-2-686, g77 version 3.3.5). Someone knows if is this normal?
> There is some way to solve this problem?
Are you sure you are actually setting your FORTRAN compiler to produce 80386
{32-bit} code rather than AMD64 {64-bit} code? I've never done
cross-compilation, but I'm sure there is a howto somewhere. The absolute
worst case is that you will have to run a 32-bit g77 in a chroot.
If you just use the default settings, you will get an AMD64 binary from any
source code you compile on an AMD64. This will cause a 32-bit Intel chip to
get its knickers in a knot. Since 80386 instructions are a subset of AMD64
instructions, the program might even appear to work for awhile -- until it
hits upon a "new" instruction.
Try using the `file` command on the compiler's output and seeing what kind of
executable it is. For example, this is what I see when doing `file /bin/ls`
on a 32-bit and a 64-bit machine respectively:
32bitmachine # file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped
64bitmachine # file /bin/ls
/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for
GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped
--
AJS
Reply to: