home | list info | list archive | date index | thread index

Re: possible race condition in makefile with multiple dependencies?


On 03/06/2021 10:38, Michael P. Soulier wrote:
On 2021-06-03 10:22 a.m., Dianne Skoll wrote:
Shouldn't be.  My understanding (which may be wrong) is that make
calculates the dependency graph first, not in parallel.  Then it
executes as many parallel tasks as the -j option asks for, or that
make sense... whichever is smaller.  Since the dependency graph is a
DAG, make should, in theory, be smart enough to see that two
dependencies depend on the same node and run only one job to build the
depended-upon node.

I routinely use "make -j `nproc`" and have never run into any issues.

Good to know. Does anyone have a solution for make across multiple machines, perhaps using ssh?

distccd

On Gentoo you configure your preferred "-j" value in /etc/portage/make.conf. It will compile that number files in parallel. distcc will allow that work to be shared across multiple machines - and cross compile for different architectures if required.

Some gentoo packages need to be forced to build with -j1 if
a) it needs hideous amounts of RAM
b) some just need it (I assume some of these race conditions)

Tug


Mike

To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org


To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org