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
56 stars 51 forks source link

Failed to load plugin [ignition-rendering3-ogre2] #90

Open agayev169 opened 4 years ago

agayev169 commented 4 years ago

I am trying to build ign-rendering from the source. Although, building and installing are done successfully (I use Ogre and Ogre 2, without Optix), when I run ign-gazebo I get the following errors:

[Err] [RenderEngineManager.cc:394] Failed to load plugin [ignition-rendering3-ogre2] : couldn't load library on path [/usr/local/lib/libignition-rendering3-ogre2.so].
[Err] [RenderUtil.cc:1024] Engine [ogre2] is not supported

I have already checked the file, it is a symlink to a file which is a symlink to the another ".so" file. ldd of all of three files shows that there is no problem with the links (at least I cannot see it). Any ideas why it happens?

iche033 commented 4 years ago

can you see if you can build and run any one of ign-rendering the examples?

do you have other versions of ign-rendering installed in the system?

agayev169 commented 4 years ago

can you see if you can build and run any one of ign-rendering the examples?

Yes, I tried several examples and they execute successfully.

do you have other versions of ign-rendering installed in the system?

No, only ign-rendering3 built from source.

agayev169 commented 4 years ago

I tried to recode everything and in the end, found what caused the error. After I removed the folowing line everything works as expected:

#include <ignition/plugin/Register.hh>
iche033 commented 4 years ago

did you remove that from the ign-rendering side or ign-gazebo?

agayev169 commented 4 years ago

I have a plugin for the camera sensor. I removed the line from the code of the plugin.

iche033 commented 4 years ago

ok I see. To confirm, no changes are required here in ign-rendering right? Can we close this issue?

agayev169 commented 4 years ago

I am not sure. I do not have enough time to look at the source code of several packages, but it seems that ign-rendering (at least ign-rednering3-ogre2) and ign-plugin are not compatible with each other. So, that may mean that there are issues either in ign-rendering or ign-plugin or in both.

acxz commented 3 years ago

I'm also facing this issue (I believe it is the same) when trying to run the package on Arch Linux. It is important to note that I have built ign-rendering with ogre and not ogre2.

Sys info: OS: Arch Linux GCC: 10.2.0 Qt: 5.15.2 ruby: 2.7.2 protobuf: 3.12.4

Trying the simple_demo from the examples I get the following error:

acxz@archard ..n-rendering/examples/simple_demo/build (git)-[ign-rendering4] % ./simple_demo 
[Msg] Loading plugin [ignition-rendering-ogre]
[Err] [RenderEngineManager.cc:461] Failed to load plugin [ignition-rendering-ogre] : couldn't find shared library.
Engine 'ogre' is not supported
[Msg] Loading plugin [optix]
[Err] [RenderEngineManager.cc:461] Failed to load plugin [optix] : couldn't find shared library.
Engine 'optix' is not supported
[Err] [GlutWindow.cc:178] No cameras found. Scene will not be rendered

Build log for simple_demo, which specifically mentions that ignition-rendering4-ogre is found:

-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for ignition-rendering4 -- found version 4.1.0
-- Searching for dependencies of ignition-rendering4
-- Looking for ignition-math6 -- found version 6.7.0
-- Searching for dependencies of ignition-math6
-- Looking for ignition-common3 -- found version 3.9.0
-- Searching for dependencies of ignition-common3
-- Looking for dlfcn.h - found
-- Looking for libdl - found
-- Found DL: TRUE  
-- Checking for module 'uuid'
--   Found uuid, version 2.36.1
-- Found UUID: TRUE  
-- Searching for <ignition-common3> component [graphics]
-- Looking for ignition-common3-graphics -- found version 3.9.0
-- Searching for dependencies of ignition-common3-graphics
-- Looking for ignition-math6 -- found version 6.7.0
-- Searching for <ignition-common3> component [events]
-- Looking for ignition-common3-events -- found version 3.9.0
-- Searching for dependencies of ignition-common3-events
-- Looking for ignition-math6 -- found version 6.7.0
-- Looking for ignition-plugin1 -- found version 1.1.0
-- Searching for dependencies of ignition-plugin1
-- Searching for <ignition-plugin1> component [all]
-- Looking for all libraries of ignition-plugin1 -- found version 1.1.0
-- Looking for ignition-plugin1 -- found version 1.1.0
-- Looking for ignition-plugin1-loader -- found version 1.1.0
-- Searching for dependencies of ignition-plugin1-loader
-- Looking for ignition-plugin1-register -- found version 1.1.0
-- Searching for dependencies of ignition-plugin1-register
-- Found GLUT: /usr/lib/libglut.so  
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindOpenGL.cmake:293 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found GLEW: /usr/include (found version "2.2.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/acxz/vcs/git/github/acxz/ign-rendering/examples/simple_demo/build

EDIT: I can't seem to reproduce this issue now, hmmm.... Well I'll worry about it when I start encontering the issue again.