PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Error when compiling a program

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



Joined: 17 May 2005
Posts: 2

PostPosted: Tue May 17, 2005 8:57 am    Post subject: Error when compiling a program Reply with quote

Good morning. I'm kind of new to using Portland Group. I'm trying to compile our in house software consisting of a library and misc binaries. In the final link stage of the library I get this error:

/usr/bin/ld: /usr/pgi/linux86-64/5.2/lib/libstd.a(fstream.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
/usr/pgi/linux86-64/5.2/lib/libstd.a: could not read symbols: Bad value

We are using the 5.2 64bit version on a quad AMD Opteron system.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue May 17, 2005 1:10 pm    Post subject: Reply with quote

Hi bigjnsa,

This error typically occurs when you are creating a shared library and are linking in with the non-'fpic' versions of our static libraries. Unfortunately, we have only just started to include 'fpic' versions of the static libraries with the 6.0 release. (They are located in the "libso" directory). With 5.2 and earlier you'll need to link with the dynamic libraries.

- Mat
Back to top
View user's profile
bigjnsa



Joined: 17 May 2005
Posts: 2

PostPosted: Tue May 17, 2005 1:55 pm    Post subject: Thanks Reply with quote

Thanks for the help. Now I just need to figure out how to tell pgcc to link against the shared library. Will it hurt to move lib out of the way and symlink libso to lib?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue May 17, 2005 2:40 pm    Post subject: Reply with quote

The simplest way is to add "-fpic" to the link line. You can also add "-Bdynamic -L<your PGI PATH>/libso".

- Mat
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