ros2 / rmw_iceoryx

rmw implementation for iceoryx
Apache License 2.0
153 stars 27 forks source link

CMake Error in Installation Instructions `iceoryx not found` #61

Closed ijnek closed 2 years ago

ijnek commented 3 years ago

Following Installation, there are CMake issues when running colcon build.

I am using ROS2 Galactic. Is this an issue that has already been identified or could it be something on my end?

Running with colcon build --parallel-workers 1 for easy viewing,

Starting >>> rmw_iceoryx_cpp
--- stderr: rmw_iceoryx_cpp                                
CMake Warning at CMakeLists.txt:31 (message):
  iceoryx not found - skipping 'rmw_iceoryx_cpp'

---
Finished <<< rmw_iceoryx_cpp [2.38s]
Starting >>> iceoryx_binding_c
Finished <<< iceoryx_binding_c [8.38s]                           
Starting >>> iceoryx_ros2_bridge
--- stderr: iceoryx_ros2_bridge                               
CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findiceoryx_hoofs.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "iceoryx_hoofs", but CMake did not find one.

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

    iceoryx_hoofsConfig.cmake
    iceoryx_hoofs-config.cmake

  Add the installation prefix of "iceoryx_hoofs" to CMAKE_PREFIX_PATH or set
  "iceoryx_hoofs_DIR" to a directory containing one of the above files.  If
  "iceoryx_hoofs" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /home/ijnek/iceoryx_ws/install/iceoryx_posh/lib/cmake/iceoryx_posh/iceoryx_poshConfig.cmake:46 (find_dependency)
  CMakeLists.txt:21 (find_package)

---
Failed   <<< iceoryx_ros2_bridge [1.92s, exited with code 1]

Summary: 4 packages finished [1min 18s]
  1 package failed: iceoryx_ros2_bridge
  3 packages had stderr output: iceoryx_posh iceoryx_ros2_bridge rmw_iceoryx_cpp
mossmaurice commented 3 years ago

Hi @ijnek thanks for reporting this issue!

I just tried these steps from scratch and everything was building fine:

# Created ADE ros2_galactic environment based on public image: https://gitlab.apex.ai/apex.ai-public/ros2-ade
mkdir -p ~/ade-home/ros2_galactic
cd ~/ade-home/ros2_galactic
wget https://gitlab.apex.ai/apex.ai-public/ros2-ade/-/raw/master/.aderc-galactic
ade --rc .aderc-galactic start --update --enter

# Build steps inside ADE/Docker
source /opt/ros/galactic/setup.bash
cd ~/ros2_galactic
mkdir src
wget https://raw.githubusercontent.com/ros2/ros2/galactic/ros2.repos
vcs import src < ros2.repos
cd ~/ros2_galactic/src/
git clone https://github.com/ros2/rmw_iceoryx.git
cd ~/ros2_galactic
colcon build --symlink-install --merge-install

Can you copy and paste your steps how you tried to build rmw_iceoryx? Thanks!


Update

ijnek commented 3 years ago

Hi @mossmaurice , thanks for your response and trying things out!

Looking at your script, I would assume you meant ros2/galactic/ros2.repos instead of

wget https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos

(ps. This was an issue in the ros2_documentation which has been fixed up in a PR)

Even with the change however, the script you provided built fine.

Now, my guess is that this repository relies on new features from the ros2 packages, such that the docker image I have provided below(which is from about 3months ago) is outdated, and I must build ros2 galactic from source.

Here is a script that reproduces the issue I had:

docker pull osrf/ros:galactic-desktop
docker run -it osrf/ros:galactic-desktop

# In docker container
mkdir -p ~/iceoryx_ws/src
cd $_
git clone https://github.com/eclipse/iceoryx.git
git clone https://github.com/ros2/rmw_iceoryx.git
cd ~/iceoryx_ws/

apt-get update
rosdep update
rosdep install --from-paths src --ignore-src -r -y  # This installs ros-galactic-test-msgs

source /opt/ros/galactic/setup.bash
colcon build

I am happy for this issue to be closed if you agree with what I said above. It may be nice to point out this in the Installation instructions, unless this is just common sense :thinking:

I appreciate your help, and I'll be looking forward to trying out iceoryx!


Update

I have updated and rebuilt ROS2 Galactic from source on my computer and I still face the same issues.

ijnek commented 3 years ago

Ah, ok. I've figured out why things are happening. My guesses in the last comment aren't correct.

The difference between your script and mine, is whether https://github.com/eclipse/iceoryx.git is built from source or not. There are breaking changes in that repository which are preventing building.

It may be better to change

git clone https://github.com/eclipse/iceoryx.git

to

git clone --branch v1.0.1 git@github.com:eclipse-iceoryx/iceoryx.git

from the Installation instructions, or to fix this repository to match the breaking api changes in iceoryx master.

mossmaurice commented 3 years ago

@ijnek Thanks for your answer! That makes sense. So far only the release_1.0 is used in the ROS 2. I agree with you that for master aka rolling we should build against iceoryx master. Let's use this issue and the pull request #63 to implement this in the CI.

berndpfrommer commented 2 years ago

Just FYI: I'm also hitting this issue on galactic as of today 10/14/2021.

mossmaurice commented 2 years ago

@berndpfrommer Galactic should work fine out of the box. Could you please try to reproduce the steps above and post your steps how you bumped into the error? Thanks!

berndpfrommer commented 2 years ago

I simply followed the instructions here one-by-one: https://github.com/ros2/rmw_iceoryx#installation

I am working off the regular ROS2 galactic packages installed with apt on Ubuntu 20.04.

The work-around by @ijnek succeed:

git clone --branch v1.0.1 git@github.com:eclipse-iceoryx/iceoryx.git
ijnek commented 2 years ago

I'd expect the error to exist with galactic too if following the instructions in the repo @berndpfrommer linked to, since they instruct you to build the iceoryx master branch. The issue altogether should be fixed once #63 is merged.

mossmaurice commented 2 years ago

@berndpfrommer @ijnek Ok, thanks, got it. I created this PR to fix the docs for galactic.