fujitatomoya / rcl_logging_syslog

rcl_logging_syslog is alternative logging backend implementation that can be used for ROS 2 application via rcl_logging_interface.
https://github.com/fujitatomoya/rcl_logging_syslog
Apache License 2.0
65 stars 0 forks source link

`humble` build failure: undefined reference to `rcl_logging_external_initialize' #15

Closed fujitatomoya closed 2 months ago

fujitatomoya commented 2 months ago

Build Failure with humble source build

colcon build failure stack ```bash root@tomoyafujita:~/ros2_ws/humble_ws# export RCL_LOGGING_IMPLEMENTATION=rcl_logging_syslog root@tomoyafujita:~/ros2_ws/humble_ws# colcon build --symlink-install --cmake-clean-cache --packages-select rcl_logging_syslog rcl Starting >>> rcl_logging_syslog Finished <<< rcl_logging_syslog [0.66s] Starting >>> rcl --- stderr: rcl /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_rmw_impl_id_check_exe.dir/build.make:129: test/test_rmw_impl_id_check_exe] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:480: test/CMakeFiles/test_rmw_impl_id_check_exe.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_remap__rmw_connextdds.dir/build.make:133: test/test_remap__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:927: test/CMakeFiles/test_remap__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_arguments__rmw_connextdds.dir/build.make:134: test/test_arguments__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:899: test/CMakeFiles/test_arguments__rmw_connextdds.dir/all] Error 2 /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_timer__rmw_connextdds.dir/build.make:164: test/test_timer__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:590: test/CMakeFiles/test_timer__rmw_connextdds.dir/all] Error 2 gmake[2]: *** [test/CMakeFiles/test_remap_integration__rmw_connextdds.dir/build.make:157: test/test_remap_integration__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:955: test/CMakeFiles/test_remap_integration__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_context__rmw_connextdds.dir/build.make:165: test/test_context__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:618: test/CMakeFiles/test_context__rmw_connextdds.dir/all] Error 2 /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' gmake[2]: *** [test/CMakeFiles/test_time__rmw_connextdds.dir/build.make:164: test/test_time__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:562: test/CMakeFiles/test_time__rmw_connextdds.dir/all] Error 2 gmake[2]: *** [test/CMakeFiles/test_client__rmw_connextdds.dir/build.make:189: test/test_client__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:534: test/CMakeFiles/test_client__rmw_connextdds.dir/all] Error 2 /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' gmake[2]: *** [test/CMakeFiles/test_count_matched__rmw_connextdds.dir/build.make:189: test/test_count_matched__rmw_connextdds] Error 1 gmake[2]: *** [test/CMakeFiles/test_node__rmw_connextdds.dir/build.make:166: test/test_node__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:787: test/CMakeFiles/test_count_matched__rmw_connextdds.dir/all] Error 2 gmake[1]: *** [CMakeFiles/Makefile2:871: test/CMakeFiles/test_node__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_lexer__rmw_connextdds.dir/build.make:163: test/test_lexer__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:674: test/CMakeFiles/test_lexer__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status /usr/bin/ld: ../librcl.so: undefined reference to `rcl_logging_external_initialize' collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_get_node_names__rmw_connextdds.dir/build.make:165: test/test_get_node_names__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:646: test/CMakeFiles/test_get_node_names__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_graph__rmw_connextdds.dir/build.make:189: test/test_graph__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:730: test/CMakeFiles/test_graph__rmw_connextdds.dir/all] Error 2 gmake[2]: *** [test/CMakeFiles/test_lexer_lookahead__rmw_connextdds.dir/build.make:165: test/test_lexer_lookahead__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:702: test/CMakeFiles/test_lexer_lookahead__rmw_connextdds.dir/all] Error 2 gmake[2]: *** [test/CMakeFiles/test_init__rmw_connextdds.dir/build.make:165: test/test_init__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:843: test/CMakeFiles/test_init__rmw_connextdds.dir/all] Error 2 collect2: error: ld returned 1 exit status gmake[2]: *** [test/CMakeFiles/test_get_actual_qos__rmw_connextdds.dir/build.make:189: test/test_get_actual_qos__rmw_connextdds] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:815: test/CMakeFiles/test_get_actual_qos__rmw_connextdds.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2 --- Failed <<< rcl [3.95s, exited with code 2] Summary: 1 package finished [5.56s] 1 package failed: rcl 1 package had stderr output: rcl ```

How to reproduce the issue

  1. apply https://docs.ros.org/en/humble/Installation.html procedure.
  2. apply https://github.com/fujitatomoya/rcl_logging_syslog?tab=readme-ov-file#build procedure
  3. then start building as below.
export RCL_LOGGING_IMPLEMENTATION=rcl_logging_syslog
colcon build --symlink-install --cmake-clean-cache --packages-select rcl_logging_syslog rcl

Note

fujitatomoya commented 2 months ago

The root cause is https://github.com/ros2/rcl_logging/pull/109, which actually new feature comes from me and available on Jazzy... 😅 i think we need to have each distro branches, rolling (main), jazzy, iron and humble to support this.