PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

pgcc compiling : cannot find -lpthread
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
970980hs



Joined: 01 Jan 2014
Posts: 10

PostPosted: Fri Jan 31, 2014 6:21 pm    Post subject: pgcc compiling : cannot find -lpthread Reply with quote

Hi~

I try to compile my previous code by PGCC to see some performance gain.
Originally, this code was compiled well by gcc
gcc version is 4.4.7

But, in step of compiling by PGCC, some error is shown.
/usr/bin/ld: cannot find -lpthread

In my system, libpthread.so.0 is placed in /lib, so I was using option -L/lib/ and try again, but the result is same.

What should I do?
I also check that gblic-devel was installed..
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Feb 03, 2014 11:45 am    Post subject: Reply with quote

Hi 970980hs,

The linker will look for a file with a ".a" or ".so" suffix, hence a ".so.0" file wont be used.

Typically the pthread library would be found in the "/usr/lib" and/or "/usr/lib64" directories. The linker normally adds these directories to the default link path, indicating the libpthread isn't there. Though, another possibility is that trying to statically link but libpthread doesn't support static linking.

Does "/usr/lib[64]/libpthread.so" exist and what flags are you using to link?

- Mat
Back to top
View user's profile
970980hs



Joined: 01 Jan 2014
Posts: 10

PostPosted: Tue Feb 04, 2014 1:28 pm    Post subject: What is the proper option of PGCC for -lpthread of GCC? Reply with quote

Hi.

I double check whether libpthread.so is installed properly and it is installed in /usr/lib and /usr/lib64.

For same program, compiling using GCC is easily passed but there are error in case of using PGCC. The error message is about -lpthread option.

So I wonder if there are another named option in PGCC compiler instead of -lpthread in GCC ?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Feb 04, 2014 2:03 pm    Post subject: Reply with quote

My best guess then is that you're trying to link statically. What flags are you using to link? -Bstatic?
Back to top
View user's profile
970980hs



Joined: 01 Jan 2014
Posts: 10

PostPosted: Tue Feb 04, 2014 7:41 pm    Post subject: I didn't use static linking option Reply with quote

I didn't use -Bstatic or -static for linking.
And also as I mentioned, gcc compiling is working well.
Also pthread library is installed proper location.
I think it just happen because there are no -lpthread option
in pgcc case... how do i solve this?
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
Goto page 1, 2  Next
Page 1 of 2

 
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