Issue in building RMF in RHEL 8 (#154)

Posted by @cwrx777:

Hi,
is building and running RMF (galactic) in RHEL 8 currently supported?

I tried the main and rel 21.09 branch and encountered issues such as below

$ rosdep install --from-paths src --ignore-src --rosdistro galactic -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rmf_building_sim_ignition_plugins: No definition of [ignition-fortress] for OS [rhel]
ros_ign_bridge: No definition of [ignition-transport11] for OS [rhel]
rmf_demos_ign: No definition of [ignition-gazebo5-plugins] for OS [rhel]
ros_ign_gazebo_demos: No definition of [ignition-gazebo6] for OS [rhel]
rmf_demos_panel: No definition of [python3-websockets] for OS [rhel]
rmf_robot_sim_ignition_plugins: No definition of [ignition-fortress] for OS [rhel]
ros_ign_gazebo: No definition of [ignition-gazebo6] for OS [rhel]
rmf_demos_bridges: No definition of [python3-flask-socketio] for OS [rhel]
ros_ign_image: No definition of [ignition-transport11] for OS [rhel]
```bash

```bash
Starting >>> rmf_traffic_ros2
--- stderr: rmf_traffic_ros2                            
CMake Error at CMakeLists.txt:24 (find_package):
  By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "nlohmann_json", but CMake did not find one.

  Could not find a package configuration file provided by "nlohmann_json"
  with any of the following names:

    nlohmann_jsonConfig.cmake
    nlohmann_json-config.cmake

  Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
  "nlohmann_json_DIR" to a directory containing one of the above files.  If
  "nlohmann_json" provides a separate development package or SDK, be sure it
  has been installed.


---
Failed   <<< rmf_traffic_ros2 [0.79s, exited with code 1]
```bash

```bash
Starting >>> rmf_battery
--- stderr: rmf_battery                             
/home/medisys/ws_rmf_main/install/rmf_traffic/lib64/librmf_traffic.so: undefined reference to `pthread_rwlock_unlock'
/home/medisys/ws_rmf_main/install/rmf_traffic/lib64/librmf_traffic.so: undefined reference to `pthread_rwlock_trywrlock'
/home/medisys/ws_rmf_main/install/rmf_traffic/lib64/librmf_traffic.so: undefined reference to `pthread_rwlock_tryrdlock'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/test_rmf_battery.dir/build.make:164: test_rmf_battery] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/test_rmf_battery.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rmf_battery [0.39s, exited with code 2]
```bash

Posted by @marcoag:

Hi,

Currently Open-RMF in RHEL is only supported for deployment so all the simulation packages won’t work due to missing dependencies. You can try removing those simulation packages from your workspace if you still wanna compile the rest.

With respect to the nlohmann_json issue, it should be solved through rosdep, the dependency is there in the package: rmf_ros2/rmf_traffic_ros2/package.xml at 1b8939d8e2b5a5d25da6772eb0ebe233ac032340 · open-rmf/rmf_ros2 · GitHub
and the rosdep key is also available for RHEL: rosdistro/rosdep/base.yaml at 758f24e2bfc27f3ccb1ebaf5b273534596f18024 · ros/rosdistro · GitHub. I believe the rosdep key was added recently so make sure you run rosdep update. If you have problems maybe try with the latest version of the packages.