On Thu, May 29, 2008 at 11:17:14AM +0200, Adriaan de Groot wrote:
> On Thursday 29 May 2008 03:18:47 michael schuster wrote:
> > I just noticed that "make" in SPECS barely uses one cpu, let alone all 16 I
> > happen to have available on the machine I'm currently on.
> > Can I improve on this situation easily?
> 
> Each package does the actual building through its own Solaris/build.sh 
> script. 
> Many of these use $MAKE $MAKE_CPUS which will do a parallel build with as 
> many 
> CPUs as you've got (assuming the detection code works universally [1]).
> 
> However, Stefan claims that parallel builds with C++ are harmful as the IPO 
> can get confused. For this reason, *some* packages build only with -j1. Boost 
> is a big example here; it could certainly use a 16-fold speedup in 
> compilation 
> on Dillon, but doesn't. I've never seen C++ weirdness with parallel builds 
> (and all the KDE SVN modules use as many CPUs as you've got), but defer to 
> him 
> in this case.

IPO parallel problems have nothing to do with C++.

IPO is designed to reoptimize object files on a link phase in a way specific to
a binary being linked.
For that optimization it uses additional information stored into these object 
files
on a compile phase.

Thus if you build two binaries constructed from the same object files and do it 
in parallel
you might get certain side-effects (in particular due to make not knowing that
IPO-link updates those object files). It gets worse if one of those binaries 
does not use
IPO to link.

Building a single binary, or binaries that do not intersect on objects is 
perfectly safe.

regards,
  Fedor.

> 
> You could try to build multiple packages in parallel. The Makefile in SPECS/ 
> still has checking to suppress -j at that level, because we didn't use to 
> have 
> dependencies set up between the specfiles. Now that we do, you could remove 
> that and let make sort it out. Then you could build multiple packages in 
> parallel and let each package sort out how much parallelism it wants to apply 
> to the build itself.
> 
> 
> 
> [1] The code is
> 
> MAKE_CPUS=`/usr/sbin/psrinfo | perl -e 'my $c=0; while(<>) { $c++ if /on-
> line/; } $c=1 unless $c; $c=4 if $c>4; print "-j$c";'` ; export MAKE_CPUS
> 
> so you can see it's clamped to 4 cpus max, anyway. That's something to add to 
> the configuration in Makefile.config and through Respect.pl, I suppose.
> 
> 
> _______________________________________________
> kde-discuss mailing list
> kde-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/kde-discuss

Reply via email to