PickNikRobotics / generate_parameter_library

Declarative ROS 2 Parameters
BSD 3-Clause "New" or "Revised" License
240 stars 45 forks source link

Building from source on Ubuntu 20.04 failed #171

Closed qleonardolp closed 8 months ago

qleonardolp commented 9 months ago

I've been working on a environment that needs to run on Ubuntu 20.04, with ros2 Humble. I'm trying to build ros2_controllers, then I realized that it was missing the build of the dependencies such as generate_parameter_library. Since in this case we are using a unofficial ubuntu version for Humble, I'm build from source most of the dependencies. Until this moment what is working:

  1. Installed fmt: apt install libfmt-dev
  2. Cloned PickNikRobotics/cpp_polyfills
  3. colcon build --packages-select tcb_span tl_expected
  4. Cloned PickNikRobotics/RSL
  5. Unfortunately, in this one it was necessary to set the cmake_minimum_required to 3.16 at the CMakeList. The build worked, but I don't know how wrong this can be
  6. Installed typeguard: $pip3 install typeguard
  7. Cloned generate_parameter_library
  8. Builded generate_parameter_library_py, parameter_traits, and generate_parameter_library using colcon
  9. The error comes when building generate_parameter_library_example. The building fail with the following message:
CMake Error at /home/<username>/ros2_ws/install/generate_parameter_library/share/generate_parameter_library/cmake/generate_parameter_library.cmake:42 (cmake_path):
  Unknown CMake command "cmake_path".
Call stack (most recent call first):
  CMakeList.txt:15 (generate_parameter_library)

More datails about my setup:

christophfroehlich commented 9 months ago

Ubuntu 20.04 is not unoffical for humble, but Tier 3.

For RSL and CMake version see https://github.com/PickNikRobotics/RSL/issues/113

Maybe this solves your problem: https://github.com/PickNikRobotics/generate_parameter_library/issues/124

qleonardolp commented 9 months ago

Ubuntu 20.04 is not unoffical for humble, but Tier 3.

For RSL and CMake version see PickNikRobotics/RSL#113

Maybe this solves your problem: #124

Thanks for your fast reply. I tried the proposed solution from https://github.com/PickNikRobotics/generate_parameter_library/issues/124#issuecomment-1625504707, but it not worked.

qleonardolp commented 9 months ago

I realized that the actual issue was the old cmake version. After build and install from source cmake 3.28 the build worked fine, such as building the packages that depends of this, in my case ros2_controllers joint_state_broadcaster and forward_command_controller.

It's noteworthy to mention that after build from source cmake, one must have to reinstall ros-dev-tools.

christophfroehlich commented 9 months ago

I see now that this library has a wrong cmake_minimum_required declaration, cmake_path is available only from 3.20 on: https://cmake.org/cmake/help/latest/command/cmake_path.html

https://github.com/PickNikRobotics/generate_parameter_library/blob/f0d9819b0e6875d3e6e6dd66846b76aa72159d50/generate_parameter_library/CMakeLists.txt#L1

pac48 commented 8 months ago

@christophfroehlich Can we close this issue now that https://github.com/PickNikRobotics/generate_parameter_library/pull/173 is merged?

christophfroehlich commented 8 months ago

yes :+1: