3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

gnu: fftw: Fix configure flags for armhf, aarch64, and mips.

This is a followup to commit 65bb22796f.

* 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.
This commit is contained in:
Mark H Weaver 2018-05-08 18:28:38 -04:00
parent d6ac4d42ba
commit 69d5909e03
No known key found for this signature in database
GPG key ID: 7CEF29847562C516

View file

@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
@ -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:
;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
(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:
;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
(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."))))