PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Dynamic linking problem x86_64 platform

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
thomashauser



Joined: 31 Aug 2004
Posts: 2

PostPosted: Wed Feb 23, 2005 3:04 pm    Post subject: Dynamic linking problem x86_64 platform Reply with quote

Hi,

linking works if I use the loader directly:

/usr/bin/ld /usr/lib64/crti.o /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/crtbeginS.o \
-m elf_x86_64 -dynamic-linker \
/lib64/ld-linux-x86-64.so.2 build/temp.linux-x86_64-2.3/build/src/splinemodule.o \ build/temp.linux-x86_64-2.3/build/src/fortranobject.o build/temp.linux-x86_64-2.3/prec.o\ build/temp.linux-x86_64-2.3/spline.o\ build/temp.linux-x86_64-2.3/build/src/spline-f2pywrappers2.o \
-o build/lib.linux-x86_64-2.3/spline.so -L/opt/pgi/linux86-64/5.2/libso -L/usr/lib64\
-L/usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1 \
-rpath /opt/pgi/linux86-64/5.2/libso -Bdynamic -shared -lpgf90 -lpgf90_rpm1 -lpgf902\ -lpgf90rtl -lpgftnrtl -lc -lpgc -lm -lgcc -lc -lgcc \
/usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/crtendS.o /usr/lib64/crtn.o

doesn't work for
pgf90 -v -Bdynamic -shared build/temp.linux-x86_64-2.3/build
/src/splinemodule.o build/temp.linux-x86_64-2.3/build/src/fortranobject
.o build/temp.linux-x86_64-2.3/prec.o build/temp.linux-x86_64-2.3/spline
.o build/temp.linux-x86_64-2.3/build/src/spline-f2pywrappers2.o -o
build/lib.linux-x86_64-2.3/spline.so\n\n/usr/bin/ld /usr/lib64/crti
.o /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/crtbeginS.o -m elf_x
86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 build/temp.linux-x
86_64-2.3/build/src/splinemodule.o build/temp.linux-x86_64-2.3/build
/src/fortranobject.o build/temp.linux-x86_64-2.3/prec.o build/temp.linux
-x86_64-2.3/spline.o build/temp.linux-x86_64-2.3/build/src/spline-f2pywrapp
ers2.o -o build/lib.linux-x86_64-2.3/spline.so -L/opt/pgi/linux86-64
/5.2/lib -L/usr/lib64 -L/usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4
.1 -rpath /opt/pgi/linux86-64/5.2/lib -Bdynamic -shared -lpgf90 -lpgf
90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lc -lnspgc -lpgc -lm -lgcc
-lc -lgcc /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/crtendS.o
/usr/lib64/crtn.o\n/usr/bin/ld: /opt/pgi/linux86-64/5.2/lib/libpgf

90.a(ftnexit.o): relocation R_X86_64_32S against `pghpf_0_' can not
be used when making a shared object\; recompile with -fPIC\n/opt/pgi
/linux86-64/5.2/lib/libpgf90.a: could not read symbols: Bad value\npgf
90-Fatal-linker completed with exit code 1

note that for the working ld command I exchanged /opt/pgi/linux86_64/5.2/lib with
/opt/pgi/linux86_64/5.2/libso

What is the problem? Why doesnt the pgf90 -shared use the libso path?

Regards

Thomas
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6215
Location: The Portland Group Inc.

PostPosted: Wed Feb 23, 2005 4:49 pm    Post subject: Reply with quote

Hi Thomas,

"-shared" is just passed directly to the linker. To get the "libso" library directory please add the "-fpic" flag to your link line. Also, you could change your "-L/opt/pgi/linux86-64/5.2/lib" and "-rpath /opt/pgi/linux86-64/5.2/lib" flags to "-L/opt/pgi/linux86-64/5.2/libso" and "-rpath /opt/pgi/linux86-64/5.2/libso".

Hope this helps,
Mat
Back to top
View user's profile
thomashauser



Joined: 31 Aug 2004
Posts: 2

PostPosted: Thu Feb 24, 2005 11:10 am    Post subject: Reply with quote

Thanks Mat,

linking worked with the -fpic flag.

Thanks

Thomas
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group