From: Andreas Enge <andreas@enge.fr>
To: guix-devel@gnu.org
Subject: [PATCH] gnu: openblas: Fix configure flags on armhf and take target
Date: Thu, 1 Oct 2015 10:46:13 +0200 [thread overview]
Message-ID: <20151001084613.GA6497@debian> (raw)
[-- Attachment #1: Type: text/plain, Size: 293 bytes --]
The attached patch fixes the build of openblas (on which 48 packages depend
according to "guix refresh -l") on armhf. Quick comments would be welcome.
In particular, did I correctly handle the target system for cross building?
My impression was that the previous code had a problem.
Andreas
[-- Attachment #2: 0001-gnu-openblas-Fix-configure-flags-on-armhf-and-take-t.patch --]
[-- Type: text/plain, Size: 2462 bytes --]
From 8802c118fed2c93ee60d90a5cc883c1c3328d531 Mon Sep 17 00:00:00 2001
From: Andreas Enge <privat@xobs-novena>
Date: Thu, 1 Oct 2015 10:32:29 +0200
Subject: [PATCH] gnu: openblas: Fix configure flags on armhf and take target
system into account for cross building.
* gnu/packages/maths.scm (openblas)[arguments]: Make package substitutable
and enable runtime cpu detection only on x86 systems. Take the target
system into account when cross compiling.
---
gnu/packages/maths.scm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 45fda14..d67f7fa 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1474,10 +1474,13 @@ constant parts of it.")
(build-system gnu-build-system)
(arguments
`(#:tests? #f ;no "check" target
- ;; DYNAMIC_ARCH is not supported on MIPS. When it is disabled,
+ ;; 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.
- #:substitutable? ,(not (string-prefix? "mips" (%current-system)))
+ #:substitutable?
+ ,(let ((system (or (%current-target-system) (%current-system))))
+ (or (string-prefix? "x86_64" system)
+ (string-prefix? "i686" system)))
#:make-flags
(list (string-append "PREFIX=" (assoc-ref %outputs "out"))
"SHELL=bash"
@@ -1485,10 +1488,13 @@ 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.
- ;; Unfortunately, this is not supported on MIPS.
- ,@(if (string-prefix? "mips" (%current-system))
- '()
- '("DYNAMIC_ARCH=1")))
+ ;; 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)
+ (string-prefix? "i686" system))
+ '("DYNAMIC_ARCH=1")
+ '())))
;; no configure script
#:phases (alist-delete 'configure %standard-phases)))
(inputs
--
2.5.0
next reply other threads:[~2015-10-01 8:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 8:46 Andreas Enge [this message]
2015-10-01 13:25 ` [PATCH] gnu: openblas: Fix configure flags on armhf and take target Ludovic Courtès
2015-10-01 17:36 ` Andreas Enge
2015-10-01 16:59 ` Mark H Weaver
2015-10-01 20:50 ` Ludovic Courtès
2015-10-02 18:01 ` Andreas Enge
2015-10-13 6:20 ` Ricardo Wurmus
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=20151001084613.GA6497@debian \
--to=andreas@enge.fr \
--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).