From owner-freebsd-questions@FreeBSD.ORG Sun Jan 25 22:45:41 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04CE106564A; Sun, 25 Jan 2009 22:45:41 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 00DA48FC08; Sun, 25 Jan 2009 22:45:40 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from phenom.cordula.ws (phenom [192.168.254.60]) by fw.farid-hajji.net (Postfix) with ESMTP id 81D1636A92; Sun, 25 Jan 2009 23:45:38 +0100 (CET) Date: Sun, 25 Jan 2009 23:46:54 +0100 From: cpghost To: Josh Carroll Message-ID: <20090125224654.GB4568@phenom.cordula.ws> References: <20090125214457.GA4568@phenom.cordula.ws> <8cb6106e0901251422q1412ed38gd14f7591d4dfcabd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8cb6106e0901251422q1412ed38gd14f7591d4dfcabd@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: dougb@freebsd.org, freebsd-questions@freebsd.org Subject: Re: make -jN build with portmaster X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2009 22:45:42 -0000 On Sun, Jan 25, 2009 at 05:22:04PM -0500, Josh Carroll wrote: > On Sun, Jan 25, 2009 at 4:44 PM, cpghost wrote: > > To build ports in parallel on a 4 core machine, I usually > > do this manually: > > > > # cd /usr/ports/some/port > > # make configure && make -j5 build && make install clean > > > > because all steps except "make build" are not compatible > > with -jN (some ports don't work with -jN in the "make build" > > phase either, but they are quite rare). > > > > Now, is there a way to teach portmaster to build or rebuild > > ports this way? The only workaround for now is something > > like: > > What I do is the following via make.conf, which will work for > portmaster/portupgrade or manual builds: > > # set MAKE_ARGS for the build target(s) > .if !(make(*install) || make(package)) > MAKE_ARGS+=-j8 > .endif > > Then as you find ports that don't build properly, add an entry like this: > > # some ports don't like -j8, so we can undo the MAKE_ARGS addition for those > .if ${.CURDIR:M*/multimedia/mplayer} > MAKE_ARGS:=${MAKE_ARGS:C/-j8//} > .endif That's a good hint indeed. I'll try it. Maybe I'll modify it a bit to include ONLY the "build" target, because -jN fails on nearly every other target, AFAICS. > It's a bit of a hack, but I've had decent success with this. Enough > ports fail to build with -jX, that I'd never do the above on a > production machine, especially since it's possible for some sort of > silent error that produces an unpredictable binary. But for my home > machine, I've been pretty happy with it. Yes, that's true, and it could happen. But I don't remember having had a port compile, yet silently fail, yet. (*knocking-on-wood*). ;) > Regards, > Josh Thanks, -cpghost. -- Cordula's Web. http://www.cordula.ws/