From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: [PATCH] gnu: openblas: Fix configure flags on armhf and take target Date: Thu, 1 Oct 2015 10:46:13 +0200 Message-ID: <20151001084613.GA6497@debian> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="d6Gm4EdcadzBjdND" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhZVQ-0008Kn-BN for guix-devel@gnu.org; Thu, 01 Oct 2015 04:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhZVM-0004X9-9n for guix-devel@gnu.org; Thu, 01 Oct 2015 04:46:24 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:63938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhZVM-0004Wv-2R for guix-devel@gnu.org; Thu, 01 Oct 2015 04:46:20 -0400 Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-openblas-Fix-configure-flags-on-armhf-and-take-t.patch" >From 8802c118fed2c93ee60d90a5cc883c1c3328d531 Mon Sep 17 00:00:00 2001 From: Andreas Enge 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=, 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 --d6Gm4EdcadzBjdND--