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.
Robotics Stack Exchange is a question and answer site for professional robotic engineers, hobbyists, researchers and students. It only takes a minute to sign up.
Sign up to join this communityWhen 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.
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
Apart from the isolated build, it is much more convenient to use:
catkin build
can be used from any directory in the workspace while catkin_make
only works in the top level directory.catkin build package_name
or, when called from the package directory, catkin build --this
. Add --no-deps
to skip dependencies.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
.