Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5131 Discussions

Failed to compile sample program tachyon with vtune_amplifier_xe_2013

WEN_C_1
Beginner
663 Views

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
663 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-createglibc-2-2-5

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.

0 Kudos
WEN_C_1
Beginner
663 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.

0 Kudos
Vladimir_T_Intel
Moderator
663 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

0 Kudos
Reply