From owner-freebsd-current@freebsd.org Thu Mar 2 15:29:32 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 D29B9CF43B4 for ; Thu, 2 Mar 2017 15:29:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9C0CC0; Thu, 2 Mar 2017 15:29:32 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x22c.google.com with SMTP id s15so36565670ywg.0; Thu, 02 Mar 2017 07:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5OzObzHQCno6rO8XSxntiMIWWXGBqxhYKwbV1fRxoW8=; b=cM1oHqDLxwiiKMh6dq54vM0pAZXCy4vwrgfBw81f6Zq85QFRncCJLtzQO0eYQHVeHb HKmp6HNMJFMB0lx+GiAIB+hCQyCmG9KUsX1hPlgf/7cYxIuAUTgsHefz6GY9DLLlZYYw jgThD1a8dQeggwYcXnCu4jF/U3Hxclyck0aDGzf2/GmQ46amlbW90jnbemVJH7MyMxV1 r9f/DUyJmNxRKEZm7A3P7uX7ALL9CHuDE7Q9qPMW6xQSBoojABiFgExn44/0bt+n7ajv utskrNJSQOpSovnJY+80AmQ+LgiKn/lzRTOtM2RGbTCT1UXZ+Yk0+rBnivNuT2rB43mE 9oAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5OzObzHQCno6rO8XSxntiMIWWXGBqxhYKwbV1fRxoW8=; b=nMUzYQVC7zhXChvWRyfKiY8bntnjUNjTr//2gsRTQIvZcrriNCksXmAg2JVoHNerK9 ywwkyfaCSCRdTA/0v7ojWXCGH6lwAuVaWZBYhIXUpiHNiDyhkK9r4RFuKBgP03cvsNdt /lJVY7PeuAuMSRldWTiV+KNmA6IgscMn89hQ6SZdMCB9y2YPAudnlBE+V6/ZtA9DprFH fG6IdcUB+xoVGQtqXPaB38oJ/9g3+QLgVLmEF+UuzBM0XhvNBlK2mwQNOWEBCltgDMFQ T1v8XBoDJRpKOLNrS9I91a9vVWE5jWEqiUOv4T/cVtH6YdKnpinGxRjI0fUoMmE7uLp1 VXWQ== X-Gm-Message-State: AMke39kpAyIG7GrsKDHzPSkonJrQhzi5cCI4GgrdP4pprZEysBq5o5HWmF4kqZ28sigay5hC8besROVVKQgDVw== X-Received: by 10.129.173.68 with SMTP id l4mr4839583ywk.351.1488468571538; Thu, 02 Mar 2017 07:29:31 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.38.133 with HTTP; Thu, 2 Mar 2017 07:29:31 -0800 (PST) In-Reply-To: References: From: Alan Somers Date: Thu, 2 Mar 2017 08:29:31 -0700 X-Google-Sender-Auth: sMl9cgDCyGI7bTfkwOOmDd_nL9s Message-ID: Subject: Re: CFLAGS for certain ports To: Dimitry Andric Cc: Mingo Rrubioer , FreeBSD CURRENT Content-Type: text/plain; charset=UTF-8 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 15:29:32 -0000 On Thu, Mar 2, 2017 at 5:58 AM, 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 Actually, you can enable options on a per-port basis by creating a file named /var/db/ports/_/options. Those are the files that get created whenever you do "make config" in a port directory. It's usually easiest to create them interactively just by doing "make config" though. > > >> 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 >