gz-rendering icon indicating copy to clipboard operation
gz-rendering copied to clipboard

Ubuntu 22 gz-rendering8 compilation failed due to include errors with gz/common/Animation.hh and gz/common/Material.hh

Open Ryanf55 opened this issue 1 year ago • 3 comments

Environment

  • OS Version: Ubuntu 22
  • Source or binary build? Source, with gz-rendering8 branch at c62f6e91940b30af6f2dcc7accafb828131e2050
In file included from /home/ryan/Dev/ros2_ws/src/gz-rendering/src/MoveToHelper.cc:18:
/home/ryan/Dev/ros2_ws/src/gz-rendering/include/gz/rendering/MoveToHelper.hh:22:10: fatal error: gz/common/Animation.hh: No such file or directory
   22 | #include <gz/common/Animation.hh>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/ryan/Dev/ros2_ws/src/gz-rendering/src/Scene.cc:18:
/home/ryan/Dev/ros2_ws/src/gz-rendering/include/gz/rendering/Scene.hh:24:10: fatal error: gz/common/Material.hh: No such file or directory
   24 | #include <gz/common/Material.hh>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Description

  • Expected behavior: Successful compilation.
  • Actual behavior: Include errors with no warnings at configure time of missing packages

Steps to reproduce

  1. Get Ubuntu 22 OS with ROS humble installed through binaries
  2. Install gazebo garden and gazebo harmonic through binaries
  3. Create a workspace and follow all steps to build harmonic from source
  4. Modify to only install the required packages with --no-install-recommends --no-install-suggests to minimize system bloat:
    sudo apt-get  install --no-install-recommends --no-install-suggests  $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | sed '/gz\|sdf/d' | tr '\n' ' ') 
    

Output

Here is the full build log generated with the following command:

colcon build --packages-up-to gz-cmake3 gz-sim8 --mixin debug --event-handlers=console_cohesion+ > build_log.txt

build_log.txt

Here is the list of all installed apt pacakges and versions on my machine generated with the following command:

apt list --installed > installed_packages.txt

installed_packages.txt

Related

Similar to https://github.com/gazebosim/gz-common/pull/573#pullrequestreview-1834704650, it could be expecting optional packages to exist and not warning or skipping.

Ryanf55 avatar Jan 20 '24 17:01 Ryanf55

hmm interesting, we do mark gz-common's graphics components as REQUIRED in CMakeLists.txt. I wonder if it's because cmake found the system installed gz-common5-graphics component and assumed it's available but when trying to compile the files, it uses the gz-common5 build dir in local colcon workspace that does not have the graphics component built.

iche033 avatar Jan 22 '24 21:01 iche033

hmm interesting, we do mark gz-common's graphics components as REQUIRED in CMakeLists.txt. I wonder if it's because cmake found the system installed gz-common5-graphics component and assumed it's available but when trying to compile the files, it uses the gz-common5 build dir in local colcon workspace that does not have the graphics component built.

I'll take a look at the system gz-common5-graphs and check if it's properly expressing its component dependencies:

https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html

check_required_components(<PackageName>) should be called at the end of the FooConfig.cmake file. This macro checks whether all requested, non-optional components have been found, and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package is considered to be not found. It does that by testing the Foo_<Component>_FOUND variables for all requested required components. 

Ryanf55 avatar Jan 22 '24 21:01 Ryanf55

Is this fixed by https://github.com/gazebosim/gz-common/pull/573?

azeey avatar Apr 04 '24 19:04 azeey