From 134e0f3bc8cbed258ffa94b484cf57ae6b9cf25c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 22 Jul 2015 14:14:52 -0400 Subject: [PATCH] gnu: openblas: Force SICORTEX target for MIPS. * gnu/packages/patches/openblas-makefile-tests.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/maths.scm (openblas)[source]: Add patch. [arguments]: Replace #:tests? #f with #:test-target "tests". Remove #:substitutable?. Add "TARGET=SICORTEX" to make-flags on MIPS. Co-Authored-By: Ricardo Wurmus --- gnu-system.am | 1 + gnu/packages/maths.scm | 15 ++++++----- gnu/packages/patches/openblas-makefile-tests.patch | 30 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/openblas-makefile-tests.patch diff --git a/gnu-system.am b/gnu-system.am index 539a72a..c5f82b7 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -556,6 +556,7 @@ dist_patch_DATA = \ gnu/packages/patches/nvi-assume-preserve-path.patch \ gnu/packages/patches/nvi-dbpagesize-binpower.patch \ gnu/packages/patches/nvi-db4.patch \ + gnu/packages/patches/openblas-makefile-tests.patch \ gnu/packages/patches/openexr-missing-samples.patch \ gnu/packages/patches/openssl-runpath.patch \ gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 2fc3ce1..dec2b93 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1470,14 +1470,11 @@ constant parts of it.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db")))) + "0av3pd96j8rx5i65f652xv9wqfkaqn0w4ma1gvbyz73i6j2hi9db")) + (patches (list (search-patch "openblas-makefile-tests.patch"))))) (build-system gnu-build-system) (arguments - `(#: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))) + `(#:test-target "tests" #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) "SHELL=bash" @@ -1486,8 +1483,12 @@ constant parts of it.") ;; 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. + + ;; 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"))) ;; no configure script #:phases (alist-delete 'configure %standard-phases))) diff --git a/gnu/packages/patches/openblas-makefile-tests.patch b/gnu/packages/patches/openblas-makefile-tests.patch new file mode 100644 index 0000000..3217601 --- /dev/null +++ b/gnu/packages/patches/openblas-makefile-tests.patch @@ -0,0 +1,30 @@ +Fix Makefile to run tests even when TARGET is set. +Also, do not run tests until we ask for them. + +--- xianyi-OpenBLAS-2b0d8a8/Makefile.orig 2015-03-24 16:07:07.000000000 -0400 ++++ xianyi-OpenBLAS-2b0d8a8/Makefile 2015-07-22 14:06:47.955139133 -0400 +@@ -25,7 +25,7 @@ + .PHONY : all libs netlib test ctest shared install + .NOTPARALLEL : all libs prof lapack-test install blas-test + +-all :: libs netlib tests shared ++all :: libs netlib shared + @echo + @echo " OpenBLAS build complete. ($(LIB_COMPONENTS))" + @echo +@@ -110,7 +110,6 @@ + + tests : + ifndef NOFORTRAN +-ifndef TARGET + ifndef CROSS + touch $(LIBNAME) + ifndef NO_FBLAS +@@ -124,7 +123,6 @@ + endif + endif + endif +-endif + + libs : + ifeq ($(CORE), UNKOWN) -- 2.4.3