21
$\begingroup$

When using ROS:

Why should I use catkin build from catkin_tools instead of catkin_make?

I've been told that catkin build is better but no one who tells me this can give me a reason why.

$\endgroup$
1

2 Answers 2

21
$\begingroup$

The main difference is the isolated environment that you get with catkin build. This makes the whole build configuration much more compartmentalized and robust to changes in the configuration (add/remove package, modify a cmake variable etc.)

Apart from that you also get much better and easily-readable colored cmdline output which makes the whole experience much more pleasant.

@SteveO's link also gives a nice summary of the changes between the tools.

Adding to catkin build you also get many other useful subcommands with catkin including catkin clean for cleaning the build, devel and install spaces, as well as catkin list , catkin locate, catkin profile

$\endgroup$
8
$\begingroup$

Apart from the isolated build, it is much more convenient to use:

  • Independent packages are build in parallel which can make it much faster.
  • catkin build can be used from any directory in the workspace while catkin_make only works in the top level directory.
  • It is easy to only build a single package (+ dependencies): catkin build package_name or, when called from the package directory, catkin build --this. Add --no-deps to skip dependencies.
    (Note that catkin_make has a --only-pkg-with-deps flag for this, but there it will result in a persistent setting so next call of just catkin_make would also only build this package which is very unintuitive.)
  • catkin clean makes it easy to wipe build/devel without having to use a scary rm -rf.
  • Some other useful commands (list, locate, ...) as already mentioned by @bergercookie.
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.