[nycbug-talk] "make -jN" in freebsd ports

Wesley Shields wxs at FreeBSD.org
Thu Jun 17 17:14:07 EDT 2010


On Wed, Jun 16, 2010 at 11:55:34PM +0000, Pete Wright wrote:
> On Wed, Jun 16, 2010 at 07:32:22PM -0400, Justin Dearing wrote:
> > Hi,
> > 
> > I'm running freebsd after a long hiatus on a vbox vm in my new 8 core i7. I
> > was installling mongodb and I wanted to speed things up the way one normally
> > does when running make on a multicore box "make -j4 install" (or whatever).
> > Anyway after about half a second the port install failed.
> > 
> > So is this just a ports collection limitation? is there some envirormental
> > variable I can pass to make that it will pass to the actual make/scons
> > process of the tarball being built?
> > 

There are two kinds of parallel building here. We should be clear when
discussing them.

> this is most likely expected.  there has been some changes commited to
> /usr/ports/MK/bsd.port.mk that allow you to define this.  I think this
> will allow ports that have been deemed safe to use the "-j" switch to be
> built with the amount of jobs you have defined.  The variables are:
> 
> # MAKE_JOBS_SAFE
> # MAKE_JOBS_UNSAFE
> # DISABLE_MAKE_JOBS
> # FORCE_MAKE_JOBS

These options are set on a per-port basis by the maintainer and are used
to build that particular port with -j automatically. There's nothing a
user needs to set at all for these. It should all be handled magically.
:)

The other option (cd /usr/ports/foo/bar && make -j4 install) is not
supported at all. You run into all kinds of issues with dependencies
and trying to rebuild the same thing on top of itself.

> IIRC you would define these variables in
> /usr/ports/Mk/bsd.port.options.mk.  The manual should be read to verify
> though :)

Not quite. Please see above for clarification.

-- WXS



More information about the talk mailing list