fftw: fix build with __structuredAttrs, enable strictDeps (#470289)
This commit is contained in:
@@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"https://fftw.org/fftw-${finalAttrs.version}.tar.gz"
|
||||
"ftp://ftp.fftw.org/pub/fftw/fftw-${finalAttrs.version}.tar.gz"
|
||||
];
|
||||
sha256 = "sha256-VskyVJhSzdz6/as4ILAgDHdCZ1vpIXnlnmIVs0DiZGc=";
|
||||
hash = "sha256-VskyVJhSzdz6/as4ILAgDHdCZ1vpIXnlnmIVs0DiZGc=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -66,9 +66,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional (precision != "double") "--enable-${precision}"
|
||||
# https://www.fftw.org/fftw3_doc/SIMD-alignment-and-fftw_005fmalloc.html
|
||||
# FFTW will try to detect at runtime whether the CPU supports these extensions
|
||||
++ lib.optional (
|
||||
stdenv.hostPlatform.isx86_64 && (precision == "single" || precision == "double")
|
||||
) "--enable-sse2 --enable-avx --enable-avx2 --enable-avx512 --enable-avx128-fma"
|
||||
++
|
||||
lib.optionals (stdenv.hostPlatform.isx86_64 && (precision == "single" || precision == "double"))
|
||||
[
|
||||
"--enable-sse2"
|
||||
"--enable-avx"
|
||||
"--enable-avx2"
|
||||
"--enable-avx512"
|
||||
"--enable-avx128-fma"
|
||||
]
|
||||
++ lib.optionals enableMpi [
|
||||
"--enable-mpi"
|
||||
# link libfftw3_mpi explicitly with -lmpi
|
||||
@@ -83,15 +89,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
# fftw builds with -mtune=native by default
|
||||
postPatch = ''
|
||||
substituteInPlace configure --replace "-mtune=native" "-mtune=generic"
|
||||
substituteInPlace configure --replace-fail "-mtune=native" "-mtune=generic"
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeCheckInputs = [ perl ];
|
||||
|
||||
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
description = "Fastest Fourier Transform in the West library";
|
||||
homepage = "https://www.fftw.org/";
|
||||
|
||||
Reference in New Issue
Block a user