PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Linking a shared object with static libraries for RPM/64-bit

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



Joined: 04 Nov 2004
Posts: 2

PostPosted: Thu Nov 04, 2004 3:07 pm    Post subject: Linking a shared object with static libraries for RPM/64-bit Reply with quote

Hello -

I'd like to provide a Linux RPM for the x86_64 (64-bit) architecture for the software I'm working on. The Portland compilers work great when compiling for source - but for the RPM I need to be able to create a shared object that is statically linked with Portland libraries (i.e. libpgc.a) so that users don't need libpgc.so on their system.

The current error I get when I try to link directly with libpgc.a is

/usr/bin/ld: /usr/local/pgi/linux86-64/5.2/lib/libpgc.a(va_arg.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC

Is there a way to get the static pgcc libraries compiled with fPIC? Or any other advice on how I can link the static libraries with my shared object? I can't use the portability package since it is not yet available for 64-bit architectures.

Thanks in advance.

Todd
Back to top
View user's profile
slaton



Joined: 11 Oct 2004
Posts: 7

PostPosted: Thu Nov 04, 2004 6:19 pm    Post subject: Reply with quote

I have this same problem. I am unable to build 64-bit shared libraries on x86_64 platform. In all (three) of the cases i've tried, it's been a GPL licensed package configured with libtool. Are you using GNU libtool, automake, etc? There seems to be a problem with libtool and x86_64.
Back to top
View user's profile
todd



Joined: 04 Nov 2004
Posts: 2

PostPosted: Fri Nov 05, 2004 10:07 am    Post subject: Reply with quote

I am using libtool/automake. I was able to create a shared library when I used the pgcc shared objects (libpgc.so, etc), but not when linking with the static ones necessary for RPM.
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Nov 05, 2004 12:06 pm    Post subject: Reply with quote

Hi Todd,


In the small memory model, this should work. However, the relocation error your getting is because your using the medium memory model (-mcmodel=medium). Currently you cannot statically link objects using the medium memory model. (See the PGI release notes http://www.pgroup.com/support/new_rel.htm for more information)

Unfortunately, you'll need to include libpgc.so. The good news however, is that there is only one version for all x86_64 systems (and why there isn't a portability package), so you can redistribute the version you have.

Hope this helped!
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