Ask Your Question
1

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

4 Answers

Sort by » oldest newest most voted
2

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
0

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

bigbellmercy gravatar image

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

This worked to me:

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

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

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
0

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
                        --install)
[...]

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

2 followers

Stats

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

Seen: 2,449 times

Last updated: May 18