Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake and parallel building with "make -jN"

I'm trying to setup a parallel CMake-based build for my source tree, but when I issue

$ cmake .
$ make -j2

I get:

jobserver unavailable: using -j1.  Add '+' to parent make rule

as a warning. Does anyone have an idea if it is possible to fix it somehow?

like image 221
Roman Dmitrienko Avatar asked May 31 '10 09:05

Roman Dmitrienko


1 Answers

In the generated Makefile, when calling into a sub-make it needs to either use $(MAKE) (not just 'make') or else precede the line with a +. That is, a rule should look like this:

mysubdir:
    $(MAKE) -C mysubdir

or like this:

mysubdir:
    +make -C mysubdir

If you don't do it one of those two ways, make will give you that warning.

I don't know anything about cmake, so maybe it's generating Makefiles that aren't correct. Or maybe you did something incorrectly on your end.

like image 176
apenwarr Avatar answered Sep 30 '22 17:09

apenwarr