[mlpack] undefined reference to `pthread_atfork'

Ryan Curtin gth671b at mail.gatech.edu
Mon Nov 11 13:04:59 EST 2013


On Mon, Nov 11, 2013 at 05:32:18PM +0000, Alexander Schmidt-Richberg wrote:
> 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!

Interesting, I bet this has to do with Armadillo using MKL libraries (or
similar) for linear algebra.  Can you send a copy of
armadillo_bits/config.hpp?  I can try and reproduce the issue.

Thanks,

Ryan

-- 
Ryan Curtin       | "Aw, Brian's doing it again, dude.  Brian, you ain't
ryan at igglybob.com | no pimp, dude."   "Where's my money?"


More information about the mlpack mailing list