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

catkin_make fails to build executables ROS indigo

asked 2015-09-05 11:37:10 -0600

thandom gravatar image

updated 2015-09-07 05:40:16 -0600

I face a problem using catkin_make. It seems that the c compiler cannot be found. the final error I am getting is is Invoking "cmake" failed.

The environment variables seem ok:

ROS_PACKAGE_PATH=/home/thanos/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

and the installed version of the compiler is: cmake version 2.8.12.2

I have edited the .bashrc file as follows:

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash

Please any help would be more than welcome!

The result I get from catkin_make is :

Base path: /home/thanos/catkin_ws
Source space: /home/thanos/catkin_ws/src
Build space: /home/thanos/catkin_ws/build
Devel space: /home/thanos/catkin_ws/devel
Install space: /home/thanos/catkin_ws/install

####
#### Running command: "cmake /home/thanos/catkin_ws/src
-DCATKIN_DEVEL_PREFIX=/home/thanos/catkin_ws/devel
-DCMAKE_INSTALL_PREFIX=/home/thanos/catkin_ws/install -G Unix Makefiles" in "/home/thanos/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/thanos/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/thanos/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/thanos/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/thanos/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 34 packages in topological order:
-- ~~  - joystick_drivers (metapackage)
-- ~~  - navigation (metapackage)
-- ~~  - p2os_doc
-- ~~  - p2os_launch
-- ~~  - static_localizer
-- ~~  - move_base_msgs
-- ~~  - p2os_msgs
-- ~~  - ps3joy
-- ~~  - spacenav_node
-- ~~  - joy
-- ~~  - teleop_twist_joy
-- ~~  - fake_localization
-- ~~  - following
-- ~~  - map_server
-- ~~  - amcl
-- ~~  - p2os_driver
-- ~~  - p2os_teleop
-- ~~  - robot_pose_ekf
-- ~~  - rosaria
-- ~~  - p2os_urdf
-- ~~  - urg_node
-- ~~  - voxel_grid
-- ~~  - costmap_2d
-- ~~  - nav_core
-- ~~  - base_local_planner
-- ~~  - carrot_planner
-- ~~  - clear_costmap_recovery
-- ~~  - dwa_local_planner
-- ~~  - move_slow_and_clear
-- ~~  - navfn
-- ~~  - global_planner
-- ~~  - rotate_recovery
-- ~~  - move_base
-- ~~  - wiimote
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'joystick_drivers'
-- ==> add_subdirectory(joystick_drivers/joystick_drivers)
-- +++ processing catkin metapackage: 'navigation'
-- ==> add_subdirectory(navigation/navigation)
-- +++ processing catkin package: 'p2os_doc'
-- ==> add_subdirectory(p2os/p2os_doc)
-- +++ processing catkin package: 'p2os_launch'
-- ==> add_subdirectory(p2os/p2os_launch)
-- +++ processing catkin package: 'static_localizer'
-- ==> add_subdirectory(static_localizer)

... Finds all the packages and creates all the subdirectories..

-- +++ processing catkin package: 'wiimote'
-- ==> add_subdirectory(joystick_drivers/wiimote)
-- Using these message generators: gencpp;genlisp;genpy
-- wiimote: 3 messages, 0 services
-- Configuring incomplete, errors occurred! See also "/home/thanos/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/thanos/catkin_ws/build/CMakeFiles/CMakeError.log". 
Invoking "cmake" failed

In the CMakeErrors.log I get the following errors:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec997468529/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec997468529.dir/build.make CMakeFiles/cmTryCompileExec997468529.dir/build
make[1]: Entering directory `/home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec997468529.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec997468529.dir/CheckSymbolExists.c.o   -c /home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec997468529
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec997468529.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec997468529.dir/CheckSymbolExists.c.o  -o cmTryCompileExec997468529 -rdynamic 
CMakeFiles/cmTryCompileExec997468529.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned ...
(more)
edit retag flag offensive close merge delete

Comments

Slightly reformatted your question, to make it readable.

Boris gravatar image Boris  ( 2015-09-05 13:12:34 -0600 )edit

How to use the edit link/button?

To update your question with more information, don't post anwers, but edit your question. There is an edit link (or button) right beneath where your question is displayed. Please use that for future updates.

gvdhoorn gravatar image gvdhoorn  ( 2015-09-06 05:00:38 -0600 )edit

Just a note: console output is easier to read if you format it as preformatted text. Use the button with 101010 on it: select the text, then click the button (or ctrl+k).

gvdhoorn gravatar image gvdhoorn  ( 2015-09-07 02:50:18 -0600 )edit

The problem seems to be on separate packages. I followed the procedure mentioned in the answer and some packages are compiled properly and some others don't. Thank you for your precious help! I will try to fix the problem in the packages.

thandom gravatar image thandom  ( 2015-09-07 05:58:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-09-05 13:08:47 -0600

gvdhoorn gravatar image

updated 2015-09-07 04:06:04 -0600

It seems that the c compiler cannot be found.

What lead you to that conclusion?

and the installed version of the compiler is: cmake version 2.8.12.2

CMake is not a compiler, it is a build tool.

There are some errors in the pieces of the logs you posted, but what is stranger is that there are no lines about the C/C++ compiler anywhere in the catkin_make output you posted.

Can you provide some more info on how you installed ROS (from source / debians), what OS this is (and which version), and what you workspace setup is? Please use the edit link/button for that.

A normal installation of ROS should've installed the C/C++ compilers (if they weren't already on your system). Can you also add the output of which gcc?


Edit:

What do you mean (from source / debians)?

You can install ROS either by compiling everything yourself, or by installing pre-built binary pkgs. On Debian & Ubuntu, those packages are called debians. But you already linked to the tutorial you followed, so you must have installed using apt-get, and thus, using debians.

As to your problem: what is the output of a catkin_make invocation if you do the following (in a new terminal, with just source /opt/ros/indigo/setup.bash):

mkdir -p /tmp/catkin_test/src
cd /tmp/catkin_test
catkin_make

Please update your question with the output you get.

Also: run cmake --system-information and update your question with the first few (say 25) lines (everything down to and including CMAKE_COMPILER_IS_GNUCXX).


Edit 2:

Based on this:

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
[..]
-- Check for working C compiler: /usr/bin/cc -- works
[..]
-- Check for working CXX compiler: /usr/bin/c++ -- works

and this:

CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/cc"

I'd say there is nothing really wrong with your system. It's more likely a workspace related issue (so setup and / or packages in it).

Can you tell us exactly (ie: copy/paste the commands you used in your question) how you created and set up your workspace? Please edit your question with that information.

Also: in a normal terminal (so one which may source your problematic workspace) run env | grep -i ros and append the output of that to your question.


Edit 3:

source /opt/ros/indigo/setup.bash

was this in a 'clean' terminal? So without the source /opt/.. lines in your .bashrc?

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace

You don't need this last command

cd ~/catkin_ws/
catkin_make

So at this point there were no packages in ~/catkin_ws/src?

source devel/setup.bash

Again, was this in a clean terminal / bash session? If not, please remove the lines from your .bashrc and try again.

Also:

I have edited the .bashrc file as follows:

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash

You don't need to source the distribution setup.bash and the workspace ...

(more)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-05 11:37:10 -0600

Seen: 2,447 times

Last updated: Sep 07 '15