gazebosim / gz-rendering

C++ library designed to provide an abstraction for different rendering engines. It offers unified APIs for creating 3D graphics applications.
https://gazebosim.org
Apache License 2.0
50 stars 48 forks source link

rendering3-3.5.0 fails to build with ogre/1.10.12 #374

Open mboisson opened 2 years ago

mboisson commented 2 years ago

Environment

Description

I was trying to build ignition-citadel using ogre/1.10.12, since it appears that it has issues with ogre/1.12.12 (https://github.com/osrf/gazebo/issues/2700). However, I hit the following compilation error:

22031 /tmp/mboisson/avx2/ignition/citadel/GCC-9.3.0/ign-rendering-ignition-rendering3_3.5.0/ogre/src/OgreMaterialSwitcher.cc: In member function virtual Ogre::Technique* ignition::rendering::v3::OgreMaterialSwitcher::handleSchemeNotFound(uint16_t, const String&, Ogre::Material*, uint16_t, const Ogre::Renderable*):
22032 /tmp/mboisson/avx2/ignition/citadel/GCC-9.3.0/ign-rendering-ignition-rendering3_3.5.0/ogre/src/OgreMaterialSwitcher.cc:86:53: error: no matching function for call to static_pointer_cast<Ogre::Material>(Ogre::ResourcePtr&)
22033    86 |         std::static_pointer_cast<Ogre::Material>(res);
22034       |

Is there a missing version requirement for ogre for rendering3-3.5.0 ?

The same recipe builds fine against ogre/1.12.12.

chapulina commented 2 years ago

We're explicitly depending on 1.8.0:

https://github.com/ignitionrobotics/ign-rendering/blob/9341eb24f37a5c2b1ceb5c2dc07ab8473a2a0f9a/CMakeLists.txt#L64

mboisson commented 2 years ago

Mmm, shouldn't it abort at configuration time if a different version is found then ?

chapulina commented 2 years ago

Yup, I'm surprised it didn't. There must be something weird going on in FindIgnOGRE

traversaro commented 2 years ago

I may be wrong, but I guess that 1.8.0 means >= 1.8.0 and < 2.0, see https://github.com/ignitionrobotics/ign-cmake/blob/ign-cmake2/cmake/FindIgnOGRE.cmake#L94 . In fact, I don't think there is any environment in which ignition-rendering is built with Ogre 1.8.0. As far as I know, on apt-based distributions and Homebrew Ogre 1.9 is used (see https://repology.org/project/ogre/versions), while in conda-forge at the moment we are building ignition-rendering (even if a newer version) with both Ogre 1.10 and 1.12, see https://github.com/conda-forge/libignition-rendering4-feedstock/pull/8 .

I noticed that in conda-forge we have a local patch (https://github.com/conda-forge/libignition-rendering4-feedstock/blob/master/recipe/ogre-version.patch) to correctly compile with Ogre 1.10, that I think is inspired by a comment by @diegoferigo in https://github.com/robotology/gym-ignition/issues/279#issuecomment-776264280 . Probably we just need to get that patch upstream to solve this issue, sorry for not submitting it before!

traversaro commented 2 years ago

I noticed that in conda-forge we have a local patch (https://github.com/conda-forge/libignition-rendering4-feedstock/blob/master/recipe/ogre-version.patch) to correctly compile with Ogre 1.10, that I think is inspired by a comment by @diegoferigo in robotology/gym-ignition#279 (comment) . Probably we just need to get that patch upstream to solve this issue, sorry for not submitting it before!

PR submitted in https://github.com/ignitionrobotics/ign-rendering/issues/374 .