[Hampshire] Compiling Fortran code in 32-bit and 64-bit on t…

Top Page

Reply to this message
Author: Robin Wilson
Date:  
To: Hampshire LUG Discussion List
Subject: [Hampshire] Compiling Fortran code in 32-bit and 64-bit on the same machine
Hi,

I seem to have run into an issue with some Fortran code that I'm compiling where the results are different (quite significantly so) on different computers. I'm trying to narrow down why the results are different, and one difference between the executables that I'm running on these different machines are that one is 32-bit and one is 64-bit. I suspect this might be the problem (floating-point precision and so on), but I'd like to test 32-bit and 64-bit executables on the same machine to ensure that it isn't some other difference between the machines.

How should I go about doing this? I've tried simply adding a -m32 parameter to my gfotran call, but at linking stage that gives me all sorts of errors like:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.so when searching for -lgfortran
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.a when searching for -lgfortran
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.so when searching for -lgfortran

(and lots more of the same)

I really don't want to screw up my GCC install, but is there a way to get the 32-bit libraries in such a manner that I can compile for both 32-bit and 64-bit on the same machine?

Any help would be much appreciated,

Cheers,

Robin


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------