Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

link library of pthread

Fan_Y_
Beginner
1,014 Views

Hello,

For some reasons I have to link explicitly the pthread libraries during the compilation (make). This is ok when I produced the CPU version. I'm trying to do the same thing with -mmic to enable the Intel Xeon Phi Coprocessor. However, I've got the following errors:

x86_64-k1om-linux-ld: skipping incompatible /lib64/libpthread.so.0 when searching for /lib64/libpthread.so.0
x86_64-k1om-linux-ld: cannot find /lib64/libpthread.so.0
x86_64-k1om-linux-ld: skipping incompatible /usr/lib64/libpthread_nonshared.a when searching for /usr/lib64/libpthread_nonshared.a
x86_64-k1om-linux-ld: cannot find /usr/lib64/libpthread_nonshared.a

I tried to find some MIC-specific pthread libraries in /opt/intel without having any good results. 

Anyone any idea about which one of pthread library used by MIC?

Thanks a lot for the comments. 

0 Kudos
4 Replies
SergeyKostrov
Valued Contributor II
1,014 Views
>>...Anyone any idea about which one of pthread library used by MIC? I think you need to contact owners of pthread library. Also, it is not clear what C++ compiler do you use.
0 Kudos
TimP
Honored Contributor III
1,014 Views

Presumably, for -mmic linking libpthread (e.g. when icc -parallel or -openmp are set) it would search /opt/intel/mic/filesystem/base/lib64/ (in a default installation).

0 Kudos
Amanda_S_Intel
Employee
1,014 Views

If you source the environment script, e.g. source /opt/intel/composer_xe_2013/bin/compilervars.sh intel64, then compile with 

icc -mmic -lpthread pthread.c

It should work fine. I can't reproduce any problem. What does your compile line look like?

0 Kudos
Amanda_S_Intel
Employee
1,014 Views

If it's easier for you to link directly to the pthread library for Intel Xeon Phi coprocessors (versus using just -lpthread), depending on your MPSS version (in this case 2.1.6720-13), you will find the pthread library here: /usr/linux-k1om-4.7/linux-k1om/lib64

0 Kudos
Reply