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

Debug ignition-rendering 6 test running #21

Closed
traversaro opened this issue Oct 6, 2021 · 8 comments
Closed

Debug ignition-rendering 6 test running #21

traversaro opened this issue Oct 6, 2021 · 8 comments

Comments

@traversaro
Copy link
Contributor

To debug the problems in #19, I am compiling ign-rendering on its own. I will use this issue to mark down some notes.

@traversaro
Copy link
Contributor Author

mamba install cmake compilers make pkg-config xorg-libx11 xorg-libxext libignition-math6 libignition-common4 libignition-plugin1 libignition-utils1 ogre=1.10

@traversaro
Copy link
Contributor Author

traversaro commented Oct 6, 2021

Indeed, I am able to reproduce the problem, after installing the dependency listed before and configuring the project (latest ign-rendering6 commit, i.e. gazebosim/gz-rendering@f93c796 ) as:

cmake -DCMAKE_BUILD_TYPE=Release -DSKIP_ogre2:BOOL=ON -DSKIP_optix:BOOL=ON -DCMAKE_INSTALL_PREFIX=./install -DBUILD_TESTING:BOOL=ON ..

The project fails as:

[ 76%] Building CXX object ogre/src/CMakeFiles/ignition-rendering6-ogre.dir/OgreCOMVisual.cc.o
cd /Users/traversaro/src/ign-rendering/build/ogre/src && /Users/traversaro/mambaforge/envs/ignrendering/bin/x86_64-apple-darwin13.4.0-clang++ -DMAC_OS_X_VERSION=1080 -DOGRE_VERSION_LT_1_12_0 -Dignition_rendering6_ogre_EXPORTS -I/usr/local/include -I/Users/traversaro/src/ign-rendering/include -I/Users/traversaro/src/ign-rendering/build/include -I/Users/traversaro/src/ign-rendering/ogre/include -I/Users/traversaro/src/ign-rendering/build/ogre/include -I/Users/traversaro/src/ign-rendering/build/core/include -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/ignition/common4 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/ignition/math6 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/ignition/utils1 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/ignition/plugin1 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/ignition/cmake2 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/OGRE -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/OGRE/OSX -isystem /Users/traversaro/mambaforge/envs/ignrendering/include/OGRE/RenderSystems/GL -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Users/traversaro/mambaforge/envs/ignrendering/include -stdlib=libc++ -O3 -DNDEBUG  -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIC -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -fPIC -std=c++17 -MD -MT ogre/src/CMakeFiles/ignition-rendering6-ogre.dir/OgreCOMVisual.cc.o -MF CMakeFiles/ignition-rendering6-ogre.dir/OgreCOMVisual.cc.o.d -o CMakeFiles/ignition-rendering6-ogre.dir/OgreCOMVisual.cc.o -c /Users/traversaro/src/ign-rendering/ogre/src/OgreCOMVisual.cc
In file included from /Users/traversaro/src/ign-rendering/ogre/src/OgreCOMVisual.cc:18:
In file included from /Users/traversaro/src/ign-rendering/ogre/include/ignition/rendering/ogre/OgreCOMVisual.hh:24:
In file included from /Users/traversaro/src/ign-rendering/ogre/include/ignition/rendering/ogre/OgreIncludes.hh:68:
/Users/traversaro/mambaforge/envs/ignrendering/include/OGRE/Terrain/OgreTerrainPaging.h:33:10: fatal error: 'OgrePagedWorldSection.h' file not found
#include "OgrePagedWorldSection.h"

@traversaro
Copy link
Contributor Author

Ok, I was able to understand the root behind the fatal error: 'OgrePagedWorldSection.h' file not found. The problem is that at the moment the CMake code is calling ign_find_package(IgnOGRE VERSION 1.10 QUIET), and after that ign_find_package(IgnOGRE VERSION 1.10 COMPONENTS ${ign_ogre_components} REQUIRED_BY ogre PRIVATE_FOR ogre). The problem is that the IgnOgre::IgnOgre target created by the first call (that does not has any component properly set in its IMPORTED_LINK_INTERFACE_LIBRARIES property) is not changed at all by the second ign_find_package call, as ign_import_target silently does nothing if a target with the same name already exists (see https://github.com/ignitionrobotics/ign-cmake/blob/ignition-cmake2_2.9.0/cmake/IgnImportTarget.cmake#L67). I guess we need to report this upstream.

@traversaro
Copy link
Contributor Author

After fixing the compilation, I was able to reproduce the test segfaulting. Interesting, the test are only segfaulting if run after make install. If they are run before make install, all the test are passing successfully, except for:

	 59 - UNIT_RenderingIface_TEST (SEGFAULT)

@traversaro
Copy link
Contributor Author

Actually it seems that the tests that are passing before the install are not actually passing:

1: Test command: /Users/traversaro/src/ign-rendering/build/bin/UNIT_ArrowVisual_TEST "--gtest_output=xml:/Users/traversaro/src/ign-rendering/build/test_results/UNIT_ArrowVisual_TEST.xml"
1: Test timeout computed to be: 240
1: [==========] Running 2 tests from 1 test case.
1: [----------] Global test environment set-up.
1: [----------] 2 tests from ArrowVisual/ArrowVisualTest
1: [ RUN      ] ArrowVisual/ArrowVisualTest.ArrowVisual/ogre
1: [Err] [RenderEngineManager.cc:461] Failed to load plugin [ignition-rendering-ogre] : couldn't find shared library.
1: [       OK ] ArrowVisual/ArrowVisualTest.ArrowVisual/ogre (1 ms)
1: [ RUN      ] ArrowVisual/ArrowVisualTest.ArrowVisual/optix
1: [Err] [RenderEngineManager.cc:461] Failed to load plugin [optix] : couldn't find shared library.
1: [       OK ] ArrowVisual/ArrowVisualTest.ArrowVisual/optix (0 ms)
1: [----------] 2 tests from ArrowVisual/ArrowVisualTest (1 ms total)
1: 
1: [----------] Global test environment tear-down
1: [==========] 2 tests from 1 test case ran. (1 ms total)
1: [  PASSED  ] 2 tests.
1/2 Test #1: UNIT_ArrowVisual_TEST ............   Passed    0.02 sec

@traversaro
Copy link
Contributor Author

The problem seems to be that ign-rendering expects the ogre plugin to start with "lib", but apparantly they are not:

test 1
    Start 1: UNIT_ArrowVisual_TEST

1: Test command: /Users/traversaro/src/ign-rendering/build/bin/UNIT_ArrowVisual_TEST "--gtest_output=xml:/Users/traversaro/src/ign-rendering/build/test_results/UNIT_ArrowVisual_TEST.xml"
1: Test timeout computed to be: 240
1: [==========] Running 2 tests from 1 test case.
1: [----------] Global test environment set-up.
1: [----------] 2 tests from ArrowVisual/ArrowVisualTest
1: [ RUN      ] ArrowVisual/ArrowVisualTest.ArrowVisual/ogre
1: [Err] [OgreRenderEngine.cc:465] Unable to load Ogre Plugin[/Users/traversaro/mambaforge/envs/ignrendering/lib/OGRE/libRenderSystem_GL]. Rendering will not be possible.Make sure you have installed OGRE properly.
1: [Err] [OgreRenderEngine.cc:508] unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled.
1/2 Test #1: UNIT_ArrowVisual_TEST ............***Exception: SegFault  0.05 sec

(ignrendering) Silvios-iMac:build traversaro$ ls /Users/traversaro/mambaforge/envs/ignrendering/lib/OGRE/
Plugin_BSPSceneManager.1.10.12.dylib	Plugin_EXRCodec.dylib			Plugin_OctreeZone.1.10.12.dylib		Plugin_PCZSceneManager.dylib		RenderSystem_GL.1.10.12.dylib		RenderSystem_GL3Plus.dylib
Plugin_BSPSceneManager.dylib		Plugin_OctreeSceneManager.1.10.12.dylib	Plugin_OctreeZone.dylib			Plugin_ParticleFX.1.10.12.dylib		RenderSystem_GL.dylib
Plugin_EXRCodec.1.10.12.dylib		Plugin_OctreeSceneManager.dylib		Plugin_PCZSceneManager.1.10.12.dylib	Plugin_ParticleFX.dylib			RenderSystem_GL3Plus.1.10.12.dylib

@traversaro
Copy link
Contributor Author

The problem seems to be that ign-rendering expects the ogre plugin to start with "lib", but apparantly they are not:

test 1
    Start 1: UNIT_ArrowVisual_TEST

1: Test command: /Users/traversaro/src/ign-rendering/build/bin/UNIT_ArrowVisual_TEST "--gtest_output=xml:/Users/traversaro/src/ign-rendering/build/test_results/UNIT_ArrowVisual_TEST.xml"
1: Test timeout computed to be: 240
1: [==========] Running 2 tests from 1 test case.
1: [----------] Global test environment set-up.
1: [----------] 2 tests from ArrowVisual/ArrowVisualTest
1: [ RUN      ] ArrowVisual/ArrowVisualTest.ArrowVisual/ogre
1: [Err] [OgreRenderEngine.cc:465] Unable to load Ogre Plugin[/Users/traversaro/mambaforge/envs/ignrendering/lib/OGRE/libRenderSystem_GL]. Rendering will not be possible.Make sure you have installed OGRE properly.
1: [Err] [OgreRenderEngine.cc:508] unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled.
1/2 Test #1: UNIT_ArrowVisual_TEST ............***Exception: SegFault  0.05 sec

(ignrendering) Silvios-iMac:build traversaro$ ls /Users/traversaro/mambaforge/envs/ignrendering/lib/OGRE/
Plugin_BSPSceneManager.1.10.12.dylib	Plugin_EXRCodec.dylib			Plugin_OctreeZone.1.10.12.dylib		Plugin_PCZSceneManager.dylib		RenderSystem_GL.1.10.12.dylib		RenderSystem_GL3Plus.dylib
Plugin_BSPSceneManager.dylib		Plugin_OctreeSceneManager.1.10.12.dylib	Plugin_OctreeZone.dylib			Plugin_ParticleFX.1.10.12.dylib		RenderSystem_GL.dylib
Plugin_EXRCodec.1.10.12.dylib		Plugin_OctreeSceneManager.dylib		Plugin_PCZSceneManager.1.10.12.dylib	Plugin_ParticleFX.dylib			RenderSystem_GL3Plus.1.10.12.dylib

This was a problem in ignition-rendering indeed, that was fixed long ago in Gazebo Classic: gazebosim/gz-rendering#454 .

@traversaro
Copy link
Contributor Author

simple_demo example is now running fine on macOS, see #19 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant