ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to catkin_make one package

asked 2018-03-14 01:56:17 -0500

bear234 gravatar image

I'm trying to install my custom ROS workspace from source.

What I've done is to download the source code of version of ros-kinetic-ros-base, then I add some additional packages into ros-base.

When I add one package, I always execute ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release to catkin_make all packages. This gonna take much time.

So I'm thinking if I can catkin_make only one package that I added because others have been installed before.

For example, here is the structure of my ros-base:

/home/ros/ |-----------src |-----------build_isolated |-----------devel_isolated |-----------install_isolated

As you see, all have been done correctly after executing ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release. Now I add a package named newPkg into ./src. To rebuild, I have to execute the command again, which will rebuild all packages.

So is it possible to catkin_make the only one package?

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted

answered 2018-03-14 02:25:56 -0500

Delb gravatar image

Check #q54178.

Personnally I use catkin_make -DCATKIN_WHITELIST_PACKAGES="foo;bar".

edit flag offensive delete link more

answered 2020-04-20 21:30:32 -0500

hashirzahir gravatar image

I would recommend moving to use catkin build instead of catkin_make. catkin build has a lot more functionalities, and as mentioned in the migrating from catkin_make doc

Unlike catkin_make, the catkin command-line tool is not just a thin wrapper around a the cmake and make commands. The catkin build command builds each package in a workspace’s source space in isolation in order to prevent build-time cross-talk. As such, in its simplest use, catkin build behaves similarly to a parallelized version of catkin_make_isolated.

Note that a workspace cant use both catkin_make and catkin build simultaneously, only 1 of them at any one time. Then, in order to build a single package, you can use catkin build PKG_NAME.

edit flag offensive delete link more


I thought catkin package was old, unsupported and in general to be avoided?

pitosalas gravatar image pitosalas  ( 2021-06-02 09:37:14 -0500 )edit

I'm not aware of that. I felt that catkin package had better features than catkin_make for building ROS1 packages. Even on the ros2 design page for build tool selection, it is mentioned:

"catkin_tools is provided by a standalone Python package used to build ROS 1 packages. It was developed after catkin_make / catkin_make_isolated to build packages in parallel as well as provide significant usability improvements. The tool supports building CMake packages and builds them in isolation as well as supports parallelizing the process across packages."

But anyways, they have moved to a new build system for ROS2, so it is only a matter of time before people move over to colon.

hashirzahir gravatar image hashirzahir  ( 2021-06-03 06:47:28 -0500 )edit

answered 2018-03-14 02:56:02 -0500

gvdhoorn gravatar image

updated 2018-03-14 03:00:45 -0500

The whitelist mentioned by @Delb will work. But catkin_make_isolated directly supports this use-case with command line arguments:

  --pkg PKGNAME [PKGNAME ...]
                        Process only specific packages (only after
                        catkin_make_isolated has been invoked before with the
                        same install flag)
  --from-pkg PKGNAME    Restart catkin_make_isolated at the given package
                        continuing from there (do not change CMake arguments,
                        add/move/remove packages or toggle the install flag
                        when using this option since this may result in an
                        inconsistent workspace state).
  --only-pkg-with-deps ONLY_PKG_WITH_DEPS [ONLY_PKG_WITH_DEPS ...]
                        Only consider the specific packages and their
                        recursive dependencies and ignore all other packages
                        in the workspace (only works together with --merge or

So to build only your newPkg, I would use:

catkin_make_isolated --only-pkg-with-deps newPkg

Note: your question title asks about catkin_make, but your question is really about catkin_make_isolated. They're both binaries having to do something with Catkin, but they're not identical and their behaviour can and does vary.

"catkin_making" is not a thing. catkin_make is a wrapper around CMake, just as catkin_make_isolated is. Even though you invoke it using catkin_make, in the end it just runs make (or ninja, depending on the generator you've chosen).

Edit: I just noticed that you're managing a 'base' source build. If you're trying to do 'normal' development after having built your base ROS, I would recommend to use an overlay workspace to store your own packages in. That way only the pkgs in that workspace will be built, removing the need to explicitly limit the packages.

edit flag offensive delete link more

answered 2020-04-20 20:50:55 -0500

bigbellmercy gravatar image

updated 2020-05-18 21:51:26 -0500

This worked to me:

catkin_make_isolated --install --pkg YourPackageName
edit flag offensive delete link more

Question Tools



Asked: 2018-03-14 01:56:17 -0500

Seen: 4,710 times

Last updated: May 18 '20