ros2/rmw_cyclonedds

Compilation error while building ros2 humble on ubunutu 20.04 from source

Tan-B24 opened this issue · 3 comments

Bug report

Required Info:

  • Operating System:
    Ubuntu 20.04
  • Installation type:
    building from source

Steps to reproduce issue

Following the steps to install ros2 humble on ubunutu 20.04 using the following:
https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html

Expected behavior

Should compile without errors.

Actual behavior

I am getting this error while compiling the ros2 workspace.
--- stderr: rmw_cyclonedds_cpp
/home/tan/ros2_humble/ros2/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/rmw_node.cpp:85:10: fatal error: dds/ddsc/dds_data_allocator.h: No such file or directory
85 | #include "dds/ddsc/dds_data_allocator.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rmw_cyclonedds_cpp.dir/build.make:76: CMakeFiles/rmw_cyclonedds_cpp.dir/src/rmw_node.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/tan/ros2_humble/ros2/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/serdata.cpp:27:10: fatal error: dds/ddsi/q_radmin.h: No such file or directory
27 | #include "dds/ddsi/q_radmin.h"
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rmw_cyclonedds_cpp.dir/build.make:89: CMakeFiles/rmw_cyclonedds_cpp.dir/src/serdata.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/rmw_cyclonedds_cpp.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Additional information

Hi @Tan-B24. It seems like you trying to build cyclonedds from master branch. Try to checkout on release/0.10.x branch and try to build rmw again.

When I try building it from the release/0.10.x branch it gives me error while building cyclonedds itself without going further to the rmw build.

--- stderr: cyclonedds
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make[2]: *** [src/core/CMakeFiles/ddsc.dir/build.make:2442: lib/libddsc.so.0.10.4] Error 1
make[1]: *** [CMakeFiles/Makefile2:735: src/core/CMakeFiles/ddsc.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Failed <<< cyclonedds [10.3s, exited with code 2]
Aborted <<< ament_cmake_gtest [3.98s]
Aborted <<< ament_cmake_pytest [3.66s]
Aborted <<< ament_lint_auto [3.37s]
Aborted <<< ament_cmake_google_benchmark [3.09s]
Aborted <<< ament_cmake_nose [2.80s]
Aborted <<< ament_cmake_vendor_package [2.52s]
Aborted <<< ament_copyright [13.4s]

Summary: 36 packages finished [1min 47s]
1 package failed: cyclonedds
7 packages aborted: ament_cmake_google_benchmark ament_cmake_gtest ament_cmake_nose ament_cmake_pytest ament_cmake_vendor_package ament_copyright ament_lint_auto
12 packages had stderr output: ament_cmake_test ament_copyright ament_cppcheck ament_flake8 ament_lint ament_mypy ament_package ament_pep257 ament_pycodestyle ament_pyflakes cyclonedds osrf_pycommon
301 packages not processed

Hi, I had the same error. What I tried and worked for me is I changed to the release/0.9.x branch and then in the cyclondds package, I changed the colcon. pkg to -DBUILD_IDLC=AUTO which was previously set to OFF in my case.

My current cyclonedds is cloned from this fork and not the original fork due to some system dependency issues.

Current System: Ubuntu 22.04
Ros Version: ROS Humble.
Read More: issue.