From owner-freebsd-questions@FreeBSD.ORG Sun Jan 25 22:22:07 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 3AD321065688 for ; Sun, 25 Jan 2009 22:22:07 +0000 (UTC) (envelope-from josh.carroll@gmail.com) Received: from mail-fx0-f15.google.com (mail-fx0-f15.google.com [209.85.220.15]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2118FC13 for ; Sun, 25 Jan 2009 22:22:06 +0000 (UTC) (envelope-from josh.carroll@gmail.com) Received: by fxm8 with SMTP id 8so25652fxm.19 for ; Sun, 25 Jan 2009 14:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cQZr+a2Sy2pC0KZxpK16UYxyERxNiN4bD3CuU/7X3oA=; b=g44o4GuGGBFv5VwiAkFXgjOyZQs4AMF4cniD9Qqu8I2YgJqBN2FKGuIHg1LYN7Jdin t+Vz74vtsXcMcC/aHUbBxeO+7rDOj44Hm6ZWfS8FaX1QtsCZOXvk9JDr0Ba2KwFiW4ie EnqGZUvVKUdWzmNm21IobhTIxSCNTBc/LHQMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=u4xVoCNVDHJuIZT/xsVv7JRLgEgefGFDCUTskhBiIp6aWwhmfVpuku7M1lsFiM24NN jsPXMJts906YfpfA3uAItLliPMriJsBwrMhdoIR/Zzjew1F2u3PZrqvBEzFgfxRkVD9G jCvWJhaRxIF3vfOnbdH1l/mU9uw124Iwg1Mr4= MIME-Version: 1.0 Received: by 10.103.92.10 with SMTP id u10mr3799432mul.22.1232922124951; Sun, 25 Jan 2009 14:22:04 -0800 (PST) In-Reply-To: <20090125214457.GA4568@phenom.cordula.ws> References: <20090125214457.GA4568@phenom.cordula.ws> Date: Sun, 25 Jan 2009 17:22:04 -0500 Message-ID: <8cb6106e0901251422q1412ed38gd14f7591d4dfcabd@mail.gmail.com> From: Josh Carroll To: cpghost Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 Reply-To: josh.carroll@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2009 22:22:07 -0000 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 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. Regards, Josh