From owner-freebsd-ports@freebsd.org Tue Feb 21 18:21:07 2017 Return-Path: Delivered-To: freebsd-ports@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 35CCACE8CF8 for ; Tue, 21 Feb 2017 18:21:07 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D810133C for ; Tue, 21 Feb 2017 18:21:07 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v1LIKwIn097858 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 10:20:59 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v1LIKwJu097857; Tue, 21 Feb 2017 10:20:58 -0800 (PST) (envelope-from sgk) Date: Tue, 21 Feb 2017 10:20:58 -0800 From: Steve Kargl To: Anton Shterenlikht Cc: freebsd-ports@freebsd.org Subject: Re: help build mpich with gcc6 Message-ID: <20170221182058.GA97785@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <201702211815.v1LIFgAr099942@mech-as222.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702211815.v1LIFgAr099942@mech-as222.men.bris.ac.uk> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 18:21:07 -0000 On Tue, Feb 21, 2017 at 10:15:42AM -0800, Anton Shterenlikht wrote: > >From mexas Tue Feb 21 15:00:10 2017 > >To: freebsd-ports@freebsd.org > >Subject: help build mpich with gcc6 > >Reply-To: mexas@bris.ac.uk > > > >I added > > > >USE_GCC= 6+ > > > >to net/mpich/Makefile > > > >but it seems this affected only the C and C++ parts: > > > >$ mpichversion > >*skip* > > > >MPICH CC: gcc6 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc6 -fno-strict-aliasing > >MPICH CXX: g++6 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc6 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc6 > >MPICH F77: gfortran49 -O -Wl,-rpath=/usr/local/lib/gcc49 > >MPICH FC: gfortran49 -Wl,-rpath=/usr/local/lib/gcc49 > > > >The Fortran parts remained at lang/gcc level. > > > >What settings shall I use to make Fortran components > >built with gfortran6 instead? > > > > I moved one step further. > With > > DEFAULT_VERSIONS=gcc=6 > > in /etc/make.conf > > I get: > > MPICH CC: cc -O2 -pipe -fstack-protector -fno-strict-aliasing > MPICH CXX: c++ -O2 -pipe -fstack-protector -fno-strict-aliasing > MPICH F77: gfortran6 -O -Wl,-rpath=/usr/local/lib/gcc6 > MPICH FC: gfortran6 -Wl,-rpath=/usr/local/lib/gcc6 > That's what I use along with FFLAGS+= -O2 -pipe -march=bdver2 -mtune=bdver2 FFLAGS+= -funroll-loops --param max-unroll-times=4 -ftree-vectorize in /etc/make.conf. You'll, of course, want to set -march and -mtune to your hardware or set them to native. -- Steve 20161221 https://www.youtube.com/watch?v=IbCHE-hONow