problem with gfortran builds on x86_64
Christopher D. Rickett
crickett@lanl.gov
Wed Aug 17 20:02:00 GMT 2005
Hello all,
I'm not sure if this is the appropriate list for the questions I have, but
I would appreciate any help you could give me. I am trying to help
someone build gfortran/gcc on their system and am having the
following problems.
I have downloaded and successfully built gcc 4.0.1; the build included
gcc and gfortran only. Now, when trying to use gfortran:
$> /usr/local/gcc_4.0.1/bin/gfortran -o helloWorld -m32 helloWorld.f90
/usr/bin/ld: cannot find -lgfortranbegin
collect2: ld returned 1 exit status
My LD_LIBRARY_PATH definitely has the dir in it:
$> printenv LD_LIBRARY_PATH
/usr/local/gcc_4.0.1/lib32:/usr/local/gcc_4.0.1/lib:usr/local/gcc_4.0.1/lib64
putting the library dir explicity on the cmd line gives:
$> /usr/local/gcc_4.0.1/bin/gfortran -o helloWorld -m32
-L/usr/local/gcc_4.0.1/lib32 helloWorld.f90
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libm.so when searching
for -lm
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libm.a when searching
for -lm
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when searching
for -lc
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.a when searching
for -lc
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crt1.o' is incompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crti.o' is incompatible with i386 output
/usr/bin/ld: warning: i386:x86-64 architecture of input file
`/usr/lib/../lib/crtn.o' is incompatible with i386 output
The system does seem to be setup a little strange; the /usr/lib obj's
(crt1.o, ...) are the same as the 64 bit ones in /usr/lib64, and the 32
bit versions are in /usr/lib32. Somehow the existing gcc/gfortran on the
box (the gcc 4.0.1 built has the same problems) don't have these errors.
They are version 3.4.3. I got around this in building gfortran by
changing the specs file for the multilib build to look in lib32. If
anyone knows a better way to handle this, feel free to tell me.
The 4.0.1 gfortran w/o the -m32 will build, but will give the following
error when attempting to run the program:
./helloWorld: error while loading shared libraries: libgfortran.so.0:
cannot open shared object file: No such file or directory
Again, my LD_LIBRARY_PATH certainly has the path to this in it.
Any help you could give would be appreciated. Thank you.
Chris Rickett
More information about the Fortran
mailing list