Catkin_make_isolated pthread linking error
I'm running a fresh install of Debian Wheezy and trying to install ROS hydro from source and am on the following step:
./src/catkin/bin/catkin_make_isolated --install
My build dies 3/4 of the way through, but for a different error than the one in this question. Trying to solve this other issue I became curious about one of the common cmake errors I get in the CMakeError.log's:
$ find . -type f -exec grep "cannot find" {} +
...
./build_isolated/tf2_bullet/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/rqt_web/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/rqt_plot/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/robot/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/angles/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/pcl_conversions/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/smach_ros/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/rqt_srv/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/catkin/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/random_numbers/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/trajectory_msgs/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/rosmaster/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/eigen_conversions/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/geometric_shapes/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
./build_isolated/collada_parser/CMakeFiles/CMakeError.log:/usr/bin/ld: cannot find -lpthreads
... and hundreds more
The full error from ./build_isolated/rosmaster/CMakeFiles/CMakeError.log looks like:
$cat ./build_isolated/rosmaster/CMakeFiles/CMakeError.log
...
/usr/bin/gcc CMakeFiles/cmTryCompileExec1355085001.dir/CheckSymbolExists.c.o -o cmTryCompileExec1355085001 -rdynamic
CMakeFiles/cmTryCompileExec1355085001.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec1355085001] Error 1
make[1]: Leaving directory `/home/nexix/Documents/source/ros_catkin_ws/build_isolated/rosmaster/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec1355085001/fast] Error 2
...
/usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec2282391930.dir/CheckFunctionExists.c.o -o cmTryCompileExec2282391930 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2282391930] Error 1
make[1]: Leaving directory `/home/nexix/Documents/source/ros_catkin_ws/build_isolated/rosmaster/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2282391930/fast] Error 2
I have pthread installed, but the spelling is slightly different:
$ locate libpthread
/lib/x86_64-linux-gnu/libpthread-2.13.so
/lib/x86_64-linux-gnu/libpthread.so.0
/usr/lib/x86_64-linux-gnu/libpthread.a
/usr/lib/x86_64-linux-gnu/libpthread.so
/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
But looking in the CMakeCache file makes it look like the logic is there to get around naming differences like that:
$ cat ./build_isolated/rosmaster/CMakeCache.txt
...
gtest_LIB_DEPENDS:STATIC=general;-lpthread;
...
//Disable uses of pthreads in gtest.
gtest_disable_pthreads:BOOL=OFF
...
//Dependencies for the target
gtest_main_LIB_DEPENDS:STATIC=general;-lpthread;general;gtest;
...
//Have symbol pthread_create
CMAKE_HAVE_LIBC_CREATE:INTERNAL=
//Have library pthreads
CMAKE_HAVE_PTHREADS_CREATE:INTERNAL=
//Have library pthread
CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1
...
My question is how do I find out if this is causing compile problems? It seems to be ...