Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6709 Discussions

Linking error with IPP 7.0 on Ubuntu 11.10: undefined reference to `pthread_atfork' (have tried everything out there)

hoangnguyen79
Beginner
549 Views
My current system is:

Linux Ubuntu 11.10
GCC 4.6.1
IPP 7.0 (Update 1), Linux 32-bit

Here is my code "hellopipp.cpp":

#include "ipp.h"
#include "stdio.h"
int main(int argc, char* argv[])
{
ippInit();
const IppLibraryVersion *lib = ippsGetLibVersion();
printf("%s %s\\n",lib->Name, lib->Version);
return 0;
}

I tried to compile the code as follows:

IPPROOT=/opt/intel/ipp
LD_LIBRARY_PATH=/opt/intel/lib/ia32:/opt/intel/ipp/lib/ia32:/usr/lib:/usr/local/lib:usr/lib/i386-linux-gnu
export IPPROOT
export LD_LIBRARY_PATH

With any of the following commands:

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -lipps -lippcore -pthread

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -lipps -lippcore -omp -pthread

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -lipps -lippcore -lpthread

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -L/opt/intel/lib/ia32 -lippi -lipps -lippcore -liomp5 -lpthread

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -L/opt/intel/lib/ia32 -lippi -lipps -lippcore -lgomp -lpthread

g++ -o helloipp helloipp.cpp -I$IPPROOT/include -L$IPPROOT/lib/ia32 -L/opt/intel/lib/ia32 -lippi -lipps -lippcore -lgomp -lpthread -lm

I got the same result:

/opt/intel/lib/ia32/libiomp5.so: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status


I made sure that libiomp5.so and libiomp5.a are there in the directory /opt/intel/lib/ia32/

I also checked to see if I had libpthread installed, and it looks like I have it:

sudo find -name *libpthread*

./usr/lib/i386-linux-gnu/libpthread.so
./usr/lib/i386-linux-gnu/libpthread_nonshared.a
./usr/lib/i386-linux-gnu/libpthread.a
./usr/lib/i386-linux-gnu/xen/libpthread_nonshared.a
./usr/lib/i386-linux-gnu/xen/libpthread.a
./lib/i386-linux-gnu/libpthread.so.0
./lib/i386-linux-gnu/libpthread-2.13.so


Any suggestion will be greatly appreciated. Thanks!

0 Kudos
3 Replies
Gennady_F_Intel
Moderator
549 Views
Do you add path to the directory wherelibiomp5 is located? for example for 32 bit, the default directory is/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/ia32.
0 Kudos
hoangnguyen79
Beginner
549 Views
Thanks Gennady for replying.

FYI, here is what happened. After I upgraded from IPP 7.0 update 1 to IPP 7.0 update 6 (the latest one), without doing anything else, the problem dissapeared. All my IPP codes now can be compiled smoothly. All I did was to install the new IPP, and nothing else.

I suspect this is a bug from IPP 7.0 update 1 that has something to do with the incompatibility between libthread in Linux and libiomp5 in IPP?

Thanks!
0 Kudos
Gennady_F_Intel
Moderator
549 Views
no, I don't think so. You can easy to check it by replacing libiomp from 7.0.6 by 7.0.1.
0 Kudos
Reply