catkin_tools
catkin_tools copied to clipboard
Jobs flags not propagated to ExternalProject_Add
System Info
- Operating System: Ubuntu 14.04
- Python Version: 2.7.6
- Version of catkin_tools: 0.4.4
- ROS Distro: Indigo
Actual Problem
The doc of catkin build
says that the jobs flags -jN
are passed directly to make when issuing catkin build <package> -jN
. Turns out that they are not passed to the build and install commands of ExternalProject_Add
.
Steps to Reproduce the Issue
Excerpt of CMakeLists.txt
:
include(ExternalProject)
ExternalProject_Add(example
GIT_REPOSITORY <repo>
GIT_TAG b874783ccdf4cc36cb3546e6b6a998cb8f3470bb
UPDATE_COMMAND ""
SOURCE_DIR src
BINARY_DIR build
)
Here the BUILD_COMMAND
and INSTALL_COMMAND
are implicitly make
and make install
respectively. Shouldn't the jobs flags -jN
be passed to these commands as well ?
In my tests, it seems it's really just make
without arguments what's called by the ExternalProject, but for some reason, it only runs the number of build jobs I've specified for catkin build
. I tried cleaning the workspace with the same results.
Hmm, I think what happens at my computer is that catkin build runs multiple jobs, each of which is a single-threaded make. So it must somehow take over the jobs generated by the external project (even though it's a plain CMake project).
In the end, the build process utilizes as much cores as I wish, but I see that you were probably expecting a single multithreaded make call.
When building a single package there should anyway be only a single catkin build job running. I thought that catkin build
would run the make jobs in a multithreaded fashion with -jN
.