catkin make
Catkin make is basically a wrapper of the CMake
and make
. It’s part of the original Catkin build system, and build the entire workspace using a single Cmake
invocation.
catkin make
builds pacakges all together, so there’s less isolation- Supports parallelism as well, but less fine-grained control over that.
catkin_make -j4
launches 4 sub-processes. Relies entirely oncmake
parallelism
- Might handle “hidden” dependencies implicitly, whereas
catkin build
requires more explicit dependency declarations.
Useful Commands
catkin_make clean
: does NOT removebuild
anddevel
?
CMakeLists.txt
commands
- ros packages should go into
find_package( catkin REQUIRED components MY_PACKAGE)
catkin build
catkin build
is part of the catkin_tools
package.
- It provides more parallelism, and builds packages separately (which provides more isolation)
- Can support parallelism on the number of both build subprocesses and the number of targets.
catkin build -j4 -p2
means “build 2 packages at a time”
- Can support parallelism on the number of both build subprocesses and the number of targets.
- supports build configurations like
release
vsdebug
- only rebuilds packages that have changed, or dependencies that have changed.
Useful Commands
catkin build --verbose
: Verbose Outputcatkin clean
: deletebuild
, anddevel
,logs
. This is part of thecatkin tools
package so it won’t work forcatkin make
Differences
${CMAKE_SOURCE_DIR}
catkin_make
treats this as workspace rootcatkin build
finds the package root
General Guidelines
- Avoid putting non-catkin packages under the
src
directory- Adding a
package.xml
to it will break the SLA to keep the package a non-catkin one, so this is not a good idea - A good idea in this case is to install it.
- If you are using docker without root priviledges, you can’t install it in global space
- You can install it in a custom space instead.
-
The non-catkin package’s
CMakeLists.txt
looks like1 2 3 4 5 6 7
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(DIRECTORY include/ DESTINATION include)
- And it’s invoked by
cmake -DCMAKE_INSTALL_PREFIX=${CUSTOM_INSTALL_PATH}
- See this post on Docker basics for how to set CUSTOM_INSTALL_PATH throught docker
- Adding a