'Could NOT find FastRTPS' while cross-compiling Eloquent

asked 2020-04-14 08:11:38 -0600

broomstick gravatar image

updated 2020-04-14 08:16:03 -0600

I am cross-compiling ROS2 Eloquent for a FreeBSD-based research system. My cmake toolchain file is here.

When building rosidl_typesupport_fastrtps_cpp (and also rmw_fastrtps), I get the following error:

--- stderr: rosidl_typesupport_fastrtps_cpp                                                                                                        
CMake Error at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /home/broomstick/cheri/ros2_eloquent_min/install/fastrtps_cmake_module/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:106 (find_package_handle_standard_args)
  CMakeLists.txt:27 (find_package)
---
Failed   <<< rosidl_typesupport_fastrtps_cpp    [ Exited with code 1 ]

The CMakeList.txt file for rosidl_typesupport_fastrtps_cpp includes the following lines:

find_package(fastrtps REQUIRED CONFIG)
find_package(FastRTPS REQUIRED MODULE)

It's the second of these that appears to find FindFastRTPS.cmake here:

/home/broomstick/cheri/ros2_eloquent_min/install/fastrtps_cmake_module/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake

FindFastRTPS.cmake has the following lines:

find_path(FastRTPS_INCLUDE_DIR
  NAMES fastrtps/)

find_package(fastcdr REQUIRED CONFIG)
find_package(fastrtps REQUIRED CONFIG)

I've instrumented the CMakeList.txt and FindFastRTPS.cmake files to print all cached variables to the log, and the latter does not find anything to assign to FastRTPS_INCLUDE_DIR.

I've similarly instrumented my natively built ROS2 Eloquent distribution. Those cmake files find the include directory in <prefix>/install/fastrtps.

I added -DCMAKE_PREFIX_PATH=<prefix>/install/fastrtps. I tried the same for CMAKE_INCLUDE_PATH. Neither helped.

My build invocation is the following:

colcon build \
    --packages-skip-build-finished \
    --cmake-args \
        -DCMAKE_TOOLCHAIN_FILE=/home/broomstick/cheri/ros2_eloquent_min/CrossToolchain.cmake \
        -DBUILD_TESTING=NO \
        -DTHIRDPARTY=ON \
        -DCMAKE_PREFIX_PATH="/home/broomstick/cheri/ros2_eloquent_min/install" \
    --no-warn-unused-cli

Admittedly, I've removed several packages from the vanilla Eloquent distribution, but fastrtps seems to build just fine and there is a <prefix>/install/fastrtps which has the same cmake files as my native build.

This seems like it should be straightforward, but I didn't find any similar issues on ROS answers. The closest had similar answers, but they were building packages in their own workspaces after successfully building ROS2 (dashing, in this case).

edit retag flag offensive close merge delete