Robotics StackExchange | Archived questions

Compiling workspace files failing for cmake error

Hi All,

I am trying to work on Hector SLAM using rosbot simulation in gazebo. I have ROS Kinetic installed in Ubuntu 16.04 LTS.

I have cloned the required repositories for hector slam. rplidar and rosbot from github into the source folder.

After that I installed all the dependencies required using following command in catkin_workspace.

rosdep install --from-paths src --ignore-src -r -y

which results in

executing command [sudo -H apt-get install -y gazebo7]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gazebo7 : Depends: libgazebo7 (= 7.15.0-1~xenial) but it is not going to be installed
           Depends: libsdformat4 but it is not going to be installed
           Depends: gazebo7-common (= 7.15.0-1~xenial) but it is not going to be installed
           Recommends: gazebo7-plugin-base
E: Unable to correct problems, you have held broken packages.
executing command [sudo -H apt-get install -y libgazebo7-dev]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgazebo7-dev : Depends: libsdformat4-dev but it is not going to be installed
                  Depends: libgazebo7 (= 7.15.0-1~xenial) but it is not going to be installed
                  Depends: gazebo7-common (= 7.15.0-1~xenial) but it is not going to be installed
                  Depends: gazebo7-plugin-base (= 7.15.0-1~xenial)
E: Unable to correct problems, you have held broken packages.
ERROR: the following rosdeps failed to install
  apt: command [sudo -H apt-get install -y gazebo7] failed
  apt: command [sudo -H apt-get install -y libgazebo7-dev] failed
  apt: Failed to detect successful installation of [gazebo7]
  apt: Failed to detect successful installation of [libgazebo7-dev]

After this I invoke catkin_make which is resulting in cmake errors.

catkin_make --only-pkg-with-deps rplidar_ros hector_slam

This results in

Base path: /home/rnd415/catkin_workspace
Source space: /home/rnd415/catkin_workspace/src
Build space: /home/rnd415/catkin_workspace/build
Devel space: /home/rnd415/catkin_workspace/devel
Install space: /home/rnd415/catkin_workspace/install
Whitelisted packages: hector_compressed_map_transport, hector_geotiff, hector_geotiff_plugins, hector_imu_attitude_to_tf, hector_map_server, hector_map_tools, hector_mapping, hector_marker_drawing, hector_nav_msgs, hector_slam, hector_slam_launch, hector_trajectory_server, rplidar_ros
####
#### Running command: "cmake /home/rnd415/catkin_workspace/src -DCATKIN_DEVEL_PREFIX=/home/rnd415/catkin_workspace/devel -DCMAKE_INSTALL_PREFIX=/home/rnd415/catkin_workspace/install -DCATKIN_WHITELIST_PACKAGES=hector_compressed_map_transport;hector_geotiff;hector_geotiff_plugins;hector_imu_attitude_to_tf;hector_map_server;hector_map_tools;hector_mapping;hector_marker_drawing;hector_nav_msgs;hector_slam;hector_slam_launch;hector_trajectory_server;rplidar_ros -G Unix Makefiles" in "/home/rnd415/catkin_workspace/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/rnd415/catkin_workspace/devel
-- Using CMAKE_PREFIX_PATH: /home/rnd415/catkin_workspace/devel;/opt/ros/kinetic
-- This workspace overlays: /home/rnd415/catkin_workspace/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
CMake Error at /opt/ros/kinetic/share/catkin/cmake/test/tests.cmake:54 (file):
  file failed to open for writing (Permission denied):

    /home/rnd415/catkin_workspace/build/CTestCustom.cmake
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:163 (include)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:56 (find_package)


-- Using CATKIN_TEST_RESULTS_DIR: /home/rnd415/catkin_workspace/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.18
-- BUILD_SHARED_LIBS is on
CMake Error: Could not open file for write in copy operation /home/rnd415/catkin_workspace/build/atomic_configure/_setup_util.py.tmp
CMake Error: : System Error: Permission denied
CMake Error at /opt/ros/kinetic/share/catkin/cmake/atomic_configure_file.cmake:4 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_generate_environment.cmake:40 (atomic_configure_file)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:189 (catkin_generate_environment)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:56 (find_package)


-- BUILD_SHARED_LIBS is on
-- Using CATKIN_WHITELIST_PACKAGES: hector_compressed_map_transport;hector_geotiff;hector_geotiff_plugins;hector_imu_attitude_to_tf;hector_map_server;hector_map_tools;hector_mapping;hector_marker_drawing;hector_nav_msgs;hector_slam;hector_slam_launch;hector_trajectory_server;rplidar_ros
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 13 packages in topological order:
-- ~~  - hector_slam (metapackage)
-- ~~  - hector_slam_launch
-- ~~  - hector_map_tools
-- ~~  - hector_nav_msgs
-- ~~  - hector_geotiff
-- ~~  - hector_geotiff_plugins
-- ~~  - hector_marker_drawing
-- ~~  - hector_compressed_map_transport
-- ~~  - rplidar_ros
-- ~~  - hector_imu_attitude_to_tf
-- ~~  - hector_map_server
-- ~~  - hector_trajectory_server
-- ~~  - hector_mapping
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'hector_slam'
-- ==> add_subdirectory(hector_slam/hector_slam)
-- +++ processing catkin package: 'hector_slam_launch'
-- ==> add_subdirectory(hector_slam/hector_slam_launch)
-- +++ processing catkin package: 'hector_map_tools'
-- ==> add_subdirectory(hector_slam/hector_map_tools)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_nav_msgs'
-- ==> add_subdirectory(hector_slam/hector_nav_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- hector_nav_msgs: 0 messages, 5 services
-- +++ processing catkin package: 'hector_geotiff'
-- ==> add_subdirectory(hector_slam/hector_geotiff)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_geotiff_plugins'
-- ==> add_subdirectory(hector_slam/hector_geotiff_plugins)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_marker_drawing'
-- ==> add_subdirectory(hector_slam/hector_marker_drawing)
-- +++ processing catkin package: 'hector_compressed_map_transport'
-- ==> add_subdirectory(hector_slam/hector_compressed_map_transport)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'rplidar_ros'
-- ==> add_subdirectory(rplidar_ros)
-- +++ processing catkin package: 'hector_imu_attitude_to_tf'
-- ==> add_subdirectory(hector_slam/hector_imu_attitude_to_tf)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_map_server'
-- ==> add_subdirectory(hector_slam/hector_map_server)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_trajectory_server'
-- ==> add_subdirectory(hector_slam/hector_trajectory_server)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'hector_mapping'
-- ==> add_subdirectory(hector_slam/hector_mapping)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   signals
--   chrono
--   system
--   date_time
--   atomic
-- hector_mapping: 2 messages, 0 services
-- Configuring incomplete, errors occurred!
See also "/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeOutput.log".
See also "/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
Makefile:892: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

The Cmakeoutput.log is as follows

Detecting CXX [-std=c++98] compiler features compiled with the following output:
Change Dir: /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_7d8f9/fast"
/usr/bin/make -f CMakeFiles/cmTC_7d8f9.dir/build.make CMakeFiles/cmTC_7d8f9.dir/build
make[1]: Entering directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_7d8f9.dir/feature_tests.cxx.o
/usr/bin/c++     -std=c++98 -o CMakeFiles/cmTC_7d8f9.dir/feature_tests.cxx.o -c /home/rnd415/catkin_workspace/build/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_7d8f9
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7d8f9.dir/link.txt --verbose=1
/usr/bin/c++        CMakeFiles/cmTC_7d8f9.dir/feature_tests.cxx.o  -o cmTC_7d8f9 -rdynamic 
make[1]: Leaving directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'


    Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers
    Feature record: CXX_FEATURE:0cxx_alias_templates
    Feature record: CXX_FEATURE:0cxx_alignas
    Feature record: CXX_FEATURE:0cxx_alignof
    Feature record: CXX_FEATURE:0cxx_attributes
    Feature record: CXX_FEATURE:0cxx_attribute_deprecated
    Feature record: CXX_FEATURE:0cxx_auto_type
    Feature record: CXX_FEATURE:0cxx_binary_literals
    Feature record: CXX_FEATURE:0cxx_constexpr
    Feature record: CXX_FEATURE:0cxx_contextual_conversions
    Feature record: CXX_FEATURE:0cxx_decltype
    Feature record: CXX_FEATURE:0cxx_decltype_auto
    Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types
    Feature record: CXX_FEATURE:0cxx_default_function_template_args
    Feature record: CXX_FEATURE:0cxx_defaulted_functions
    Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers
    Feature record: CXX_FEATURE:0cxx_delegating_constructors
    Feature record: CXX_FEATURE:0cxx_deleted_functions
    Feature record: CXX_FEATURE:0cxx_digit_separators
    Feature record: CXX_FEATURE:0cxx_enum_forward_declarations
    Feature record: CXX_FEATURE:0cxx_explicit_conversions
    Feature record: CXX_FEATURE:0cxx_extended_friend_declarations
    Feature record: CXX_FEATURE:0cxx_extern_templates
    Feature record: CXX_FEATURE:0cxx_final
    Feature record: CXX_FEATURE:0cxx_func_identifier
    Feature record: CXX_FEATURE:0cxx_generalized_initializers
    Feature record: CXX_FEATURE:0cxx_generic_lambdas
    Feature record: CXX_FEATURE:0cxx_inheriting_constructors
    Feature record: CXX_FEATURE:0cxx_inline_namespaces
    Feature record: CXX_FEATURE:0cxx_lambdas
    Feature record: CXX_FEATURE:0cxx_lambda_init_captures
    Feature record: CXX_FEATURE:0cxx_local_type_template_args
    Feature record: CXX_FEATURE:0cxx_long_long_type
    Feature record: CXX_FEATURE:0cxx_noexcept
    Feature record: CXX_FEATURE:0cxx_nonstatic_member_init
    Feature record: CXX_FEATURE:0cxx_nullptr
    Feature record: CXX_FEATURE:0cxx_override
    Feature record: CXX_FEATURE:0cxx_range_for
    Feature record: CXX_FEATURE:0cxx_raw_string_literals
    Feature record: CXX_FEATURE:0cxx_reference_qualified_functions
    Feature record: CXX_FEATURE:0cxx_relaxed_constexpr
    Feature record: CXX_FEATURE:0cxx_return_type_deduction
    Feature record: CXX_FEATURE:0cxx_right_angle_brackets
    Feature record: CXX_FEATURE:0cxx_rvalue_references
    Feature record: CXX_FEATURE:0cxx_sizeof_member
    Feature record: CXX_FEATURE:0cxx_static_assert
    Feature record: CXX_FEATURE:0cxx_strong_enums
    Feature record: CXX_FEATURE:1cxx_template_template_parameters
    Feature record: CXX_FEATURE:0cxx_thread_local
    Feature record: CXX_FEATURE:0cxx_trailing_return_types
    Feature record: CXX_FEATURE:0cxx_unicode_literals
    Feature record: CXX_FEATURE:0cxx_uniform_initialization
    Feature record: CXX_FEATURE:0cxx_unrestricted_unions
    Feature record: CXX_FEATURE:0cxx_user_literals
    Feature record: CXX_FEATURE:0cxx_variable_templates
    Feature record: CXX_FEATURE:0cxx_variadic_macros
    Feature record: CXX_FEATURE:0cxx_variadic_templates
Determining if the include file pthread.h exists passed with the following output:
Change Dir: /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_089b2/fast"
/usr/bin/make -f CMakeFiles/cmTC_089b2.dir/build.make CMakeFiles/cmTC_089b2.dir/build
make[1]: Entering directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_089b2.dir/CheckIncludeFile.c.o
/usr/bin/cc     -o CMakeFiles/cmTC_089b2.dir/CheckIncludeFile.c.o   -c /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
Linking C executable cmTC_089b2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_089b2.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTC_089b2.dir/CheckIncludeFile.c.o  -o cmTC_089b2 -rdynamic 
make[1]: Leaving directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'


Determining if the function pthread_create exists in the pthread passed with the following output:
Change Dir: /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_fd76e/fast"
/usr/bin/make -f CMakeFiles/cmTC_fd76e.dir/build.make CMakeFiles/cmTC_fd76e.dir/build
make[1]: Entering directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_fd76e.dir/CheckFunctionExists.c.o
/usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_fd76e.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_fd76e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_fd76e.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_fd76e.dir/CheckFunctionExists.c.o  -o cmTC_fd76e -rdynamic -lpthread 
make[1]: Leaving directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'


Determining if the Q_WS_X11 exist passed with the following output:
Change Dir: /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_61ff4/fast"
/usr/bin/make -f CMakeFiles/cmTC_61ff4.dir/build.make CMakeFiles/cmTC_61ff4.dir/build
make[1]: Entering directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_61ff4.dir/CheckSymbolExists.cxx.o
/usr/bin/c++    -I/usr/include/qt4   -o CMakeFiles/cmTC_61ff4.dir/CheckSymbolExists.cxx.o -c /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
Linking CXX executable cmTC_61ff4
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_61ff4.dir/link.txt --verbose=1
/usr/bin/c++        CMakeFiles/cmTC_61ff4.dir/CheckSymbolExists.cxx.o  -o cmTC_61ff4 -rdynamic 
make[1]: Leaving directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'

File /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <QtCore/qglobal.h>

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

The Cmakeerror.log files is as folllows

Determining if the Q_WS_MAC exist failed with the following output:
Change Dir: /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_4da44/fast"
/usr/bin/make -f CMakeFiles/cmTC_4da44.dir/build.make CMakeFiles/cmTC_4da44.dir/build
make[1]: Entering directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_4da44.dir/CheckSymbolExists.cxx.o
/usr/bin/c++    -I/usr/include/qt4   -o CMakeFiles/cmTC_4da44.dir/CheckSymbolExists.cxx.o -c /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx: In function ‘int main(int, char**)’:
/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: ‘Q_WS_MAC’ was not declared in this scope
   return ((int*)(&Q_WS_MAC))[argc];
                   ^
CMakeFiles/cmTC_4da44.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_4da44.dir/CheckSymbolExists.cxx.o' failed
make[1]: *** [CMakeFiles/cmTC_4da44.dir/CheckSymbolExists.cxx.o] Error 1
make[1]: Leaving directory '/home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_4da44/fast' failed
make: *** [cmTC_4da44/fast] Error 2

File /home/rnd415/catkin_workspace/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <QtCore/qglobal.h>

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

How to resolve these issues ?

Asked by BV_Pradeep on 2019-07-13 23:58:11 UTC

Comments

I have sourced the ros environment using

source /home/rnd415/catkin_workspace/devel/setup.bash

Asked by BV_Pradeep on 2019-07-14 00:14:13 UTC

Answers