Ask Your Question
0

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

Comments

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 imageahendrix ( 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 imageRuud ( 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 imageDirk Thomas ( 2014-11-04 11:22:47 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 987 times

Last updated: Nov 03 '14