diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix index 3f6b028a45ac..b2189b77bf76 100644 --- a/pkgs/development/libraries/fftw/default.nix +++ b/pkgs/development/libraries/fftw/default.nix @@ -1,4 +1,15 @@ -{ fetchurl, stdenv, lib, gfortran, llvmPackages ? null, precision ? "double", perl }: +{ fetchurl +, stdenv +, lib +, gfortran +, perl +, llvmPackages ? null +, precision ? "double" +, enableAvx ? stdenv.hostPlatform.avxSupport +, enableAvx2 ? stdenv.hostPlatform.avx2Support +, enableAvx512 ? stdenv.hostPlatform.avx512Support +, enableFma ? stdenv.hostPlatform.fmaSupport +}: with lib; @@ -40,6 +51,10 @@ stdenv.mkDerivation { # all x86_64 have sse2 # however, not all float sizes fit ++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2" + ++ optional enableAvx "--enable-avx" + ++ optional enableAvx2 "--enable-avx2" + ++ optional enableAvx512 "--enable-avx512" + ++ optional enableFma "--enable-fma" ++ [ "--enable-openmp" ] # doc generation causes Fortran wrapper generation which hard-codes gcc ++ optional (!withDoc) "--disable-doc";