Error building gazebo with OpenSim


#1

Hi everyone, I’m following the tutorial to install the platform from source and I got stuck in the gazebo compilation step, in particular for a problem connected with OpenSim. Here are the error messages I receive from the terminal:

[2%] Built target gazebo_opende_ou
[4%] Built target gazebo_opcode
[4%] Built target gazebo_gimpact
[12%] Built target gazebo_ode
[16%] Built target gazebo_common
[16%] Built target gazebomsgs_out
[41%] Built target gazebo_msgs
[43%] Built target gazebo_transport
[43%] Built target gazebo_util
[52%] Built target gazebo_rendering
[52%] Building CXX object gazebo / physics / CMakeFiles / gazebo_physics.dir / opensim / OpensimBallJoint.cc.o
In file included from /home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimPhysicsPrivate.hh:37,
                 from /home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimBallJoint.cc:33:
/home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimContactForceManager.hh:43:30: error: 'GeneralContactForceFeedback' in namespace 'SimTK' does not name a type
   43 | using ContactData = SimTK :: GeneralContactForceFeedback :: ContactData;
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimContactForceManager.hh:65:3: error: 'ContactData' does not name a type; did you mean 'ContactPtr'?
   65 | ContactData :: const_iterator BeginContactData () const {return contact_data.begin (); }
      | ^ ~~~~~~~~~~
      | ContactPtr
/home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimContactForceManager.hh:66:3: error: 'ContactData' does not name a type; did you mean 'ContactPtr'?
   66 | ContactData :: const_iterator EndContactData () const {return contact_data.end (); }
      | ^ ~~~~~~~~~~
      | ContactPtr
/home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimContactForceManager.hh:88:30: error: 'ContactData' has not been declared
   88 | void InsertContactDataIn (ContactData & contact_data);
      | ^ ~~~~~~~~~~
/home/gabriele/Documenti/NRP/gazebo/gazebo/physics/opensim/OpensimContactForceManager.hh:93:3: error: 'ContactData' does not name a type; did you mean 'ContactPtr'?
   93 | ContactData contact_data;
      | ^ ~~~~~~~~~~
      | ContactPtr
gazebo / physics / CMakeFiles / gazebo_physics.dir / build.make: 1454: recipe for target 'gazebo / physics / CMakeFiles / gazebo_physics.dir / opensim / OpensimBallJoint.cc.o' failed
make [2]: *** [gazebo / physics / CMakeFiles / gazebo_physics.dir / opensim / OpensimBallJoint.cc.o] Error 1
CMakeFiles / Makefile2: 10067: recipe for target 'gazebo / physics / CMakeFiles / gazebo_physics.dir / all' failed
make [1]: *** [gazebo / physics / CMakeFiles / gazebo_physics.dir / all] Error 2
Makefile: 162: recipe for target 'all' failed
make: *** [all] Error 2

Besides the fact that in the NRP / gazebo / build folder I didn’t find any makefiles initially. I then moved to NRP / gazebo and from there I gave the commands outside the script “./update_nrp build all”.

I had a previous installation of ros-melodic, but I deleted everything before starting for the NRP.
I have already tried make -i to ignore some OpenSim errors and change gcc version to the latest one.

For completeness, I also report the first error message I get while running the script ./update_nrp build all:

CMake Warning at cmake/GazeboTestUtils.cmake:42 (add_executable):
  Cannot generate a safe runtime search path for target
  REGRESSION_2505_revolute_joint_SetAxis because files in some directories
  may conflict with libraries in implicit directories:

    runtime library [libSimTKsimbody.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKmath.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKcommon.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libsdformat.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  test/regression/CMakeLists.txt:47 (gz_build_tests)


CMake Warning at cmake/GazeboTestUtils.cmake:42 (add_executable):
  Cannot generate a safe runtime search path for target
  REGRESSION_1569_hydra_crash because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libSimTKsimbody.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKmath.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKcommon.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libsdformat.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  test/regression/CMakeLists.txt:47 (gz_build_tests)


CMake Warning at cmake/GazeboTestUtils.cmake:42 (add_executable):
  Cannot generate a safe runtime search path for target
  REGRESSION_846_typo_in_camera because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libSimTKsimbody.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKmath.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKcommon.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libsdformat.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  cmake/GazeboTestUtils.cmake:164 (gz_build_tests)
  test/regression/CMakeLists.txt:60 (gz_build_dri_tests)


CMake Warning at cmake/GazeboTestUtils.cmake:42 (add_executable):
  Cannot generate a safe runtime search path for target
  REGRESSION_1702_remove_model_scene_nodes because files in some directories
  may conflict with libraries in implicit directories:

    runtime library [libSimTKsimbody.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKmath.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKcommon.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libsdformat.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  cmake/GazeboTestUtils.cmake:164 (gz_build_tests)
  test/regression/CMakeLists.txt:60 (gz_build_dri_tests)


CMake Warning at cmake/GazeboTestUtils.cmake:42 (add_executable):
  Cannot generate a safe runtime search path for target
  REGRESSION_1375_world_reset because files in some directories may conflict
  with libraries in implicit directories:

    runtime library [libSimTKsimbody.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKmath.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libSimTKcommon.so.3.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib
    runtime library [libsdformat.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/gabriele/.local/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  test/regression/CMakeLists.txt:47 (gz_build_tests)


-- Generating done
-- Build files have been written to: /home/gabriele/Documenti/NRP/gazebo
make: *** Nessun obiettivo specificato e nessun makefile trovato.  Arresto.
gazebo
+-------------------------- gazebo build FAILED -------------------------------------+
| If you are upgrading from Ubuntu 16 to 18, try removing the gazebo/build folder      |
| and relaunch this script.                                                            |
+-------------------------------------------------------------------------------------+

I have cut many lines of similar messages.
How can I do?


#2

Dear Gsisinna,

Are you sure the simbody and opensim buzilds, which should happen before gazebo, ran without errors? Check if ~/.local/lib/libSimTKsimbody*.so.* and libosim*.so* exist. They seem to, since they are mentioned in you last error messages. They seem though to compete with a previous installation. Be sure to purge opensim and simtk from your system.

Best regards
Axel