unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS.
@ 2015-05-19 14:14 Ricardo Wurmus
  2015-05-19 22:35 ` Mark H Weaver
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2015-05-19 14:14 UTC (permalink / raw)
  To: Guix-devel

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

Hi Guix,

it was suggested here[1] that DYNAMIC_ARCH does not work on MIPS, so the
package has be built specifically for the CPU of the build host.
Obviously, we lose substitutability in this case.

The attached patch is an attempt to disable DYNAMIC_ARCH when building
on MIPS.  (I'm not sure when %current-system is available, so I'm not
sure if the unquoting is correct.)

[1]: https://github.com/xianyi/OpenBLAS/issues/570


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-openblas-Disable-DYNAMIC_ARCH-on-MIPS.patch --]
[-- Type: text/x-patch, Size: 1847 bytes --]

From 0b1779915e4f75511281c01f2f346aa808b90c6d Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 19 May 2015 16:10:25 +0200
Subject: [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS.

* gnu/packages/maths.scm (openblas)[arguments]: Do not pass DYNAMIC_ARCH when
  building for MIPS.  Also make non-substitutable for MIPS.
---
 gnu/packages/maths.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index f27903c..8d21a82 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1037,7 +1037,11 @@ constant parts of it.")
          "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f  ;no "check" target
+     `(#:tests? #f  ;no "check" target
+       ;; DYNAMIC_ARCH is not supported on MIPS.  When it is disabled,
+       ;; OpenBLAS will tune itself to the build host, so we need to disable
+       ;; substitutions.
+       #:substitutable? ,(not (string-prefix? "mips" (%current-system)))
        #:make-flags
        (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
              "SHELL=bash"
@@ -1045,7 +1049,10 @@ constant parts of it.")
              ;; Build the library for all supported CPUs.  This allows
              ;; switching CPU targets at runtime with the environment variable
              ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
-             "DYNAMIC_ARCH=1")
+             ;; Unfortunately, this is not supported on MIPS.
+             ,@(if (string-prefix? "mips" (%current-system))
+                   (list)
+                   (list "DYNAMIC_ARCH=1")))
        ;; no configure script
        #:phases (alist-delete 'configure %standard-phases)))
     (inputs
-- 
2.1.0


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

* Re: [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS.
  2015-05-19 14:14 [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS Ricardo Wurmus
@ 2015-05-19 22:35 ` Mark H Weaver
  2015-05-20 11:55   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2015-05-19 22:35 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> it was suggested here[1] that DYNAMIC_ARCH does not work on MIPS, so the
> package has be built specifically for the CPU of the build host.
> Obviously, we lose substitutability in this case.
>
> The attached patch is an attempt to disable DYNAMIC_ARCH when building
> on MIPS.  (I'm not sure when %current-system is available, so I'm not
> sure if the unquoting is correct.)
>
> [1]: https://github.com/xianyi/OpenBLAS/issues/570
>
> From 0b1779915e4f75511281c01f2f346aa808b90c6d Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Tue, 19 May 2015 16:10:25 +0200
> Subject: [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS.
>
> * gnu/packages/maths.scm (openblas)[arguments]: Do not pass DYNAMIC_ARCH when
>   building for MIPS.  Also make non-substitutable for MIPS.
> ---
>  gnu/packages/maths.scm | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
> index f27903c..8d21a82 100644
> --- a/gnu/packages/maths.scm
> +++ b/gnu/packages/maths.scm
> @@ -1037,7 +1037,11 @@ constant parts of it.")
>           "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db"))))
>      (build-system gnu-build-system)
>      (arguments
> -     '(#:tests? #f  ;no "check" target
> +     `(#:tests? #f  ;no "check" target
> +       ;; DYNAMIC_ARCH is not supported on MIPS.  When it is disabled,
> +       ;; OpenBLAS will tune itself to the build host, so we need to disable
> +       ;; substitutions.
> +       #:substitutable? ,(not (string-prefix? "mips" (%current-system)))
>         #:make-flags
>         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
>               "SHELL=bash"
> @@ -1045,7 +1049,10 @@ constant parts of it.")
>               ;; Build the library for all supported CPUs.  This allows
>               ;; switching CPU targets at runtime with the environment variable
>               ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
> -             "DYNAMIC_ARCH=1")
> +             ;; Unfortunately, this is not supported on MIPS.
> +             ,@(if (string-prefix? "mips" (%current-system))
> +                   (list)
> +                   (list "DYNAMIC_ARCH=1")))

It would be marginally preferable to use '() and '("DYNAMIC_ARCH=1")
here.  Anyway, okay to push!

     Thanks,
       Mark

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

* Re: [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS.
  2015-05-19 22:35 ` Mark H Weaver
@ 2015-05-20 11:55   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-05-20 11:55 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Guix-devel


Mark H Weaver writes:

>> -             "DYNAMIC_ARCH=1")
>> +             ;; Unfortunately, this is not supported on MIPS.
>> +             ,@(if (string-prefix? "mips" (%current-system))
>> +                   (list)
>> +                   (list "DYNAMIC_ARCH=1")))
>
> It would be marginally preferable to use '() and '("DYNAMIC_ARCH=1")
> here.  Anyway, okay to push!

I pushed it with the suggested change.
Thanks!

~~ Ricardo

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

end of thread, other threads:[~2015-05-20 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 14:14 [PATCH] gnu: openblas: Disable DYNAMIC_ARCH on MIPS Ricardo Wurmus
2015-05-19 22:35 ` Mark H Weaver
2015-05-20 11:55   ` Ricardo Wurmus

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).