-   Linux - Software (
-   -   Gnu Fortran versus Intel Fortran (

tomatoefish 02-14-2006 09:21 AM

Gnu Fortran versus Intel Fortran

I have a problem compiling code using gfortran. If I use
ifort -G the code compiles without error messages. However if I use g95 -shared linking does not work with following error message:

/usr/bin/ld: iosub.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

Recompiling using fPIC does not fix the problem.

I use the following commands to compile:

gfortran -shared -o \
iosub.o dynamic.o trace.o segment.o \
invert.o bsp2d.o bsp3d.o modules.o

Kind regards, Tim!

Tinkster 02-14-2006 12:55 PM

Without having much knowledge about fortran in general, and
the differences between the two compilers in particular the
"R_X86_64_32" suggests that you're trying to mix 32 and 64 bit
code? Maybe you need to try architecture flags with the gnu
compiler, e.g. -mtune=k8 or try to find the 64-bit equivalent
(or 32, no idea which way around you're mixing) of whatever
you're linking against.


tomatoefish 02-20-2006 01:03 PM

Thanks for the idea! Changed my library to -L/usr/X11R6/lib64 and now everything is working.

Tinkster 02-20-2006 02:31 PM

Sweeeeeet :) ... glad I could help!


All times are GMT -5. The time now is 05:36 PM.