From owner-freebsd-current@freebsd.org Thu Mar 2 12:58:42 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 1291ACF2521 for ; Thu, 2 Mar 2017 12:58:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C913B758 for ; Thu, 2 Mar 2017 12:58:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.avinity.tv (unknown [77.95.97.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4904922532; Thu, 2 Mar 2017 13:58:32 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_4641578D-3F5F-4BE9-8DC2-C657FD72B68C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: CFLAGS for certain ports Date: Thu, 2 Mar 2017 13:58:27 +0100 In-Reply-To: Cc: freebsd-current@freebsd.org To: Mingo Rrubioer References: X-Mailer: Apple Mail (2.3259) 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: Thu, 02 Mar 2017 12:58:42 -0000 --Apple-Mail=_4641578D-3F5F-4BE9-8DC2-C657FD72B68C Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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 --Apple-Mail=_4641578D-3F5F-4BE9-8DC2-C657FD72B68C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAli4FvcACgkQsF6jCi4glqMhQACfRnH1vwFsZvoSTlMom6iNL3bv /jsAmgKmkDsvzLgooQ5wWxM9VzvU23fj =bYV6 -----END PGP SIGNATURE----- --Apple-Mail=_4641578D-3F5F-4BE9-8DC2-C657FD72B68C--