PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

pgc++ linker error with dynamic libraries

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



Joined: 14 Mar 2013
Posts: 2

PostPosted: Tue Mar 26, 2013 9:44 am    Post subject: pgc++ linker error with dynamic libraries Reply with quote

Hello,

I have a problem with pgc++ and creating a dynamically linked library using -fPIC. I was wondering if anyone has had similar problems any maybe found a solution?

This is the code:

-- test.cpp
#include <string>
int main() {
std::string s("hello");
std::string t = s + "world";
return 0;
}
--

If I do

pgc++ test.cpp

it compiles and runs. If I enable position-independent code I get

--
pgc++ -fPIC test.cpp
/tmp/pgc++d3ohj3kJ-KD0.o: In function `std::basic_string<char,
std::char_traits<char>, std::allocator<char> > std::operator+<char,
std::char_traits<char>, std::allocator<char> >(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, char const*)':
test.cpp:(.gnu.linkonce.t._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_+0x48):
undefined reference to `__catch_clause_number'
test.cpp:(.gnu.linkonce.t._ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_PKS3_+0x52):
undefined reference to `__caught_object_address'
--

The same with GCC (g++ -fPIC test.cpp) works, so this seems to be a pgc++ problem. Unfortunately this means pgc++ cannot be used at all to generate dynamically linked libraries, which seems quite a substantial bug.

Here is the version information:
--
gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)
pgc++ 13.3-0 64-bit target on x86-64 Linux -tp nehalem
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2013, STMicroelectronics, Inc. All Rights Reserved.
--

Jan
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Mar 26, 2013 1:29 pm    Post subject: Reply with quote

Thanks Jan. I appears the PGI Customer Service has already filed this issue as TPR#19228 and is waiting for engineering to investigate.

- Mat
Back to top
View user's profile
fkhuztdsf



Joined: 14 Mar 2013
Posts: 2

PostPosted: Tue Mar 26, 2013 5:23 pm    Post subject: Reply with quote

Thanks, I already got a friendly message from support (thanks again!) but was wondering if anyone had found a workaround.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Mar 27, 2013 10:11 am    Post subject: Reply with quote

Hi Jan,

I talked with the compiler engineer who's working on this. Unfortunately, there isn't a work around since it has to do with how exception handling is done between static and PIC versions on the code. She's working on a fix now but doesn't think it will make the cut off for the 13.4 release. Most likely, 13.5.

Thanks again,
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