guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] openblas on MIPS.


From: Ricardo Wurmus
Subject: [PATCH] openblas on MIPS.
Date: Thu, 29 Oct 2015 15:50:13 +0100

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’t mean that OpenBLAS actually 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=SICORTEX 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

>From 5132d4f9a36e65439b1295c672ad41364016e6a9 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
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

>From b281c60fe666082040097c0d585e942fa5fa1550 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]