[CMake] CMake 3.7.2 and parallel builds

Paul Smith paul at mad-scientist.net
Sat Jan 28 09:43:19 EST 2017


On Fri, 2017-01-27 at 15:45 -0400, Dave Flogeras wrote:
> I've recently upgraded to CMake 3.7.2 (and gnu make-4.2.1). Now, when
> I execute 'make -j5 NightlyBuild', I get the following new (to me)
> warning:
> 
> "gmake[4]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule."
> 
> If I downgrade make back to the previous version, 4.1-r1 (the -r1 is
> Gentoo), the warning goes away again.
> 
> If I use CMake-3.6.3 (my previous version) with make-4.2.1, the
> warning is still there.
> 
> Is this a known issue?  Is it something I am doing wrong in my
> scripts?

My suspicion is that somehow the recursion is invoking an older version
of make.  In GNU make 4.2 the jobserver interface was stabilized and
published, so that other build tools could take advantage of it (if
desired); for example if your linker is multithreaded it could
participate in the jobserver feature, obtaining jobserver tokens for its
threads so it didn't overwhelm the system during linking.

As part of this the command-line interface between a parent make and its
sub-makes was changed.  This means that if a parent make tries to invoke
a sub-make and they have different versions there may be an
incompatibility.

Normally this is very difficult to do because GNU make sets the MAKE
variable to the version of make which is currently running (as best it
can determine it) and everyone should be invoking submakes using the
$(MAKE) variable.

But, perhaps something in your setup is confounding this normal
behavior.

You can try adding "VERBOSE=1" to your make invocation and look at the
way sub-makes are invoked and see if there's anything odd-looking about
it.

If that's not it, I'm not sure what the problem is but perhaps the
VERBOSE=1 will help diagnose it anyway.


More information about the CMake mailing list