Ask Your Question

catkin_make fails: Invoking "make cmake_check_build_system" failed

asked 2015-05-06 08:22:32 -0500

CarlosRoncal gravatar image

updated 2015-05-06 09:58:49 -0500

gvdhoorn gravatar image


I just installed ROS and I'm following the beginner tutorial to get familiar with ROS. I've done until step 4 in "Creating a ROS msg and srv", I don't have any problem in the previous steps but when I try "catkin_make" it fails and I can't find the problem. Thank you for your help. Cheers, Carlos This is the message returned in the terminal:

carlos@carlos-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/carlos/catkin_ws
Source space: /home/carlos/catkin_ws/src
Build space: /home/carlos/catkin_ws/build
Devel space: /home/carlos/catkin_ws/devel
Install space: /home/carlos/catkin_ws/install
#### Running command: "make cmake_check_build_system" in "/home/carlos/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/carlos/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/carlos/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/carlos/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/carlos/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.11
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
-- beginner_tutorials: 1 messages, 1 services
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:104 (message):
  catkin_package() called with unused arguments: ...
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
  beginner_tutorials/CMakeLists.txt:81 (catkin_package)

-- Configuring incomplete, errors occurred!
See also "/home/carlos/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/carlos/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

while the CMakeError.log is:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec972305253/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec972305253.dir/build.make CMakeFiles/cmTryCompileExec972305253.dir/build
make[1]: Entering directory `/home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec972305253.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec972305253.dir/CheckSymbolExists.c.o   -c /home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec972305253
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec972305253.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec972305253.dir/CheckSymbolExists.c.o  -o cmTryCompileExec972305253 -rdynamic 
CMakeFiles/cmTryCompileExec972305253.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0xa): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: Leaving directory `/home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec972305253] Error 1
make: *** [cmTryCompileExec972305253/fast] Error 2

File /home/carlos/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
  return 0;

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/carlos/catkin_ws ...
edit retag flag offensive close merge delete


Can you add the contents of your CMakeLists.txt as well to your question? Remove all the boilerplate comments first though.

gvdhoorn gravatar image gvdhoorn  ( 2015-05-06 09:59:43 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2015-05-06 11:07:05 -0500

Dirk Thomas gravatar image

The posted console output already contains the exact error message:

CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:104 (message):
  catkin_package() called with unused arguments: ...
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
  beginner_tutorials/CMakeLists.txt:81 (catkin_package)

So you are passing invalid arguments to the catkin_package() function.

If the posted code is actually what you have in your CMake file:

catkin_package( ... CATKIN_DEPENDS message_runtime ... ...)

then ... is clearly not a valid argument. If ... is mentioned in the tutorial it is meant as an example and the dots have to be replaced with whatever else you need to pass.

edit flag offensive delete link more

answered 2016-08-02 10:12:45 -0500

Arjun S Kumar gravatar image

make the following changes


cmake_minimum_required(VERSION 2.8.3) project(beginner_tutorials)

Find catkin and any catkin packages

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg)

Declare ROS messages and services

#add_message_files(DIRECTORY msg FILES Num.msg) #add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

Generate added messages and services

#generate_messages(DEPENDENCIES std_msgs)

Declare a catkin package


include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(talker src/talker.cpp) target_link_libraries(talker ${catkin_LIBRARIES}) add_dependencies(talker beginner_tutorials_generate_messages_cpp)

add_executable(listener src/listener.cpp) target_link_libraries(listener ${catkin_LIBRARIES}) add_dependencies(listener beginner_tutorials_generate_messages_cpp)


edit flag offensive delete link more

answered 2015-05-06 10:23:46 -0500

CarlosRoncal gravatar image

updated 2015-05-06 11:18:47 -0500

This is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3) project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation )

add_message_files( FILES Num.msg )

add_service_files( FILES AddTwoInts.srv )

generate_messages( DEPENDENCIES std_msgs )

catkin_package( ... CATKIN_DEPENDS message_runtime ... ...)

include_directories( ${catkin_INCLUDE_DIRS} )

edit flag offensive delete link more


Please edit your question to add these information instead of filling an answer. Also use the formatting options to keep your code readable.

Dirk Thomas gravatar image Dirk Thomas  ( 2015-05-06 11:02:14 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2015-05-06 08:22:32 -0500

Seen: 20,660 times

Last updated: May 06 '15