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 jivelib.so \
iosub.o dynamic.o trace.o segment.o \
invert.o bsp2d.o bsp3d.o modules.o
Kind regards, Tim!
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.
Thanks for the idea! Changed my library to -L/usr/X11R6/lib64 and now everything is working.
Sweeeeeet :) ... glad I could help!
|All times are GMT -5. The time now is 06:14 PM.|