Subject: Re: Have pkgsrc building make use of SMP?
To: Hubert Feyrer <hubert@feyrer.de>
From: Lars Nordlund <lars.nordlund@hem.utfors.se>
List: tech-pkg
Date: 04/05/2005 22:57:43
Tue 2005-04-05 klockan 14:30 +0200 skrev Hubert Feyrer:
> On Tue, 5 Apr 2005, Hubert Feyrer wrote:
> > The way to go is pass -j17 as MAKE_FLAGS to the Makefile being called for the 
> > pkg to build. If you want to work on this, I may be able to review.
> 
> For an implementation, try the following patch with MAKE_J=-j3 in 
> /etc/mk.conf:
> 
> Index: bsd.pkg.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
> retrieving revision 1.1607
> diff -u -r1.1607 bsd.pkg.mk
> --- bsd.pkg.mk  5 Apr 2005 03:18:00 -0000       1.1607
> +++ bsd.pkg.mk  5 Apr 2005 12:28:03 -0000
> @@ -2182,7 +2182,7 @@
>   # Build
> 
>   BUILD_DIRS?=           ${WRKSRC}
> -BUILD_MAKE_FLAGS?=     ${MAKE_FLAGS}
> +BUILD_MAKE_FLAGS?=     ${MAKE_J} ${MAKE_FLAGS}
> 
>   .PHONY: do-build
>   .if !target(do-build)
> 
> 
> 
> What I'm afraid of is the non-pleasant, hard part - that pkg Makefiles 
> won't properly handle -j. :)

It would be really cool to be able to just have pkgsrc build multiple
packages at the same time.

Example:

'foo' depends upon 'bar' and 'rab'. Neither of 'bar' or 'rab' depend on
the other.

# cd /usr/pkgsrc/meta-pkgs/foo; make -j 2
<pkgsrc spawns two build processes, one for bar and one for rab. when
both are done the build of foo continues..>


This way the various packages' broken build systems would not be an
obsticle!


Since the pkgsrc make knows about the dependancies it feels like this
should be possible to implement..


Best regards
	Lars Nordlund