Rosanswers logo

I'm building a few packages against the new Bouncy release and I'm seeing a difference between a binary installation and another one from source. Namely, when I source the installation from source my package builds normally, but when I source the binary one it hits an error. I'm on Ubuntu 18.04.

The error happens in a call to rosidl_generate_interfaces:

        DEPENDENCIES std_msgs)

The error is:

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find FastRTPS (missing: FastRTPS_INCLUDE_DIR FastRTPS_LIBRARIES) Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/opt/ros/bouncy/share/fastrtps_cmake_module/cmake/Modules/FindFastRTPS.cmake:95 (find_package_handle_standard_args)
/opt/ros/bouncy/share/rmw_fastrtps_cpp/cmake/rmw_fastrtps_cpp-extras.cmake:20 (find_package)
/opt/ros/bouncy/share/rmw_fastrtps_cpp/cmake/rmw_fastrtps_cppConfig.cmake:30 (include)
/opt/ros/bouncy/share/rmw_implementation_cmake/cmake/call_for_each_rmw_implementation.cmake:61 (find_package)
/opt/ros/bouncy/share/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake:26 (call_for_each_rmw_implementation)
/opt/ros/bouncy/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:27 (rosidl_generator_py_get_typesupports) /opt/ros/bouncy/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:38 (include)
/opt/ros/bouncy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:169 (ament_execute_extensions)
CMakeLists.txt:69 (rosidl_generate_interfaces)

My sources can be found at https://github.com/ada-ros. The package causing the error is rosidl_generator_ada. It's quite possible I'm doing something wrong in the CMakeLists.txt/package.xml because I'm not entirely confident on my understanding of ROS2 dependency tags. Thanks for any help.

Originally posted by amosteo on ROS Answers with karma: 43 on 2018-07-05

Post score: 0

Original comments

Comment by amosteo on 2018-07-06:
For what is worth, after converting all the packages to ament_make build type, the error has gone away

Comment by amosteo on 2018-07-06:
Also I've prepared a small reproducer with the default output of ros2 pkg create. I've only added the minimal dependencies from my own package to reproduce the error. Here it is: https://github.com/mosteo/ros2_testcases

Comment by Dirk Thomas on 2018-07-06:
Please post your exact steps to reproduce your problem (without the need to guess what you are actually doing in which order).

Comment by Dirk Thomas on 2018-07-06:
From a brief look the example package doesn't declare the dependencies in the package manifest. See https://github.com/ros2/common_interfaces/blob/1d80aae3de9b0c03052e13ec04a0c32693b38f61/std_msgs/package.xml for an example package with messages.

Comment by sloretz on 2018-07-06:
Are you using colcon? If so, does the error persist after upgrading it?

Comment by amosteo on 2018-07-06:
@DirkThomas, I thought the .xml file wouldn't affect the compilation driven by CMake, if there are missing dependencies there that would be a real mistake on my part. The real case had all dependencies (I think). Adding the ones in your example to this testcase didn't help. Steps I followed: (cont.)

Comment by amosteo on 2018-07-06:\

  • Create empty ws/src
  • Inside src, $ ros2 pkg create --build-type cmake fail
  • Copy my sample msg/srv to ~/ws/src/fail/
  • Created trivial ~/ws/src/fail/src/main.c
  • Filled CMakeLists.txt with minimal info.
  • Verify it builds with bouncy installed from srcs
  • Verify it fails with bouncy debs

Comment by amosteo on 2018-07-06:
Man, these comments are not the best! Anyway:

  • Both my bouncy binary/source installations are per wiki instructions
  • Before each build I open a new terminal, source the proper setup.bash, delete build and install folders

I just updated the testcase to add the deps in the xml, and (...)

Comment by amosteo on 2018-07-06:
(...) fixed a clash between the package name and target, I did not see it until trying with the from source bouncy that does not hit the bug. Now I have tested both a couple of times, binary install fails, from source passes.

Comment by amosteo on 2018-07-06:
@sloretz, I'm using plain "colcon build". I'm using the one that becomes available when sourcing the corresponding bouncy installation.

Sorry for the telegraphic style, these comments without preview are not suited for a detailed discussion I guess.

Comment by Dirk Thomas on 2018-07-06:
The deps in the xml are used to provide each pkg the appropriate context. If the deps are available in an isolated install space the package is likely going to fail if it doesn't declare the correct dependencies. When using the Debian package (which uses a merged install) that won't be a problem.

Comment by amosteo on 2018-07-07:
Ok, thanks, I understand now.


1 Answer 1


Rosanswers logo

The following patch to colcon-ros should fix the problem: colcon-ros#23 . Please try it again after updating the Debian package python3-colcon-ros to version 0.2.9-1.


With the above update the build works just fine for any existing message package, e.g. the common_interfaces repository.

In your case your test package uses plain CMake rather than ament_cmake. While that should work the problem is likely related to that difference.

Update 2:

The above patch only affects the build type ament_cmake but not plain cmake. You can workaround the problem by extending the CMAKE_PREFIX_PATH manually: export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH. An upcoming patch release of colcon-ros should be able to address this.

Originally posted by Dirk Thomas with karma: 16276 on 2018-07-06

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by amosteo on 2018-07-07:
Sorry, same error after upgrading:

$ apt policy python3-colcon-ros 
Installed: 0.2.9-1

$ which colcon

$ rm -rf build install; colcon build

error in pastebin: https://pastebin.com/UCbSF67g

Comment by Dirk Thomas on 2018-07-17:
The error output is not sufficient to provide any help. How does the package fail_example look like? Do you have the FastRTPS Debian package installed (ros-bouncy-fastrtps)?

Comment by amosteo on 2018-07-18:
See here for a more complete sequence: https://pastebin.com/wnHpyxMM . This is in another computer, with freshly installed bouncy following debians instructions. You can find the repo for my test package in there. At the end of the sequence are the installed package versions.

Comment by amosteo on 2018-07-18:
Thanks for following through.

Comment by Laas on 2019-05-22:
Should this still be a bug?

  Installed: 0.3.10-1

I'm building Ros in docker and I still have this issue but export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH before building fixes the issue.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.