ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

Error while building rcl package

I am trying to build my rcl package using the following command
src/ament/ament_tools/scripts/ament.py build --build-tests --symlink-install --only rcl --force-cmake-configure --make-flags -j1

but it is not getting build and following error is being shown

src/ament/ament_tools/scripts/ament.py build --build-tests --symlink-install --only rcl --force-cmake-configure --make-flags -j1
# Topological order
 - ( ament_cppcheck )
 - ( ament_flake8 )
 - ( ament_pep257 )
 - ( ament_copyright )
 - ( ament_clang_format )
 - ( ament_cpplint )
 - ( ament_index_python )
 - ( ament_lint_cmake )
 - ( ament_package )
 - ( ament_cmake_core )
 - ( ament_cmake_export_definitions )
 - ( ament_cmake_export_dependencies )
 - ( ament_cmake_export_include_directories )
 - ( ament_cmake_export_interfaces )
 - ( ament_cmake_export_libraries )
 - ( ament_cmake_export_link_flags )
 - ( ament_cmake_gmock )
 - ( ament_cmake_gtest )
 - ( ament_cmake_include_directories )
 - ( ament_cmake_libraries )
 - ( ament_cmake )
 - ( ament_cmake_nose )
 - ( ament_cmake_pytest )
 - ( ament_cmake_python )
 - ( ament_cmake_target_dependencies )
 - ( ament_cmake_test )
 - ( ament_cmake_auto )
 - ( ament_cmake_lint_cmake )
 - ( ament_cmake_copyright )
 - ( ament_cmake_clang_format )
 - ( ament_cmake_cppcheck )
 - ( ament_cmake_cpplint )
 - ( ament_cmake_flake8 )
 - ( ament_cmake_pep257 )
 - ( ament_cmake_pep8 )
 - ( ament_cmake_pyflakes )
 - ( ament_cmake_uncrustify )
 - ( ament_lint_auto )
 - ( ament_pep8 )
 - ( ament_pyflakes )
 - ( console_bridge )
 - ( fastcdr )
 - ( fastrtps )
 - ( gmock_vendor )
 - ( gtest_vendor )
 - ( launch )
 - ( launch_testing )
 - ( libcurl_vendor )
 - ( orocos_kdl )
 - ( osrf_pycommon )
 - ( ament_tools )
 - ( poco_vendor )
 - ( class_loader )
 - ( rviz_assimp_vendor )
 - ( rviz_ogre_vendor )
 - ( rviz_yaml_cpp_vendor )
 - ( tinyxml2_vendor )
 - ( tinyxml_vendor )
 - ( uncrustify )
 - ( ament_uncrustify )
 - ( ament_lint_common )
 - ( ament_cmake_ros )
 - ( ament_index_cpp )
 - ( connext_cmake_module )
 - ( fastrtps_cmake_module )
 - ( opensplice_cmake_module )
 - ( pluginlib )
 - ( python_cmake_module )
 - ( rcutils )
 - ( resource_retriever )
 - ( rmw )
 - ( rmw_implementation_cmake )
 - ( rosidl_default_generators )
 - ( rosidl_default_runtime )
 - ( rosidl_generator_dds_idl )
 - ( rosidl_parser )
 - ( rosidl_cmake )
 - ( rosidl_typesupport_interface )
 - ( rosidl_generator_c )
 - ( rmw_connext_shared_cpp )
 - ( rosidl_generator_cpp )
 - ( rosidl_typesupport_c )
 - ( rosidl_typesupport_connext_cpp )
 - ( rosidl_typesupport_connext_c )
 - ( rmw_connext_cpp )
 - ( rosidl_typesupport_cpp )
 - ( rosidl_typesupport_introspection_c )
 - ( rosidl_typesupport_introspection_cpp )
 - ( rmw_fastrtps_cpp )
 - ( rosidl_typesupport_opensplice_cpp )
 - ( rosidl_typesupport_opensplice_c )
 - ( rmw_opensplice_cpp )
 - ( rmw_implementation )
 - ( rosidl_generator_py )
 - ( builtin_interfaces )
 - ( example_interfaces )
 - ( lifecycle_msgs )
 - ( pendulum_msgs )
 - ( rcl_interfaces )
 - ( rttest )
 - ( rviz_rendering )
 - ( rviz_rendering_tests )
 - ( std_msgs )
 - ( actionlib_msgs )
 - ( geometry_msgs )
 - ( diagnostic_msgs )
 - ( nav_msgs )
 - rcl
 - ( rcl_lifecycle )
 - ( rclcpp )
 - ( composition )
 - ( demo_nodes_cpp_native )
 - ( dummy_map_server )
 - ( examples_rclcpp_minimal_client )
 - ( examples_rclcpp_minimal_composition )
 - ( examples_rclcpp_minimal_publisher )
 - ( examples_rclcpp_minimal_service )
 - ( examples_rclcpp_minimal_subscriber )
 - ( examples_rclcpp_minimal_timer )
 - ( logging_demo )
 - ( rclpy )
 - ( demo_nodes_py )
 - ( examples_rclpy_executors )
 - ( examples_rclpy_minimal_client )
 - ( examples_rclpy_minimal_publisher )
 - ( examples_rclpy_minimal_service )
 - ( examples_rclpy_minimal_subscriber )
 - ( rclcpp_lifecycle )
 - ( ros2cli )
 - ( ros2msg )
 - ( ros2node )
 - ( ros2pkg )
 - ( ros2run )
 - ( lifecycle )
 - ( sensor_msgs )
 - ( demo_nodes_cpp )
 - ( dummy_sensors )
 - ( image_tools )
 - ( intra_process_demo )
 - ( shape_msgs )
 - ( sros2 )
 - ( std_srvs )
 - ( ros2srv )
 - ( stereo_msgs )
 - ( test_msgs )
 - ( ros2topic )
 - ( ros2service )
 - ( test_communication )
 - ( test_rclcpp )
 - ( test_security )
 - ( tf2 )
 - ( tf2_msgs )
 - ( tf2_ros )
 - ( tf2_eigen )
 - ( tf2_geometry_msgs )
 - ( tlsf )
 - ( tlsf_cpp )
 - ( pendulum_control )
 - ( topic_monitor )
 - ( trajectory_msgs )
 - ( urdfdom_headers )
 - ( urdfdom )
 - ( urdf )
 - ( kdl_parser )
 - ( robot_state_publisher )
 - ( dummy_robot_bringup )
 - ( rviz_common )
 - ( rviz2 )
 - ( rviz_default_plugins )
 - ( visualization_msgs )
 - ( common_interfaces )
 - ( ros1_bridge )
# Skipping: ament_cppcheck
# Skipping: ament_flake8
# Skipping: ament_pep257
# Skipping: ament_copyright
# Skipping: ament_clang_format
# Skipping: ament_cpplint
# Skipping: ament_index_python
# Skipping: ament_lint_cmake
# Skipping: ament_package
# Skipping: ament_cmake_core
# Skipping: ament_cmake_export_definitions
# Skipping: ament_cmake_export_dependencies
# Skipping: ament_cmake_export_include_directories
# Skipping: ament_cmake_export_interfaces
# Skipping: ament_cmake_export_libraries
# Skipping: ament_cmake_export_link_flags
# Skipping: ament_cmake_gmock
# Skipping: ament_cmake_gtest
# Skipping: ament_cmake_include_directories
# Skipping: ament_cmake_libraries
# Skipping: ament_cmake
# Skipping: ament_cmake_nose
# Skipping: ament_cmake_pytest
# Skipping: ament_cmake_python
# Skipping: ament_cmake_target_dependencies
# Skipping: ament_cmake_test
# Skipping: ament_cmake_auto
# Skipping: ament_cmake_lint_cmake
# Skipping: ament_cmake_copyright
# Skipping: ament_cmake_clang_format
# Skipping: ament_cmake_cppcheck
# Skipping: ament_cmake_cpplint
# Skipping: ament_cmake_flake8
# Skipping: ament_cmake_pep257
# Skipping: ament_cmake_pep8
# Skipping: ament_cmake_pyflakes
# Skipping: ament_cmake_uncrustify
# Skipping: ament_lint_auto
# Skipping: ament_pep8
# Skipping: ament_pyflakes
# Skipping: console_bridge
# Skipping: fastcdr
# Skipping: fastrtps
# Skipping: gmock_vendor
# Skipping: gtest_vendor
# Skipping: launch
# Skipping: launch_testing
# Skipping: libcurl_vendor
# Skipping: orocos_kdl
# Skipping: osrf_pycommon
# Skipping: ament_tools
# Skipping: poco_vendor
# Skipping: class_loader
# Skipping: rviz_assimp_vendor
# Skipping: rviz_ogre_vendor
# Skipping: rviz_yaml_cpp_vendor
# Skipping: tinyxml2_vendor
# Skipping: tinyxml_vendor
# Skipping: uncrustify
# Skipping: ament_uncrustify
# Skipping: ament_lint_common
# Skipping: ament_cmake_ros
# Skipping: ament_index_cpp
# Skipping: connext_cmake_module
# Skipping: fastrtps_cmake_module
# Skipping: opensplice_cmake_module
# Skipping: pluginlib
# Skipping: python_cmake_module
# Skipping: rcutils
# Skipping: resource_retriever
# Skipping: rmw
# Skipping: rmw_implementation_cmake
# Skipping: rosidl_default_generators
# Skipping: rosidl_default_runtime
# Skipping: rosidl_generator_dds_idl
# Skipping: rosidl_parser
# Skipping: rosidl_cmake
# Skipping: rosidl_typesupport_interface
# Skipping: rosidl_generator_c
# Skipping: rmw_connext_shared_cpp
# Skipping: rosidl_generator_cpp
# Skipping: rosidl_typesupport_c
# Skipping: rosidl_typesupport_connext_cpp
# Skipping: rosidl_typesupport_connext_c
# Skipping: rmw_connext_cpp
# Skipping: rosidl_typesupport_cpp
# Skipping: rosidl_typesupport_introspection_c
# Skipping: rosidl_typesupport_introspection_cpp
# Skipping: rmw_fastrtps_cpp
# Skipping: rosidl_typesupport_opensplice_cpp
# Skipping: rosidl_typesupport_opensplice_c
# Skipping: rmw_opensplice_cpp
# Skipping: rmw_implementation
# Skipping: rosidl_generator_py
# Skipping: builtin_interfaces
# Skipping: example_interfaces
# Skipping: lifecycle_msgs
# Skipping: pendulum_msgs
# Skipping: rcl_interfaces
# Skipping: rttest
# Skipping: rviz_rendering
# Skipping: rviz_rendering_tests
# Skipping: std_msgs
# Skipping: actionlib_msgs
# Skipping: geometry_msgs
# Skipping: diagnostic_msgs
# Skipping: nav_msgs
# Skipping: rcl_lifecycle
# Skipping: rclcpp
# Skipping: composition
# Skipping: demo_nodes_cpp_native
# Skipping: dummy_map_server
# Skipping: examples_rclcpp_minimal_client
# Skipping: examples_rclcpp_minimal_composition
# Skipping: examples_rclcpp_minimal_publisher
# Skipping: examples_rclcpp_minimal_service
# Skipping: examples_rclcpp_minimal_subscriber
# Skipping: examples_rclcpp_minimal_timer
# Skipping: logging_demo
# Skipping: rclpy
# Skipping: demo_nodes_py
# Skipping: examples_rclpy_executors
# Skipping: examples_rclpy_minimal_client
# Skipping: examples_rclpy_minimal_publisher
# Skipping: examples_rclpy_minimal_service
# Skipping: examples_rclpy_minimal_subscriber
# Skipping: rclcpp_lifecycle
# Skipping: ros2cli
# Skipping: ros2msg
# Skipping: ros2node
# Skipping: ros2pkg
# Skipping: ros2run
# Skipping: lifecycle
# Skipping: sensor_msgs
# Skipping: demo_nodes_cpp
# Skipping: dummy_sensors
# Skipping: image_tools
# Skipping: intra_process_demo
# Skipping: shape_msgs
# Skipping: sros2
# Skipping: std_srvs
# Skipping: ros2srv
# Skipping: stereo_msgs
# Skipping: test_msgs
# Skipping: ros2topic
# Skipping: ros2service
# Skipping: test_communication
# Skipping: test_rclcpp
# Skipping: test_security
# Skipping: tf2
# Skipping: tf2_msgs
# Skipping: tf2_ros
# Skipping: tf2_eigen
# Skipping: tf2_geometry_msgs
# Skipping: tlsf
# Skipping: tlsf_cpp
# Skipping: pendulum_control
# Skipping: topic_monitor
# Skipping: trajectory_msgs
# Skipping: urdfdom_headers
# Skipping: urdfdom
# Skipping: urdf
# Skipping: kdl_parser
# Skipping: robot_state_publisher
# Skipping: dummy_robot_bringup
# Skipping: rviz_common
# Skipping: rviz2
# Skipping: rviz_default_plugins
# Skipping: visualization_msgs
# Skipping: common_interfaces
# Skipping: ros1_bridge

Process package 'rcl' with context:
--------------------------------------------------------------------------------
 source_space => /home/nvidia/ros2_ws/src/ros2/rcl/rcl
  build_space => /home/nvidia/ros2_ws/build/rcl
install_space => /home/nvidia/ros2_ws/install
   make_flags => -j1
  build_tests => True
--------------------------------------------------------------------------------
+++ Building 'rcl'
==> '. /home/nvidia/ros2_ws/build/rcl/cmake__build.sh && /usr/bin/cmake /home/nvidia/ros2_ws/src/ros2/rcl/rcl -DBUILD_TESTING=1 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/nvidia/ros2_ws/install' in '/home/nvidia/ros2_ws/build/rcl'
-- Found ament_cmake_ros: 0.4.0 (/home/nvidia/ros2_ws/install/share/ament_cmake_ros/cmake)
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Override CMake install command with custom implementation using symlinks instead of copying resources
-- Found rcl_interfaces: 0.4.0 (/home/nvidia/ros2_ws/install/share/rcl_interfaces/cmake)
-- Found rcutils: 0.4.0 (/home/nvidia/ros2_ws/install/share/rcutils/cmake)
-- Found rmw: 0.4.0 (/home/nvidia/ros2_ws/install/share/rmw/cmake)
-- Found rmw_implementation: 0.4.0 (/home/nvidia/ros2_ws/install/share/rmw_implementation/cmake)
-- Found rmw_implementation_cmake: 0.4.0 (/home/nvidia/ros2_ws/install/share/rmw_implementation_cmake/cmake)
-- Using RMW implementation 'rmw_fastrtps_cpp' as default
-- Found rmw_fastrtps_cpp: 0.4.0 (/home/nvidia/ros2_ws/install/share/rmw_fastrtps_cpp/cmake)
-- Found fastrtps_cmake_module: 0.4.0 (/home/nvidia/ros2_ws/install/share/fastrtps_cmake_module/cmake)
-- Found ament_lint_auto: 0.4.0 (/home/nvidia/ros2_ws/install/share/ament_lint_auto/cmake)
-- Found ament_cmake_nose: 0.4.0 (/home/nvidia/ros2_ws/install/share/ament_cmake_nose/cmake)
-- Found rclcpp: 0.4.0 (/home/nvidia/ros2_ws/install/share/rclcpp/cmake)
CMake Error at /home/nvidia/ros2_ws/install/share/rclcpp/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package):
  By not providing "Findrcl.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "rcl", but
  CMake did not find one.

  Could not find a package configuration file provided by "rcl" with any of
  the following names:

    rclConfig.cmake
    rcl-config.cmake

  Add the installation prefix of "rcl" to CMAKE_PREFIX_PATH or set "rcl_DIR"
  to a directory containing one of the above files.  If "rcl" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  /home/nvidia/ros2_ws/install/share/rclcpp/cmake/rclcppConfig.cmake:30 (include)
  test/CMakeLists.txt:7 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/nvidia/ros2_ws/build/rcl/CMakeFiles/CMakeOutput.log".

<== Command '. /home/nvidia/ros2_ws/build/rcl/cmake__build.sh && /usr/bin/cmake /home/nvidia/ros2_ws/src/ros2/rcl/rcl -DBUILD_TESTING=1 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/nvidia/ros2_ws/install' failed in '/home/nvidia/ros2_ws/build/rcl' with exit code '1'
<== Command '. /home/nvidia/ros2_ws/build/rcl/cmake__build.sh && /usr/bin/cmake /home/nvidia/ros2_ws/src/ros2/rcl/rcl -DBUILD_TESTING=1 -DAMENT_CMAKE_SYMLINK_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/home/nvidia/ros2_ws/install' failed in '/home/nvidia/ros2_ws/build/rcl' with exit code '1​

You’re going to have to give some more details here, it looks like you have rcl depending on rcl (and rclcpp) based on the cmake output. I have no idea what’s going on, and I guess it has something to do with “my rcl package” which implies to me you’ve been changing rcl in place?