gnu: fftw: Build SIMD codelets.

* gnu/packages/algebra.scm (fftw)[arguments]: Remove 'no-native phase; use
configure cache value instead.  Add configure flags for SIMD codelets.
(fftwf)[arguments]: Add neon configuration flag for 32-bit arm.
(fftw-avx): Remove variable.
master
Eric Bavier 2018-04-06 10:53:06 -05:00 committed by Eric Bavier
parent 38039b4fa9
commit 65bb22796f
No known key found for this signature in database
GPG Key ID: FD73CAC719D32566
1 changed files with 26 additions and 37 deletions

View File

@ -531,19 +531,28 @@ a C program.")
"0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v")))) "0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:configure-flags `(#:configure-flags
'("--enable-shared" "--enable-openmp" "--enable-threads") `("--enable-shared" "--enable-openmp" "--enable-threads"
#:phases ,,@(let ((system (or (%current-target-system) (%current-system))))
(modify-phases %standard-phases ;; Enable SIMD extensions for codelets. See details at:
(add-before 'build 'no-native ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
(lambda _ (cond
;; By default '-mtune=native' is used. However, that may ((string-prefix? "x86_64" system)
;; cause the use of ISA extensions (SSE2, etc.) that are '("--enable-sse2" "--enable-avx" "--enable-avx2"
;; not necessarily available on the user's machine when "--enable-avx512" "--enable-avx-128-fma"))
;; that package is built on a different machine. ((string-prefix? "i686" system)
(substitute* (find-files "." "Makefile$") '("--enable-sse2"))
(("-mtune=native") "")) ((string-prefix? "aarch64" system)
#t))))) '("--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"))))
;; 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
;; different machine.
"ax_cv_c_flags__mtune_native=no")))
(native-inputs `(("perl" ,perl))) (native-inputs `(("perl" ,perl)))
(home-page "http://fftw.org") (home-page "http://fftw.org")
(synopsis "Computing the discrete Fourier transform") (synopsis "Computing the discrete Fourier transform")
@ -560,7 +569,10 @@ cosine/ sine transforms or DCT/DST).")
(arguments (arguments
(substitute-keyword-arguments (package-arguments fftw) (substitute-keyword-arguments (package-arguments fftw)
((#:configure-flags cf) ((#:configure-flags cf)
`(cons "--enable-float" ,cf)))) (if (string-prefix? "arm" (or (%current-target-system)
(%current-system)))
`(cons "--enable-neon" ,cf)
cf))))
(description (description
(string-append (package-description fftw) (string-append (package-description fftw)
" Single-precision version.")))) " Single-precision version."))))
@ -579,29 +591,6 @@ cosine/ sine transforms or DCT/DST).")
(string-append (package-description fftw) (string-append (package-description fftw)
" With OpenMPI parallelism support.")))) " With OpenMPI parallelism support."))))
(define-public fftw-avx
(package
(inherit fftw)
(name "fftw-avx")
(arguments
(substitute-keyword-arguments (package-arguments fftw)
((#:configure-flags flags ''())
;; Enable AVX & co. See details at:
;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
`(append '("--enable-avx" "--enable-avx2" "--enable-avx512"
"--enable-avx-128-fma")
,flags))
((#:substitutable? _ #f)
;; To run the tests, we must have a CPU that supports all these
;; extensions. Since we cannot be sure that machines in the build
;; farm support them, disable substitutes altogether.
#f)
((#:phases _)
;; Since we're not providing binaries, let '-mtune=native' through.
'%standard-phases)))
(synopsis "Computing the discrete Fourier transform (AVX2-optimized)")
(supported-systems '("x86_64-linux"))))
(define-public java-la4j (define-public java-la4j
(package (package
(name "java-la4j") (name "java-la4j")