Rosanswers logo

Hello all,

in my ROS2 workspace I want to build two packages which use the catkin build system (https://github.com/KIT-MRT/mrt_cmake_modules and https://github.com/fzi-forschungszentrum-informatik/Lanelet2). From the colcon documentation I take that it should be able to use catkin as underlying build system. However when I run colcon build on the workspace it throws the error:

user@user-VirtualBox:~/ros2_ws$ colcon build
Starting >>> mrt_cmake_modules
--- stderr: mrt_cmake_modules                          
CMake Error at CMakeLists.txt:4 (find_package):
  By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "catkin", but
  CMake did not find one.

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


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

Failed   <<< mrt_cmake_modules  [ Exited with code 1 ]

Summary: 0 packages finished [0.63s]
  1 package failed: mrt_cmake_modules
  1 package had stderr output: mrt_cmake_modules
  10 packages not processed

So cmake is apparently not able to "find" catkin. A colcon info correctly identifies the package as type: ros.catkin. If I do a catkin build in a separate catkin workspace it works. I am using Ubuntu 18.04 with both ros-melodic and ros-crystal installed from the ROS repositories. As requested, some further version information:

user@user-VirtualBox:~/ros2_ws$ colcon version-check
colcon-argcomplete 0.3.2: up-to-date
colcon-bash 0.3.2: up-to-date
colcon-cmake 0.2.8: up-to-date
colcon-core 0.3.18: newer version available (0.3.19)
colcon-defaults 0.2.1: up-to-date
colcon-devtools 0.2.1: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.1: up-to-date
colcon-notification 0.2.6: newer version available (0.2.7)
colcon-output 0.2.3: up-to-date
colcon-package-information 0.2.2: up-to-date
colcon-package-selection 0.2.3: newer version available (0.2.4)
colcon-parallel-executor 0.2.3: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.4: up-to-date
colcon-python-setup-py 0.2.1: up-to-date
colcon-recursive-crawl 0.2.0: up-to-date
colcon-ros 0.3.8: up-to-date
colcon-test-result 0.3.1: up-to-date
colcon-zsh 0.3.2: up-to-date

I would be thankful if you could point me in the right direction here.

Originally posted by odelay on ROS Answers with karma: 103 on 2019-03-20

Post score: 1

Original comments

Comment by Dirk Thomas on 2019-03-20:
Please provide more information, e.g. the full output of the invocation (this posted snippet is unlikely to be all), the output of colcon version-check.

Comment by odelay on 2019-03-20:
I added the requested info. For now I do not know how I can upgrade the colcon packages to a newer version independent of the deb package repositories.

Comment by Dirk Thomas on 2019-03-20:
The latest versions are available via Debian packages. So the usual sudo apt update && sudo apt dist-upgrade should get them.

What do the following commands output: env | grep CMAKE_PREFIX_PATH (in the terminal where you invoked colcon build) and colcon info mrt_cmake_modules?

Comment by odelay on 2019-03-20:
Okay, my packages are already up-to-date with the repositories. The CMAKE_PREFIX_PATH variable is not found (this should probably not be the case..). The last command returns:

user@user-VirtualBox:~/ros2_ws$ colcon info mrt_cmake_modules
path: /home/christian/ros2_ws/src/mrt_cmake_modules
  type: ros.catkin
  name: mrt_cmake_modules
    build: catkin coverage rospack

1 Answer 1


Rosanswers logo

catkin can't be found because your CMAKE_PREFIX_PATH is empty. The likely reason is that you haven't sourced the setup file: . /opr/ros/melodic/setup.bash

Originally posted by Dirk Thomas with karma: 16276 on 2019-03-20

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by odelay on 2019-03-21:
Maybe this needs to be added to the Colcon Tutorial (https://index.ros.org/doc/ros2/Tutorials/Colcon-Tutorial/) since this mixing of ROS distributions is not entirely obvious for a ROS2 beginner.

Comment by Dirk Thomas on 2019-03-21:
I don't see how this related to mixing ROS distributions. You are using ROS 1 Melodic and build a catkin package on top of it.


Your Answer

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