[mlpack] undefined reference to `pthread_atfork'

Alexander Schmidt-Richberg a.schmidt-richberg at imperial.ac.uk
Mon Nov 11 12:32:18 EST 2013


Hi,

I am trying to build mlpack under Ubuntu 12.04 and I get the following
error:

Linking CXX executable ../../../../bin/cf
/opt/intel/composerxe/lib/intel64/libiomp5.so: undefined reference to
`pthread_atfork'
collect2: ld returned 1 exit status
make[2]: *** [bin/cf] Error 1
make[1]: *** [src/mlpack/methods/cf/CMakeFiles/cf.dir/all] Error 2
make: *** [all] Error 2

I realized that I get the same error when I want to build the examples
of the armadillo library. However, after some googleing I was able to
fix this by adding -pthread to the compiler/linker:

c++ -I /usr/include -O2 -o example1 example1.cpp -larmadillo -pthread

However, the problem wasn't solved by adding -pthread to CMAKE_***_FLAGS
when configuring mlpack, nor by adding pthread to target_link_libraries().

Do you have any idea what can cause this behavior?

(Note: Adding -lpthread did NOT help when building the armadillo
examples, not sure if this is of any interest...)

Thanks for your help!

Alex


More information about the mlpack mailing list