From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] openblas on MIPS. Date: Thu, 29 Oct 2015 15:50:13 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroX6-00020K-5m for guix-devel@gnu.org; Thu, 29 Oct 2015 10:50:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZroX2-0006Uq-0t for guix-devel@gnu.org; Thu, 29 Oct 2015 10:50:28 -0400 Received: from sinope.bbbm.mdc-berlin.de ([141.80.25.23]:35008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroX1-0006Tw-JS for guix-devel@gnu.org; Thu, 29 Oct 2015 10:50:23 -0400 Received: from localhost (localhost [127.0.0.1]) by sinope.bbbm.mdc-berlin.de (Postfix) with ESMTP id D47C2280418 for ; Thu, 29 Oct 2015 15:50:20 +0100 (CET) Received: from sinope.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (sinope.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zGyLu-9cVs-b for ; Thu, 29 Oct 2015 15:50:14 +0100 (CET) Received: from HTCAONE.mdc-berlin.net (mab.citx.mdc-berlin.de [141.80.36.102]) by sinope.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Thu, 29 Oct 2015 15:50:14 +0100 (CET) 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Guix, I tried building OpenBLAS on one of the MIPS build slaves and it went through the build phase without errors when I set the TARGET to SICORTEX. Unfortunately, this doesn=E2=80=99t mean that OpenBLAS actuall= y works on MIPS: one of the tests fails. Meanwhile OpenBLAS version 0.2.15 was released and I just updated our package. It may well be that this bug has already been fixed by the new release. At any rate, I think the two attached patches (one to pass TARGET=3DSICORTEX on MIPS; another to enable substitutes for MIPS) are an improvement. We can use substitutes for MIPS (and ARM for that matter) only when TARGET is specified. The only MIPS target that seems to work for us appears to be SICORTEX as the other supported targets use Loongson extensions. ~~ Ricardo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-gnu-openblas-Set-TARGET-to-SICORTEX-on-MIPS.patch" >From 5132d4f9a36e65439b1295c672ad41364016e6a9 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 29 Oct 2015 15:42:09 +0100 Subject: [PATCH 1/2] gnu: openblas: Set TARGET to SICORTEX on MIPS. * gnu/packages/maths.scm (openblas)[arguments]: Add "TARGET=SICORTEX" to make-flags when building for MIPS. --- gnu/packages/maths.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index cbefb09..b5abc48 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1491,15 +1491,16 @@ constant parts of it.") ;; Unfortunately, this is not supported on non-x86 architectures, ;; where it leads to failed builds. ,@(let ((system (or (%current-target-system) (%current-system)))) - (if (or (string-prefix? "x86_64" system) + (cond + ((or (string-prefix? "x86_64" system) (string-prefix? "i686" system)) - '("DYNAMIC_ARCH=1") - ;; On MIPS we force the SICORTEX TARGET, as for the other - ;; two available MIPS targets special Loongson extended - ;; instructions are used. - (if (string-prefix? "mips" (%current-system)) - '("TARGET=SICORTEX") - '())))) + '("DYNAMIC_ARCH=1")) + ;; On MIPS we force the "SICORTEX" TARGET, as for the other + ;; two available MIPS targets special extended instructions + ;; for Loongson cores are used. + ((string-prefix? "mips" system) + '("TARGET=SICORTEX")) + (else '())))) ;; no configure script #:phases (alist-delete 'configure %standard-phases))) (inputs -- 2.1.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0002-gnu-openblas-Make-substitutable-on-MIPS.patch" >From b281c60fe666082040097c0d585e942fa5fa1550 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 29 Oct 2015 15:43:21 +0100 Subject: [PATCH 2/2] gnu: openblas: Make substitutable on MIPS. * gnu/packages/maths.scm (openblas)[arguments]: Make package substitutable when the system is MIPS. --- gnu/packages/maths.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index b5abc48..b4b930d 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1474,13 +1474,14 @@ constant parts of it.") (build-system gnu-build-system) (arguments `(#:tests? #f ;no "check" target - ;; DYNAMIC_ARCH is only supported on x86. When it is disabled, - ;; OpenBLAS will tune itself to the build host, so we need to disable - ;; substitutions. + ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no + ;; TARGET is specified, OpenBLAS will tune itself to the build host, so + ;; we need to disable substitutions. #:substitutable? ,(let ((system (or (%current-target-system) (%current-system)))) (or (string-prefix? "x86_64" system) - (string-prefix? "i686" system))) + (string-prefix? "i686" system) + (string-prefix? "mips" system))) #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) "SHELL=bash" -- 2.1.0 --=-=-=--