sriramlab/ProPCA

Error: undefined reference to 'pthread_create'

Closed this issue · 1 comments

Getting an error on running the "make" command. Not sure where to go from here after reviewing other issues and interwebs.

Scanning dependencies of target propca
[ 25%] Building CXX object CMakeFiles/propca.dir/src/propca.cpp.o
[ 50%] Building CXX object CMakeFiles/propca.dir/src/genotype.cpp.o
[ 75%] Building CXX object CMakeFiles/propca.dir/src/storage.cpp.o
[100%] Linking CXX executable propca
CMakeFiles/propca.dir/src/propca.cpp.o:propca.cpp:function multiply_y_post_fast(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, int, Eigen::Matrix<double, -1, -1, 1, -1, -1>&, bool): error: undefined reference to 'pthread_create'
CMakeFiles/propca.dir/src/propca.cpp.o:propca.cpp:function multiply_y_post_fast(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, int, Eigen::Matrix<double, -1, -1, 1, -1, -1>&, bool): error: undefined reference to 'pthread_create'
CMakeFiles/propca.dir/src/propca.cpp.o:propca.cpp:function multiply_y_pre_fast(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, int, Eigen::Matrix<double, -1, -1, 1, -1, -1>&, bool): error: undefined reference to 'pthread_create'
CMakeFiles/propca.dir/src/propca.cpp.o:propca.cpp:function multiply_y_pre_fast(Eigen::Matrix<double, -1, -1, 1, -1, -1>&, int, Eigen::Matrix<double, -1, -1, 1, -1, -1>&, bool): error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/propca.dir/build.make:114: propca] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/propca.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I resolved this issue by reinstalling using the more verbose cmake option as recommended by the author. No editing make files required.

cmake -D SSE_SUPPORT=1 -D DEBUG=1 ..
make