Community
cancel
Showing results for 
Search instead for 
Did you mean: 
WEN_C_1
Beginner
108 Views

Failed to compile sample program tachyon with vtune_amplifier_xe_2013

When I tried to build the sample program "tachyon", I see the following errors. I am running on Ubuntu 13.04 Linux. Please help.

root@wchiu-Latitude-E6430:/opt/intel/vtune_amplifier_xe_2013/samples/en/C++/tachyon#make

/usr/bin/ld: /tmp/ccgJmRda.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_mutexattr_settype@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/x86_64-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[1]: *** [tachyon_analyze_locks] Error 1
make[1]: Leaving directory `/opt/intel/vtune_amplifier_xe_2013/samples/en/C++/tachyon'
make: *** [build_analyze_locks] Error 2

 

0 Kudos
3 Replies
Kirill_R_Intel
Employee
108 Views

This looks like Ubuntu 13.04 issue, see here:

http://stackoverflow.com/questions/8198056/having-a-libpthread-so-linking-trouble-on-ubuntu http://askubuntu.com/questions/308863/compiling-apib-undefined-reference-to-symbol-pthread-creategli...

One of the suggestions on that forums, you may try:

In the TARGET_LINK_LIBRARIES command, move pthread so it is the last item. The GNU linker requires dependent libraries to come before their dependencies.

WEN_C_1
Beginner
108 Views

This issue is solved after I include pthread in the makefile as:

LIBS += -ltbb -L$(TBB_FOR_EXAMPLES_INSTALL_DIR)/lib/$(Arch)  -Wl,-rpath $(miniTBBRootDir)/lib/$(Arch) -lpthread

Thanks for the help.

Vladimir_T_Intel
Moderator
108 Views

WEN C. wrote:

This issue is solved after I include pthread in the makefile as:

LIBS += -ltbb -L$(TBB_FOR_EXAMPLES_INSTALL_DIR)/lib/$(Arch)  -Wl,-rpath $(miniTBBRootDir)/lib/$(Arch) -lpthread

Thanks for the help.

Would it work for you if you just change the order of linking libs in the Makefile.gmake file?

LIBS += -L/usr/X11R6/lib$(x64) -lX11 -lpthread

Reply