Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

catkin_make failed

I recently installed ROS indigo and following the tutorial to get to know ROS. However, error occurred after catkin_make. I have also included the log files. Please help me out let me know how to fix this!! Appreciate it!!

The error:

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

####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

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

My CMakelists.txt:

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 with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

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)

CMakeError.log:

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

Run Build Command:/usr/bin/make "cmTryCompileExec917054501/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec917054501.dir/build.make CMakeFiles/cmTryCompileExec917054501.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o   -c /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec917054501
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec917054501.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o  -o cmTryCompileExec917054501 -rdynamic 
CMakeFiles/cmTryCompileExec917054501.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]: *** [cmTryCompileExec917054501] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec917054501/fast] Error 2

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

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2346830332/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2346830332.dir/build.make CMakeFiles/cmTryCompileExec2346830332.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2346830332
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2346830332.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2346830332 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2346830332] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2346830332/fast] Error 2

Environment variable:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

catkin_make failed

I recently installed ROS indigo and following the tutorial to get to know ROS. However, error occurred after catkin_make. I have also included the log files. Please help me out let me know how to fix this!! Appreciate it!!


The error:

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

####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

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

My CMakelists.txt:

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 with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

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)

CMakeError.log:

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

Run Build Command:/usr/bin/make "cmTryCompileExec917054501/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec917054501.dir/build.make CMakeFiles/cmTryCompileExec917054501.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o   -c /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec917054501
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec917054501.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o  -o cmTryCompileExec917054501 -rdynamic 
CMakeFiles/cmTryCompileExec917054501.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]: *** [cmTryCompileExec917054501] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec917054501/fast] Error 2

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

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2346830332/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2346830332.dir/build.make CMakeFiles/cmTryCompileExec2346830332.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2346830332
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2346830332.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2346830332 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2346830332] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2346830332/fast] Error 2

Environment variable:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

catkin_make failed

I recently installed ROS indigo and following the tutorial to get to know ROS. However, error occurred after catkin_make. I have also included the log files. Please help me out let me know how to fix this!! Appreciate it!!


The error:

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

####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

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

My CMakelists.txt:

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 with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

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)

CMakeError.log:

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

Run Build Command:/usr/bin/make "cmTryCompileExec917054501/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec917054501.dir/build.make CMakeFiles/cmTryCompileExec917054501.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o   -c /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec917054501
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec917054501.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o  -o cmTryCompileExec917054501 -rdynamic 
CMakeFiles/cmTryCompileExec917054501.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]: *** [cmTryCompileExec917054501] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec917054501/fast] Error 2

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

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2346830332/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2346830332.dir/build.make CMakeFiles/cmTryCompileExec2346830332.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2346830332
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2346830332.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2346830332 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2346830332] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2346830332/fast] Error 2

Environment variable:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

catkin_make failed

I recently installed ROS indigo and following the tutorial to get to know ROS. However, error occurred after catkin_make. I have also included the log files. Please help me out let me know how to fix this!! Appreciate it!!


The error:

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

####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /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/ciara/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.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

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

My CMakelists.txt:

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 with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

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)

CMakeError.log:

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

Run Build Command:/usr/bin/make "cmTryCompileExec917054501/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec917054501.dir/build.make CMakeFiles/cmTryCompileExec917054501.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o   -c /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec917054501
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec917054501.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec917054501.dir/CheckSymbolExists.c.o  -o cmTryCompileExec917054501 -rdynamic 
CMakeFiles/cmTryCompileExec917054501.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]: *** [cmTryCompileExec917054501] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec917054501/fast] Error 2

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

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2346830332/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2346830332.dir/build.make CMakeFiles/cmTryCompileExec2346830332.dir/build
make[1]: Entering directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2346830332
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2346830332.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2346830332.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2346830332 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec2346830332] Error 1
make[1]: Leaving directory `/home/ciara/catkin_ws/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec2346830332/fast] Error 2

Environment variable:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros