# How to build a subset of nodes in workspace?

Hello, I'm developing a multi-computer ROS project where each processor has multiple nodes running on it. We've found that builds have become quite long as we're not cross compiling yet and so some of the smaller embedded processors can take a decent amount of time to build the whole workspace despite not needing to build every package.

I've been looking into a way to specify a single target which can be specified like catkin_make --pkg <target> such that all of the packages required for a node on a specific end target are built. I thought metapackages might be the answer for this, but they seem to address a different problem.

Is there a standard way to equate a catkin target to a set of packages so that the whole codebase does not need to be built? I see this as also being useful for cross compiling anyway for having a single target to cross compile.

edit retag close merge delete

Sort by » oldest newest most voted

I've been looking into a way to specify a single target which can be specified like catkin_make --pkg <target> such that all of the packages required for a node on a specific end target are built.

catkin_make should allow you to do that, if you use the --only-pkg-with-deps option:

  --only-pkg-with-deps ONLY_PKG_WITH_DEPS [ONLY_PKG_WITH_DEPS ...]
Whitelist only the specified packages and their
dependencies by setting the CATKIN_WHITELIST_PACKAGES
variable. This variable is stored in CMakeCache.txt
and will persist between CMake calls unless explicitly
cleared; e.g. catkin_make
-DCATKIN_WHITELIST_PACKAGES="".


Alternatively, catkin_tools supports profiles, that in turn can be configured with specific white and blacklists of packages.

In addition you can ask it to build just a single package with all it's dependencies:

catkin build <pkg_name>


or even just a package without its dependencies:

catkin build <pkg_name> --no-deps


See catkin build – Build Packages for the documentation of the build verb and the Building Subsets of Packages section.

more