0
$\begingroup$

Rosanswers logo

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 1 exit status
make[1]: *** [cmTryCompileExec997468529] Error 1
make[1]: Leaving directory `/home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec997468529/fast] Error 2

Determining if the include file FL/Fl.H exists failed with the following output:
Change Dir: /home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2890154973/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2890154973.dir/build.make CMakeFiles/cmTryCompileExec2890154973.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 CXX object CMakeFiles/cmTryCompileExec2890154973.dir/CheckIncludeFile.cxx.o
/usr/bin/c++    -Wno-deprecated    -o CMakeFiles/cmTryCompileExec2890154973.dir/CheckIncludeFile.cxx.o -c /home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
/home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx:1:19: fatal error: FL/Fl.H: No such file or directory
 #include <FL/Fl.H>
                   ^
compilation terminated.
make[1]: *** [CMakeFiles/cmTryCompileExec2890154973.dir/CheckIncludeFile.cxx.o] Error 1
make[1]: Leaving directory `/home/thanos/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2890154973/fast] Error 2

Please any help would be more than welcome!


Edit:

The conclusion was derived from the fact that there are no lines about the C/C++ compiler anywhere in the catkin_make, as you mentioned. You are right about the CMake. The catkin_make command was working properly about a month ago. I have these problems without and significant changes in the system except for the regular updates.

I installed ROS using this tutorial: http://wiki.ros.org/indigo/Installation/Ubuntu

After facing this problem I re-initialized the workspace using the following tutorial: http://wiki.ros.org/catkin/Tutorials/create_a_workspace

os version:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

kernel version 3.13.0-63-generic

The output of which gcc is: /usr/bin/gcc

Edit:

The output of catkin_make in /tmp/catkin_test/ is the following:

Base path: /tmp/catkin_test
Source space: /tmp/catkin_test/src
Build space: /tmp/catkin_test/build
Devel space: /tmp/catkin_test/devel
Install space: /tmp/catkin_test/install
Creating symlink "/tmp/catkin_test/src/CMakeLists.txt" pointing to "/opt/ros/indigo/share/catkin/cmake/toplevel.cmake"
####
#### Running command: "cmake /tmp/catkin_test/src -DCATKIN_DEVEL_PREFIX=/tmp/catkin_test/devel -DCMAKE_INSTALL_PREFIX=/tmp/catkin_test/install -G Unix Makefiles" in "/tmp/catkin_test/build"
####
-- 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
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /tmp/catkin_test/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- 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: /tmp/catkin_test/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/catkin_test/build
####
#### Running command: "make -j8 -l8" in "/tmp/catkin_test/build"
####

The output of cmake --system-information:

Avoid ctest truncation of output:
CTEST_FULL_OUTPUT

MAIN VARIABLES

CMAKE_STATIC_LIBRARY_PREFIX == "lib"
CMAKE_STATIC_LIBRARY_SUFFIX == ".a"
CMAKE_SHARED_LIBRARY_PREFIX == "lib"
CMAKE_SHARED_LIBRARY_SUFFIX == ".so"
CMAKE_SHARED_MODULE_PREFIX == "lib"
CMAKE_SHARED_MODULE_SUFFIX == ".so"


CMAKE_DL_LIBS == "dl"
CMAKE_LIBRARY_PATH_FLAG == "-L"
CMAKE_LINK_LIBRARY_FLAG == "-l"
CMAKE_SKIP_RPATH == "NO"
CMAKE_SYSTEM_INFO_FILE == "Platform/Linux"
CMAKE_SYSTEM_NAME == "Linux"
CMAKE_SYSTEM == "Linux-3.13.0-63-generic"
CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/cc"
CMAKE_COMPILER_IS_GNUCC == "1"
CMAKE_COMPILER_IS_GNUCXX == "1"

Edit: As I mentioned previously in my question I followed this tutorial [http://wiki.ros.org/catkin/Tutorials/create_a_workspace] (http://wiki.ros.org/catkin/Tutorials/create_a_workspace) in order to initialize my workspace. So after having this problem I saved the src folder of catkin_ws in another path and I erased everything under catkin_ws folder. The next step was to follow the instructions of the tutorial:

source /opt/ros/indigo/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make

source devel/setup.bash

Finally, I edited the .bashrc as mentioned previously, copied back the src folder, but nothing changed.

Output of env | grep -i ros :

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/home/thanos/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
LD_LIBRARY_PATH=/home/thanos/catkin_ws/devel/lib:/home/thanos/catkin_ws/devel/lib/x86_64-linux-gnu:/opt/ros/indigo/lib/x86_64-linux-gnu:/opt/ros/indigo/lib
CPATH=/home/thanos/catkin_ws/devel/include:/opt/ros/indigo/include
PATH=/home/thanos/catkin_ws/devel/bin:/opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
ROSLISP_PACKAGE_DIRECTORIES=/home/thanos/catkin_ws/devel/share/common-lisp
ROS_DISTRO=indigo
PYTHONPATH=/home/thanos/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages
PKG_CONFIG_PATH=/home/thanos/catkin_ws/devel/lib/pkgconfig:/home/thanos/catkin_ws/devel/lib/x86_64-linux-gnu/pkgconfig:/opt/ros/indigo/lib/x86_64-linux-gnu/pkgconfig:/opt/ros/indigo/lib/pkgconfig
CMAKE_PREFIX_PATH=/home/thanos/catkin_ws/devel:/opt/ros/indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

Edit 4:

I removed both lines from the .bashrc and I opened a new 'clean' terminal I followed again the instructions from the tutorial mentioned above in order to initialize the workspace. With an empty src folder (without the packages) I ran the catkin_make command and the output is the following:

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"
####
-- 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
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /home/thanos/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- 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
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/thanos/catkin_ws/build
####
#### Running command: "make -j8 -l8" in "/home/thanos/catkin_ws/build"
####

The next step is to run the source devel/setup.bash command of the tutorial and the last command

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

So I am at this point right now.


Originally posted by thandom on ROS Answers with karma: 3 on 2015-09-05

Post score: 0


Original comments

Comment by Boris on 2015-09-05:
Slightly reformatted your question, to make it readable.

Comment by gvdhoorn on 2015-09-06:\

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.

Comment by gvdhoorn on 2015-09-07:
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).

Comment by thandom on 2015-09-07:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 file. Just source the workspace file, it sets up everything else for you.

Finally: it could be that one or more of your pkgs are doing something strange that is messing up CMake / catkin. Please try starting with a clean terminal, an empty - new - workspace, and add pkgs one by one to see when things stop working.


Originally posted by gvdhoorn with karma: 86574 on 2015-09-05

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.