Ask Your Question

How to catkin_make one package

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

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

2 Answers

Sort by ยป oldest newest most voted

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

Delb gravatar image

Check #q54178.

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

edit flag offensive delete link more

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

gvdhoorn gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 1,720 times

Last updated: Mar 14 '18