Search code examples
c++buildcmakeroscatkin

C++: What does the build option "-j" mean?


I have a project, which consists of C++ code and uses CMake as build system and above that uses the Catkin tool catkin_make to build the project. The thing is, it does or does not build depending on weather I use the build option -j as in catkin_make -j4. (working only for -j1) I googled/stackoverflowed already, but could not find out the meaning of this option.

I believe that -j is often also used in other C++/CMake projects not using Catkin, so maybe someone can give me an expaination.

Thanks!


Solution

  • At their github repository they say that the -j parameter is passed directly to the make command.

    The -j (--jobs) and -l (--load-average) arguments for make are also extracted and passed to make directly

    So -jN indicates the number of jobs run in parallel.