LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Gnu Fortran versus Intel Fortran (http://www.linuxquestions.org/questions/linux-software-2/gnu-fortran-versus-intel-fortran-415286/)

tomatoefish 02-14-2006 08:21 AM

Gnu Fortran versus Intel Fortran
 
Hi!

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 jivelib.so \
iosub.o dynamic.o trace.o segment.o \
invert.o bsp2d.o bsp3d.o modules.o

Kind regards, Tim!

Tinkster 02-14-2006 11:55 AM

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.


Cheers,
Tink

tomatoefish 02-20-2006 12:03 PM

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

Tinkster 02-20-2006 01:31 PM

Sweeeeeet :) ... glad I could help!


Cheers,
Tink


All times are GMT -5. The time now is 12:21 PM.