From owner-freebsd-current@freebsd.org Fri Mar 3 15:47:24 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F804CF6414 for ; Fri, 3 Mar 2017 15:47:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C9F7F1597; Fri, 3 Mar 2017 15:47:23 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-68-117-45.dyn.iinet.net.au [106.68.117.45]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v23FlAte031751 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 3 Mar 2017 07:47:14 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: CFLAGS for certain ports To: Dimitry Andric , Mingo Rrubioer References: Cc: freebsd-current@freebsd.org From: Julian Elischer Message-ID: Date: Fri, 3 Mar 2017 23:47:05 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 15:47:24 -0000 On 2/3/17 8:58 pm, Dimitry Andric wrote: > On 2 Mar 2017, at 12:02, Mingo Rrubioer wrote: >> I would like to see how well FreeBSD does as a workstation OS in the >> HPC world due to its stability and reliability, as well as LLVM/clang. >> I would like to know if FreeBSD has something similar to Gentoo's >> /etc/portage/make.conf file and /etc/portage/package.use/* files in >> order to compile certain ports with certain compiler flags. > It doesn't, though it would certainly be nice to have something like it > at some point. The current idiom is to put something similar to the > following in your /etc/make.conf: > > .if ${.CURDIR:M/usr/ports/foo/bar} > CFLAGS+= [... flags for the foo/bar port ...] > .endif > > .if ${.CURDIR:M/usr/ports/what/ever} > CFLAGS+= [... flags for the what/ever port ...] > .endif > > >> Regarding LLVM/clang, I've been reading the documentation and found >> these flags: -arch=, -march=, -mcpu=, >> --target=, target-cpu . I'm not quite sure which >> one would be the one to use. In case someone wants to know, my initial >> play/test machine has this processor: >> >> CPU: Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (3600.11-MHz K8-class CPU) >> Origin="GenuineIntel" Id=0x206d7 Family=0x6 Model=0x2d Stepping=7 >> >> And I'm currently running: 11.0-RELEASE-p8. >> >> So I imagine I should use something like CFLAGS+= -march=corei7-avx >> -march=sandybridge -target-cpu. Is that correct? > Don't specify -march or -mcpu directly, but add the following line to > /etc/make.conf: > > CPUTYPE?= native > > This will take care of everything automatically. See also make.conf(5). > > -Dimitry > Many many 3rd party packages use a consistent set of variables fed into the automumble tools. Only today I was pleasantly surprised to see the lftp port pick up my CFLAGS and LDFLAGS changes without me having to change anything in the ports themselves.. we should investigate what these defacto stndards are and document them