Compilation error whilst no coding errors
Hi everyone,
The strangest thing is happening; a weird compilation behaviour under Catkin Groovy, Ubuntu 12.04. Whilst running catkin_make, sometimes it will result in the following error although the code compiled just fine in a previous compilation. No code was altered in the meantime. Furthermore, the issue is temporarily 'solved' when I throw away the /build and /devel folders in my catkin workspace. Adding a CATKIN_IGNORE file in the presumed package of error does not help, as the error will then pop up for the next package. I wonder what causes the strange behaviour, it is quite inconvenient.
user@computer:~/Dropbox/ros/catkin_workspace$ catkin_make
Base path: /home/user/Dropbox/ros/catkin_workspace
Source space: /home/user/Dropbox/ros/catkin_workspace/src
Build space: /home/user/Dropbox/ros/catkin_workspace/build
Devel space: /home/user/Dropbox/ros/catkin_workspace/devel
Install space: /home/user/Dropbox/ros/catkin_workspace/install
####
#### Running command: "make cmake_check_build_system" in "/home/user/Dropbox/ros/catkin_workspace/build"
####
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Using CATKIN_DEVEL_PREFIX: /home/user/Dropbox/ros/catkin_workspace/devel
-- Using CMAKE_PREFIX_PATH: /home/user/Dropbox/ros/catkin_workspace/devel;/opt/ros/groovy
-- This workspace overlays: /home/user/Dropbox/ros/catkin_workspace/devel;/opt/ros/groovy
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/user/Dropbox/ros/catkin_workspace/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.89
-- BUILD_SHARED_LIBS is on
WARNING: Package "libg2o" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 5 packages in topological order:
-- ~~ - halcon
-- ~~ - slam
-- ~~ - servo_nodes
-- ~~ - baxter
-- ~~ - servo_state_machine
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'halcon'
-- ==> add_subdirectory(halcon)
CMake Error at /opt/ros/groovy/share/roscpp/cmake/roscppConfig.cmake:141 (message):
Project 'halcon' tried to find library 'pthread'. The library is neither a
target nor built/installed properly. Did you compile project 'roscpp'? Did
you find_package() it before the subdirectory containing its code is
included?
Call Stack (most recent call first):
/opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:75 (find_package)
halcon/CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I suspect there's something in your cmakelists that is causing the library search to fail. Please edit your question to include the CMakeLists.txt from your
halcon
package.The CMakeLists.txt does not search or include pthread. I did found a dependency in a third party source file looking to include "pthread.h", which is nowhere to be found in the include directories. Apparently the compiler looks for it but occasionally does not find it or it sometimes does.
As the error message says the library is used by the
roscpp
package (/opt/ros/groovy/share/roscpp/cmake/roscppConfig.cmake). I can't see any reason why the behavior should be non-deterministic. You might want to post the full code of your example (e.g. in a GitHub repo) for others to take a look.