ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Compilation error whilst no coding errors

asked 2014-11-03 08:08:15 -0500

Ruud gravatar image

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
-- 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
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
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
edit retag flag offensive close merge delete


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.

ahendrix gravatar image ahendrix  ( 2014-11-03 12:34:44 -0500 )edit

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.

Ruud gravatar image Ruud  ( 2014-11-04 09:20:29 -0500 )edit

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.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-11-04 11:22:47 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-03 14:09:23 -0500

gvdhoorn gravatar image

With ^: is pthread directly listed as an argument to a target_link_libraries(..) statement? If so, you probably want to replace that with a proper find_package(Threads ..) and related include_paths(..), etc.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-11-03 08:08:15 -0500

Seen: 1,275 times

Last updated: Nov 03 '14