unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel <guix-devel@gnu.org>
Subject: [PATCH] openblas on MIPS.
Date: Thu, 29 Oct 2015 15:50:13 +0100	[thread overview]
Message-ID: <idjoafh6862.fsf@bimsb-sys02.mdc-berlin.net> (raw)

[-- 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


             reply	other threads:[~2015-10-29 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 14:50 Ricardo Wurmus [this message]
2015-10-29 20:36 ` [PATCH] openblas on MIPS 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=idjoafh6862.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).