Subject: Re: pkgsrc on SMP machines
To: Dieter Baron <dillo@danbala.tuwien.ac.at>
From: Hubert Feyrer <feyrer@cs.stevens.edu>
List: tech-pkg
Date: 12/15/2005 20:30:15
On Thu, 15 Dec 2005, Dieter Baron wrote:
>  Not all packages' build system support this, many probably fail (or
> become unreliable) when make is invoked with -j.

True.
That's why I suggested a per-package maximum:


> : Of course that's a crude hack, and a real solution would involving a
> : user-settable variable plus a per-package maximum, and the real value
> : would be the somewhere in between there.
>
>  If we want to support this, we would need a variable in package
> Makefiles that tell wether this package can use -j, defaulting to no
> (a working build is more important than performance improvements).  We
> could then test individual packages (beginning with popular big ones)
> and enable it there.

"What I said".

Maybe something like


 	PER_PKG_MAXJ?=	1
 	.if (${USER_MAXJ} > ${PER_PKG_MAXJ})
 	MAXJ=${PER_PKG_MAXJ}
 	.else
 	MAXJ=${USER_MAXJ}
 	.endif

 	... -j${MAXJ}

If someone wants to play with that, sending a tested patch here would be 
nice. I don't have neither time nor hardware to do this.


  - Hubert