From 69d5909e032e2fba57814ea9db52389d384d9341 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 8 May 2018 18:28:38 -0400 Subject: [PATCH] gnu: fftw: Fix configure flags for armhf, aarch64, and mips. This is a followup to commit 65bb22796f854cbc3eae053a80b1d64365dad376. * gnu/packages/algebra.scm (fftw)[arguments]: In the configure-flags, avoid two-layer quasiquotation by changing the inner quasiquote to a normal quote. Remove "--enable-armv7a-cntvct" on 32-bit ARM, and "--enable-armv8-cntvct-el0" on 64-bit ARM, since these generate instructions that are not normally available from user mode. Remove "--enable-mips-zbus-timer" on MIPS, since the needed hardware support may not be available. Add a default case to the conditional to support unrecognized targets. (fftwf)[arguments]: Restore the "--enable-single" flag, which was present prior to commit 65bb22796. --- gnu/packages/algebra.scm | 48 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 7cf086cec8..a794c4c6a8 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Andreas Enge ;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès ;;; Copyright © 2016, 2017, 2018 Nicolas Goaziou -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2018 Mark H Weaver ;;; Copyright © 2016, 2018 Ricardo Wurmus ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice @@ -532,22 +532,22 @@ a C program.") (build-system gnu-build-system) (arguments `(#:configure-flags - `("--enable-shared" "--enable-openmp" "--enable-threads" - ,,@(let ((system (or (%current-target-system) (%current-system)))) - ;; Enable SIMD extensions for codelets. See details at: - ;; . - (cond - ((string-prefix? "x86_64" system) - '("--enable-sse2" "--enable-avx" "--enable-avx2" - "--enable-avx512" "--enable-avx-128-fma")) - ((string-prefix? "i686" system) - '("--enable-sse2")) - ((string-prefix? "aarch64" system) - '("--enable-neon" "--enable-armv8-cntvct-el0")) - ((string-prefix? "arm" system) ;neon only for single-precision - '("--enable-armv7a-cntvct")) ;on 32-bit arm - ((string-prefix? "mips" system) - '("--enable-mips-zbus-timer")))) + '("--enable-shared" "--enable-openmp" "--enable-threads" + ,@(let ((system (or (%current-target-system) (%current-system)))) + ;; Enable SIMD extensions for codelets. See details at: + ;; . + (cond + ((string-prefix? "x86_64" system) + '("--enable-sse2" "--enable-avx" "--enable-avx2" + "--enable-avx512" "--enable-avx-128-fma")) + ((string-prefix? "i686" system) + '("--enable-sse2")) + ((string-prefix? "aarch64" system) + ;; Note that fftw supports NEON on 32-bit ARM only when + ;; compiled for single-precision. + '("--enable-neon")) + (else + '()))) ;; By default '-mtune=native' is used. However, that may cause the ;; use of ISA extensions (e.g. AVX) that are not necessarily ;; available on the user's machine when that package is built on a @@ -568,11 +568,15 @@ cosine/ sine transforms or DCT/DST).") (name "fftwf") (arguments (substitute-keyword-arguments (package-arguments fftw) - ((#:configure-flags cf) - (if (string-prefix? "arm" (or (%current-target-system) - (%current-system))) - `(cons "--enable-neon" ,cf) - cf)))) + ((#:configure-flags fftw-configure-flags) + `(cons* "--enable-single" + ,@(if (string-prefix? "arm" (or (%current-target-system) + (%current-system))) + ;; fftw supports NEON on 32-bit ARM only when compiled + ;; for single-precision, so add it here. + '("--enable-neon") + '()) + ,fftw-configure-flags)))) (description (string-append (package-description fftw) " Single-precision version."))))