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 makebuilds pacakges all together, so there’s less isolation- Supports parallelism as well, but less fine-grained control over that.
catkin_make -j4launches 4 sub-processes. Relies entirely oncmakeparallelism
- Might handle “hidden” dependencies implicitly, whereas
catkin buildrequires more explicit dependency declarations.
Useful Commands
catkin_make clean: does NOT removebuildanddevel?
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 -p2means “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
releasevsdebug - 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 toolspackage so it won’t work forcatkin make
Differences
${CMAKE_SOURCE_DIR}catkin_maketreats this as workspace rootcatkin buildfinds the package root
General Guidelines
- Avoid putting non-catkin packages under the
srcdirectory- Adding a
package.xmlto 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.txtlooks 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