Speed up build phase with "make -j"

Weissmann Markus mww at macports.org
Tue Oct 30 04:07:47 PDT 2007


On 28.10.2007, at 23:52, js wrote:

> On 10/29/07, Anders F Björklund <afb at macports.org> wrote:
>>>> Note that some ports will fail to build, when using "make -j 2"
>>>
>>> What causes the build erorr? is it for bad Makefile or problem of  
>>> "-j"
>>> option itself?
>>
>> Bad makefiles, usually missing dependencies.
>
> So, in a way, using -j encourage us to find wrong makefiles:)

Well, if you're lucky -- parallel builds get non-deterministic, so  
software _may_ build correctly.
You may (!) even end up with a successful build that created "bad"  
installations with misbehaving software;

An intermediate step that makes changes to a file may get scheduled  
after the last step compiles an object file from this file; this way  
you might get a successful build but w/o the changes from step 2.
Those are extremely hard to trace bugs and maintainers might reject  
bug reports if builds got made parallel this way -- after all they  
cannot reproduce failing builds due to the non-determinism.

I'd rather encourage a mechanism for port that provides a mechanism  
for port authors to know how many processors there are and to enable  
parallel builds if they know this to work.
Perhaps a switch "use_parallel_build [yes|no]" that will add "-j  
2*CPUS" to build.args.


-Markus

---
Markus W. Weissmann
http://www.mweissmann.de/




More information about the macports-dev mailing list