open-rmf / rmf

Root repository for the RMF software
Apache License 2.0
225 stars 58 forks source link

Failed to build from source #101

Closed ericluwj closed 2 years ago

ericluwj commented 2 years ago

Bug report

Required information:

Description of the bug

--- stderr: rmf_robot_sim_gazebo_plugins                                 
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libsdformat9.so.9.5.0', needed by 'libreadonly.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libsdformat9.so.9.5.0', needed by 'libslotcar.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libsdformat9.so.9.5.0', needed by 'libteleport_ingestor.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libsdformat9.so.9.5.0', needed by 'libteleport_dispenser.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
In file included from /home/ericluwj/rmf_ws/src/rmf/rmf_simulation/rmf_robot_sim_gazebo_plugins/src/readonly.cpp:18:
/usr/include/gazebo-11/gazebo/common/Plugin.hh:33:10: fatal error: sdf/sdf.hh: No such file or directory
   33 | #include <sdf/sdf.hh>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/readonly.dir/build.make:63: CMakeFiles/readonly.dir/src/readonly.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/readonly.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/ericluwj/rmf_ws/src/rmf/rmf_simulation/rmf_robot_sim_gazebo_plugins/src/TeleportDispenser.cpp:20:
/usr/include/gazebo-11/gazebo/common/Plugin.hh:33:10: fatal error: sdf/sdf.hh: No such file or directory
   33 | #include <sdf/sdf.hh>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/teleport_dispenser.dir/build.make:63: CMakeFiles/teleport_dispenser.dir/src/TeleportDispenser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/teleport_dispenser.dir/all] Error 2
In file included from /home/ericluwj/rmf_ws/src/rmf/rmf_simulation/rmf_robot_sim_gazebo_plugins/src/TeleportIngestor.cpp:21:
/usr/include/gazebo-11/gazebo/common/Plugin.hh:33:10: fatal error: sdf/sdf.hh: No such file or directory
   33 | #include <sdf/sdf.hh>
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from /home/ericluwj/rmf_ws/src/rmf/rmf_simulation/rmf_robot_sim_gazebo_plugins/src/slotcar.cpp:1:
/usr/include/gazebo-11/gazebo/physics/World.hh:29:10: fatal error: sdf/sdf.hh: No such file or directory
   29 | #include <sdf/sdf.hh>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/teleport_ingestor.dir/build.make:63: CMakeFiles/teleport_ingestor.dir/src/TeleportIngestor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:138: CMakeFiles/teleport_ingestor.dir/all] Error 2
make[2]: *** [CMakeFiles/slotcar.dir/build.make:63: CMakeFiles/slotcar.dir/src/slotcar.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/slotcar.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< rmf_robot_sim_gazebo_plugins [1.47s, exited with code 2]
marcoag commented 2 years ago

From the error it seems that it's not able to find the sdf/sdf.hh file that is provided by the libsdformat9-dev package. This package is a dependency of RMF and should be installed if you followed the instructions step by step. If the package is installed and the problem persists then something might be wrong in your specific setup preventing the compilation from finding the correct files.

Following the instructions in https://github.com/open-rmf/rmf you should have executed the rosdep dependencies installation step:

cd ~/rmf_ws
rosdep install --from-paths src --ignore-src --rosdistro foxy -yr

This step installs the dependency packages for the compilation of RMF, specifically for the one involved in your case: the package rmf_robot_sim_gazebo_plugins would install ros-foxy-gazebo-dev that will install its dependency libgazebo11-dev that will install its dependency libsdformat9-dev, the package that contains the missing files.

I will proceed to close the issue since I tested on a clean installation of focal with foxy following the instructions. libsdformat9-dev installs correctly and the compilation of the RMF throws no errors.