From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: Re: Optionally using more advanced CPU features Date: Sat, 26 Aug 2017 11:39:41 +0800 Message-ID: <19eb4906-44d1-723b-94ba-9ab86dfbedf5@uq.edu.au> References: <87inhhw1ms.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------F4AE19DA500EAF3A86CE7642" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlRwy-00045y-8n for guix-devel@gnu.org; Fri, 25 Aug 2017 23:39:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlRwv-0002hS-51 for guix-devel@gnu.org; Fri, 25 Aug 2017 23:39:56 -0400 Received: from mailhub2.soe.uq.edu.au ([130.102.132.209]:53756 helo=newmailhub.uq.edu.au) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlRwu-0002gf-IZ for guix-devel@gnu.org; Fri, 25 Aug 2017 23:39:53 -0400 In-Reply-To: <87inhhw1ms.fsf@elephly.net> Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus , guix-devel This is a multi-part message in MIME format. --------------F4AE19DA500EAF3A86CE7642 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by newmailhub.uq.edu.au id v7Q3dhFQ021446 Hi, On 21/08/17 22:23, Ricardo Wurmus wrote: > Hi Guix, > > I was wondering how we should go about optionally building software for > more advanced CPU features. Currently, we build software for the lowes= t > common feature set among x86_64 CPUs. That=E2=80=99s good for portabil= ity, but > not so good for performance. In many cases we can set the --with-arch flag when configuring GCC, so=20 that packages built with that GCC are optimised for that architecture by=20 default. We have discussed this in the past,=20 (https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00005.html)=20 but as you say individual packages sometimes need individual attention. Anyway, to move forward I created a repo so that package recipes can be=20 modified to use a GCC that has been optimised for a particular=20 architecture. I put it out there so that it is more than just a patch on=20 this ML, but I'd be happy to incorporate it into Guix proper if that is=20 desired. https://github.com/wwood/cpu-specific-guix For instance, to build DIAMOND optimised for sandybridge: GUILE_LOAD_PATH=3D/path/to/cpu-specific-guix:$GUILE_LOAD_PATH\ |guix buil= d -e '(begin (use-modules (cpu-specific-guix) (gnu packages=20 bioinformatics))\ (cpu-specific-package diamond "sandybridge"))'| HTH, ben --------------F4AE19DA500EAF3A86CE7642 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by newmailhub.uq.edu.au id v7Q3dhFQ021446

Hi,


On 21/08/17 22:23, Ricardo Wurmus wrote:
Hi Guix,

I was wondering how we should go about optionally building software for
more advanced CPU features.  Currently, we build software for the lowest
common feature set among x86_64 CPUs.  That=E2=80=99s good for portabilit=
y, but
not so good for performance.
In many cases we can set the --with-arch flag when configuring GCC, so that packages built with that GCC are optimised for that architecture by default.

We have discussed this in the past, (https://lists.gnu.org/archive= /html/guix-devel/2016-10/msg00005.html) but as you say individual packages sometimes need individual attention.

Anyway, to move forward I created a repo so that package recipes can be modified to use a GCC that has been optimised for a particular architecture. I put it out there so that it is more than just a patch on this ML, but I'd be happy to incorporate it into Guix proper if that is desired.
https://github.com/wwood/cpu-specific-guix

For instance, to build DIAMOND optimised for sandybridge:

GUILE_LOAD_PATH=3D/path/to/cpu-specific-guix:$GUILE_LOAD_PATH\
  guix build -e '(begin (use-modules (cpu-specific-guix) (gn=
u packages bioinformatics))\
  (cpu-specific-package diamond "sandybridge"))'


HTH, ben --------------F4AE19DA500EAF3A86CE7642--