all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] openblas on MIPS.
@ 2015-10-29 14:50 Ricardo Wurmus
  2015-10-29 20:36 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2015-10-29 14:50 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-openblas-Set-TARGET-to-SICORTEX-on-MIPS.patch --]
[-- Type: text/x-patch, Size: 1918 bytes --]

From 5132d4f9a36e65439b1295c672ad41364016e6a9 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-openblas-Make-substitutable-on-MIPS.patch --]
[-- Type: text/x-patch, Size: 1508 bytes --]

From b281c60fe666082040097c0d585e942fa5fa1550 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-30 16:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 14:50 [PATCH] openblas on MIPS Ricardo Wurmus
2015-10-29 20:36 ` Ludovic Courtès
2015-10-29 21:57   ` Ricardo Wurmus
2015-10-30 12:43   ` Ricardo Wurmus
2015-10-30 16:45     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.