tier4 / caret

CARET (Chain-Aware ROS Evaluation Tool) is one of performance analysis tools dedicated with ROS 2 applications
https://tier4.github.io/caret_doc/main/
Apache License 2.0
69 stars 16 forks source link

Build Autoware + CARET failed due to "error: too few arguments to function ‘void ros_trace_rclcpp_publish" #69

Closed takeshi-iwanari closed 1 year ago

takeshi-iwanari commented 1 year ago

Checklist

Issue type

Bug

Step where the issue is related to

Build

Environments

CARET version

Target application

Description

Build failed in obstacle_velocity_limiter and euclidean_cluster due to the following error

/opt/ros/humble/include/rclcpp/rclcpp/publisher.hpp: In member function ‘void rclcpp::Publisher<MessageT, AllocatorT>::do_inter_process_publish(const ROSMessageType&)’:
/opt/ros/humble/include/rclcpp/rclcpp/publisher.hpp:452:5: error: too few arguments to function ‘void ros_trace_rclcpp_publish(const void*, const void*, uint64_t)’
452 |     TRACEPOINT(rclcpp_publish, nullptr, static_cast<const void *>(&msg));
       |     ^~~~~~~~~~
/ros2_caret_ws/install/tracetools/include/tracetools/tracetools/tracetools.h:168:1: note: declared here
168 | DECLARE_TRACEPOINT(
       | ^~~~~~~~~~~~~~~~~~

Steps to reproduce

  1. Update ROS 2 (as of 20220117)
  2. Install CARET
  3. Download Autoware (as of 20220117)
  4. Build Autoware with CARET

Commands

git clone https://github.com/autowarefoundation/autoware.git
cd autoware
./setup-dev-env.sh
mkdir src
vcs import src < autoware.repos
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

source ~/ros2_caret_ws/install/local_setup.bash

colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off
# colcon build --symlink-install --packages-up-to obstacle_velocity_limiter --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off
# colcon build --symlink-install --packages-up-to euclidean_cluster --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off

Logs

#20 1713.7 Starting >>> euclidean_cluster
#20 1744.3 --- stderr: euclidean_cluster
#20 1744.3 CMake Warning at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
#20 1744.3   Cannot generate a safe runtime search path for target cluster_lib because
#20 1744.3   there is a cycle in the constraint graph:
#20 1744.3 
#20 1744.3     dir 0 is [/ros2_caret_ws/install/rclcpp_components/lib]
#20 1744.3     dir 1 is [/autoware/install/tier4_perception_msgs/lib]
#20 1744.3     dir 2 is [/opt/ros/humble/lib]
#20 1744.3       dir 0 must precede it due to runtime library [libcomponent_manager.so]
#20 1744.3       dir 5 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3       dir 6 must precede it due to runtime library [libtracetools.so]
#20 1744.3       dir 14 must precede it due to runtime library [librclcpp.so]
#20 1744.3       dir 15 must precede it due to runtime library [librclcpp_action.so]
#20 1744.3       dir 16 must precede it due to runtime library [librcl_action.so]
#20 1744.3       dir 17 must precede it due to runtime library [librcl.so]
#20 1744.3     dir 3 is [/autoware/install/tier4_pcl_extensions/lib]
#20 1744.3     dir 4 is [/autoware/install/pointcloud_preprocessor/lib]
#20 1744.3     dir 5 is [/ros2_caret_ws/install/rcl_yaml_param_parser/lib]
#20 1744.3       dir 2 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3     dir 6 is [/ros2_caret_ws/install/tracetools/lib]
#20 1744.3     dir 7 is [/autoware/install/autoware_auto_geometry_msgs/lib]
#20 1744.3     dir 8 is [/autoware/install/autoware_auto_perception_msgs/lib]
#20 1744.3     dir 9 is [/autoware/install/autoware_auto_planning_msgs/lib]
#20 1744.3     dir 10 is [/autoware/install/autoware_auto_vehicle_msgs/lib]
#20 1744.3     dir 11 is [/autoware/install/autoware_auto_mapping_msgs/lib]
#20 1744.3     dir 12 is [/autoware/install/tier4_debug_msgs/lib]
#20 1744.3     dir 13 is [/autoware/install/tier4_autoware_utils/lib]
#20 1744.3     dir 14 is [/ros2_caret_ws/install/rclcpp/lib]
#20 1744.3       dir 2 must precede it due to runtime library [librclcpp.so]
#20 1744.3     dir 15 is [/ros2_caret_ws/install/rclcpp_action/lib]
#20 1744.3     dir 16 is [/ros2_caret_ws/install/rcl_action/lib]
#20 1744.3     dir 17 is [/ros2_caret_ws/install/rcl/lib]
#20 1744.3 
#20 1744.3   Some of these libraries may not be found correctly.
#20 1744.3 Call Stack (most recent call first):
#20 1744.3   CMakeLists.txt:16 (ament_auto_add_library)
#20 1744.3 
#20 1744.3 
#20 1744.3 CMake Warning at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
#20 1744.3   Cannot generate a safe runtime search path for target
#20 1744.3   euclidean_cluster_node_core because there is a cycle in the constraint
#20 1744.3   graph:
#20 1744.3 
#20 1744.3     dir 0 is [/opt/ros/humble/lib]
#20 1744.3       dir 3 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3       dir 4 must precede it due to runtime library [libtracetools.so]
#20 1744.3       dir 6 must precede it due to runtime library [libcomponent_manager.so]
#20 1744.3       dir 12 must precede it due to runtime library [librclcpp.so]
#20 1744.3       dir 16 must precede it due to runtime library [librclcpp_action.so]
#20 1744.3       dir 17 must precede it due to runtime library [librcl_action.so]
#20 1744.3       dir 18 must precede it due to runtime library [librcl.so]
#20 1744.3     dir 1 is [/autoware/install/tier4_pcl_extensions/lib]
#20 1744.3     dir 2 is [/autoware/install/pointcloud_preprocessor/lib]
#20 1744.3     dir 3 is [/ros2_caret_ws/install/rcl_yaml_param_parser/lib]
#20 1744.3       dir 0 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3     dir 4 is [/ros2_caret_ws/install/tracetools/lib]
#20 1744.3     dir 5 is [/autoware/install/autoware_auto_geometry_msgs/lib]
#20 1744.3     dir 6 is [/ros2_caret_ws/install/rclcpp_components/lib]
#20 1744.3     dir 7 is [/autoware/install/autoware_auto_perception_msgs/lib]
#20 1744.3     dir 8 is [/autoware/install/autoware_auto_planning_msgs/lib]
#20 1744.3     dir 9 is [/autoware/install/autoware_auto_vehicle_msgs/lib]
#20 1744.3     dir 10 is [/autoware/install/tier4_debug_msgs/lib]
#20 1744.3     dir 11 is [/autoware/install/tier4_autoware_utils/lib]
#20 1744.3     dir 12 is [/ros2_caret_ws/install/rclcpp/lib]
#20 1744.3       dir 0 must precede it due to runtime library [librclcpp.so]
#20 1744.3     dir 13 is [/autoware/build/euclidean_cluster]
#20 1744.3     dir 14 is [/autoware/install/tier4_perception_msgs/lib]
#20 1744.3     dir 15 is [/autoware/install/autoware_auto_mapping_msgs/lib]
#20 1744.3     dir 16 is [/ros2_caret_ws/install/rclcpp_action/lib]
#20 1744.3     dir 17 is [/ros2_caret_ws/install/rcl_action/lib]
#20 1744.3     dir 18 is [/ros2_caret_ws/install/rcl/lib]
#20 1744.3 
#20 1744.3   Some of these libraries may not be found correctly.
#20 1744.3 Call Stack (most recent call first):
#20 1744.3   CMakeLists.txt:32 (ament_auto_add_library)
#20 1744.3 
#20 1744.3 
#20 1744.3 CMake Warning at /opt/ros/humble/share/ament_cmake_auto/cmake/ament_auto_add_library.cmake:66 (add_library):
#20 1744.3   Cannot generate a safe runtime search path for target
#20 1744.3   voxel_grid_based_euclidean_cluster_node_core because there is a cycle in
#20 1744.3   the constraint graph:
#20 1744.3 
#20 1744.3     dir 0 is [/autoware/build/euclidean_cluster]
#20 1744.3     dir 1 is [/opt/ros/humble/lib]
#20 1744.3       dir 4 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3       dir 5 must precede it due to runtime library [libtracetools.so]
#20 1744.3       dir 7 must precede it due to runtime library [libcomponent_manager.so]
#20 1744.3       dir 13 must precede it due to runtime library [librclcpp.so]
#20 1744.3       dir 16 must precede it due to runtime library [librclcpp_action.so]
#20 1744.3       dir 17 must precede it due to runtime library [librcl_action.so]
#20 1744.3       dir 18 must precede it due to runtime library [librcl.so]
#20 1744.3     dir 2 is [/autoware/install/tier4_pcl_extensions/lib]
#20 1744.3     dir 3 is [/autoware/install/pointcloud_preprocessor/lib]
#20 1744.3     dir 4 is [/ros2_caret_ws/install/rcl_yaml_param_parser/lib]
#20 1744.3       dir 1 must precede it due to runtime library [librcl_yaml_param_parser.so]
#20 1744.3     dir 5 is [/ros2_caret_ws/install/tracetools/lib]
#20 1744.3     dir 6 is [/autoware/install/autoware_auto_geometry_msgs/lib]
#20 1744.3     dir 7 is [/ros2_caret_ws/install/rclcpp_components/lib]
#20 1744.3     dir 8 is [/autoware/install/autoware_auto_perception_msgs/lib]
#20 1744.3     dir 9 is [/autoware/install/autoware_auto_planning_msgs/lib]
#20 1744.3     dir 10 is [/autoware/install/autoware_auto_vehicle_msgs/lib]
#20 1744.3     dir 11 is [/autoware/install/tier4_debug_msgs/lib]
#20 1744.3     dir 12 is [/autoware/install/tier4_autoware_utils/lib]
#20 1744.3     dir 13 is [/ros2_caret_ws/install/rclcpp/lib]
#20 1744.3       dir 1 must precede it due to runtime library [librclcpp.so]
#20 1744.3     dir 14 is [/autoware/install/tier4_perception_msgs/lib]
#20 1744.3     dir 15 is [/autoware/install/autoware_auto_mapping_msgs/lib]
#20 1744.3     dir 16 is [/ros2_caret_ws/install/rclcpp_action/lib]
#20 1744.3     dir 17 is [/ros2_caret_ws/install/rcl_action/lib]
#20 1744.3     dir 18 is [/ros2_caret_ws/install/rcl/lib]
#20 1744.3 
#20 1744.3   Some of these libraries may not be found correctly.
#20 1744.3 Call Stack (most recent call first):
#20 1744.3   CMakeLists.txt:45 (ament_auto_add_library)
#20 1744.3 
#20 1744.3 
#20 1744.3 In file included from /opt/ros/humble/include/rclcpp/rclcpp/service.hpp:34,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/callback_group.hpp:25,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/any_executable.hpp:20,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategy.hpp:25,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategies.hpp:18,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/executor_options.hpp:20,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/executor.hpp:37,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:21,
#20 1744.3                  from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
#20 1744.3                  from /opt/ros/humble/include/pcl_conversions/pcl_conversions.h:42,
#20 1744.3                  from /autoware/src/universe/autoware.universe/perception/euclidean_cluster/include/euclidean_cluster/utils.hpp:23,
#20 1744.3                  from /autoware/src/universe/autoware.universe/perception/euclidean_cluster/lib/utils.cpp:14:
#20 1744.3 /opt/ros/humble/include/rclcpp/rclcpp/publisher.hpp: In member function ‘void rclcpp::Publisher<MessageT, AllocatorT>::do_inter_process_publish(const ROSMessageType&)’:
#20 1744.3 /opt/ros/humble/include/rclcpp/rclcpp/publisher.hpp:452:5: error: too few arguments to function ‘void ros_trace_rclcpp_publish(const void*, const void*, uint64_t)’
#20 1744.3   452 |     TRACEPOINT(rclcpp_publish, nullptr, static_cast<const void *>(&msg));
#20 1744.3       |     ^~~~~~~~~~
#20 1744.3 /ros2_caret_ws/install/tracetools/include/tracetools/tracetools/tracetools.h:168:1: note: declared here
#20 1744.3   168 | DECLARE_TRACEPOINT(
#20 1744.3       | ^~~~~~~~~~~~~~~~~~
#20 1744.3 gmake[2]: *** [CMakeFiles/cluster_lib.dir/build.make:76: CMakeFiles/cluster_lib.dir/lib/utils.cpp.o] Error 1
#20 1744.3 gmake[1]: *** [CMakeFiles/Makefile2:145: CMakeFiles/cluster_lib.dir/all] Error 2
#20 1744.3 gmake: *** [Makefile:146: all] Error 2
#20 1744.3 ---
#20 1744.3 Failed   <<< euclidean_cluster [30.6s, exited with code 2]
#20 1760.9 [Processing: euclidean_cluster, shape_estimation]
#20 1760.9 Aborted  <<< shape_estimation [2min 9s]
#20 1761.0 
#20 1761.0 Summary: 68 packages finished [29min 20s]
#20 1761.0   1 package failed: euclidean_cluster
#20 1761.0   1 package aborted: shape_estimation
#20 1761.0   6 packages had stderr output: compare_map_segmentation euclidean_cluster map_loader ndt_omp pointcloud_preprocessor velodyne_pointcloud
#20 1761.0   163 packages not processed
#20 ERROR: process "/bin/sh -c cd autoware &&     . /opt/ros/\"$ROS_DISTRO\"/setup.sh &&     . /ros2_caret_ws/install/local_setup.sh &&     colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off" did not complete successfully: exit code: 2
------
 > [15/17] RUN cd autoware &&     . /opt/ros/"humble"/setup.sh &&     . /ros2_caret_ws/install/local_setup.sh &&     colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off:
#20 1744.3 ---
#20 1744.3 Failed   <<< euclidean_cluster [30.6s, exited with code 2]
#20 1760.9 [Processing: euclidean_cluster, shape_estimation]
#20 1760.9 Aborted  <<< shape_estimation [2min 9s]
#20 1761.0 
#20 1761.0 Summary: 68 packages finished [29min 20s]
#20 1761.0   1 package failed: euclidean_cluster
#20 1761.0   1 package aborted: shape_estimation
#20 1761.0   6 packages had stderr output: compare_map_segmentation euclidean_cluster map_loader ndt_omp pointcloud_preprocessor velodyne_pointcloud
#20 1761.0   163 packages not processed

LTTng trace log file

No response

Screenshots

No response

takeshi-iwanari commented 1 year ago

Cause

SYSTEM is added as dependencies in ament_cmake_auto by https://github.com/ament/ament_cmake/commit/799183ab9bcfd9b66df0de9b644abaf8c9b78e84 . As a result, ros2/rclcpp is used rather than CARET/rclcpp in some packages.

Workaround

<   ament_target_dependencies(${target}  ${${PROJECT_NAME}_FOUND_BUILD_DEPENDS})
---
>   ament_target_dependencies(${target} SYSTEM ${${PROJECT_NAME}_FOUND_BUILD_DEPENDS})