Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gz/common/Image.hh does not exist #351

Closed
robberthofmanfm opened this issue May 6, 2022 · 5 comments
Closed

gz/common/Image.hh does not exist #351

robberthofmanfm opened this issue May 6, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@robberthofmanfm
Copy link

Trying to compile gazebo garden on Ubuntu 20.04.

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build?
    Source, branch main, latest commit b87a28e

Description

  • Expected behavior: compilation
  • Actual behavior: fatal error

Steps to reproduce

https://gazebosim.org/docs/garden/install_ubuntu_src

Output

In file included from ~/gazebo_garden_ws/src/ign-common/geospatial/include/ignition/common/geospatial/ImageHeightmap.hh:18,
                 from ~/gazebo_garden_ws/src/ign-common/geospatial/src/ImageHeightmap.cc:18:
~/gazebo_garden_ws/src/ign-common/geospatial/include/gz/common/geospatial/ImageHeightmap.hh:27:10: fatal error: gz/common/Image.hh: No such file or directory
 #include <gz/common/Image.hh>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
@robberthofmanfm robberthofmanfm added the bug Something isn't working label May 6, 2022
@robberthofmanfm
Copy link
Author

robberthofmanfm commented May 6, 2022

Both
./graphics/include/ignition/common/Image.hh
and
./graphics/include/gz/common/Image.hh
exist, where the former merely seems to import the latter.

@robberthofmanfm
Copy link
Author

robberthofmanfm commented May 6, 2022

Removed build folder, compiled again, seems to work.
Closing as I don't think it's worth investigating further.

E: might have had something to do with sudo apt install libfreeimage-dev

@Ryanf55
Copy link
Contributor

Ryanf55 commented Jan 20, 2024

I ran into this today on harmonic. I do not have libfreeimage-dev installed. I have gz-sim installed on my OS from binaries, but it's crashing and I wanted a source build in debug to run under GDB.

A few duplicate files on the system:

ryan@B650-970:~/Dev/ros2_ws$ locate Image.hh
/usr/include/gz/common5/gz/common/Image.hh
/usr/include/gz/common5/ignition/common/Image.hh
/usr/include/gz/rendering7/gz/rendering/Image.hh
/usr/include/gz/rendering7/ignition/rendering/Image.hh
/usr/include/gz/rendering8/gz/rendering/Image.hh

ryan@B650-970:~/Dev/ros2_ws$ find src/ -type f -name Image.hh
src/gz-common/graphics/include/ignition/common/Image.hh
src/gz-common/graphics/include/gz/common/Image.hh
src/gz-rendering/include/gz/rendering/Image.hh

Build Logs:

ryan@B650-970:~/Dev/ros2_ws$ colcon build --packages-up-to gz-cmake3 gz-sim8 --mixin debug
Starting >>> gz-cmake3
Finished <<< gz-cmake3 [1.30s]                      
Starting >>> gz-utils2
Finished <<< gz-utils2 [7.83s]                       
Starting >>> gz-math7
--- stderr: gz-math7                                 
CMake Warning at /home/ryan/Dev/ros2_ws/install/gz-cmake3/share/cmake/gz-cmake3/cmake3/GzConfigureBuild.cmake:68 (message):
   CONFIGURATION WARNINGS:
   -- Swig is missing: Language interfaces are disabled.
Call Stack (most recent call first):
  CMakeLists.txt:146 (gz_configure_build)


---
Finished <<< gz-math7 [21.2s]
Starting >>> gz-common5
Starting >>> gz-msgs10
Starting >>> sdformat14
--- stderr: gz-common5                                                                                                      
CMake Warning at /home/ryan/Dev/ros2_ws/install/gz-cmake3/share/cmake/gz-cmake3/cmake3/GzConfigureBuild.cmake:68 (message):
   CONFIGURATION WARNINGS:
   -- Skipping component [graphics]: Missing dependency [FreeImage].
      ^~~~~ Set SKIP_graphics=true in cmake to suppress this warning.
   
Call Stack (most recent call first):
  CMakeLists.txt:139 (gz_configure_build)


In file included from /home/ryan/Dev/ros2_ws/src/gz-common/geospatial/src/ImageHeightmap.cc:18:
/home/ryan/Dev/ros2_ws/src/gz-common/geospatial/include/gz/common/geospatial/ImageHeightmap.hh:27:10: fatal error: gz/common/Image.hh: No such file or directory
   27 | #include <gz/common/Image.hh>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [geospatial/src/CMakeFiles/gz-common5-geospatial.dir/build.make:90: geospatial/src/CMakeFiles/gz-common5-geospatial.dir/ImageHeightmap.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:3003: geospatial/src/CMakeFiles/gz-common5-geospatial.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:166: all] Error 2
---
Failed   <<< gz-common5 [9.83s, exited with code 2]
Aborted  <<< gz-msgs10 [45.2s]                                                                                    
Aborted  <<< sdformat14 [48.5s]                                        

Summary: 3 packages finished [1min 21s]
  1 package failed: gz-common5
  2 packages aborted: gz-msgs10 sdformat14
  2 packages had stderr output: gz-common5 gz-math7
  8 packages not processed

@mjcarroll
Copy link
Contributor

I ran into this today on harmonic. I do not have libfreeimage-dev installed. I have gz-sim installed on my OS from binaries, but it's crashing and I wanted a source build in debug to run under GDB.

So, I think the issue is that freeimage is a required dependency of an optional component graphics. The graphics component is a required dependency of the geospatial component. Perhaps we don't have a way to express this with gz-cmake, but I would expect that the geospatial component should also not build in this case.

This may cause impacts down the line for users who depend on that, so it may make sense to make the configuration warnings a little "louder" in the output logs.

@mjcarroll
Copy link
Contributor

@Ryanf55 See if this helps: #573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants