From a72367ae315765a89c9667948b6961e0d80dfd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Tue, 11 Feb 2020 11:53:54 +0100 Subject: [PATCH] fftw: Re-enable OpenMP with non-GCC and musl. Clang now supports OpenMP, and musl has no problem with it either. Related to #7023 and #34645. See also #79818. --- pkgs/development/libraries/fftw/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix index c9577436c300..fcbcde745380 100644 --- a/pkgs/development/libraries/fftw/default.nix +++ b/pkgs/development/libraries/fftw/default.nix @@ -1,7 +1,8 @@ -{ fetchurl, stdenv, lib, precision ? "double", perl }: +{ fetchurl, stdenv, lib, llvmPackages ? null, precision ? "double", perl }: with lib; +assert stdenv.cc.isClang -> llvmPackages != null; assert elem precision [ "single" "double" "long-double" "quad-precision" ]; let @@ -24,6 +25,11 @@ stdenv.mkDerivation { ++ optional withDoc "info"; # it's dev-doc only outputBin = "dev"; # fftw-wisdom + buildInputs = lib.optionals stdenv.cc.isClang [ + # TODO: This may mismatch the LLVM version sin the stdenv, see #79818. + llvmPackages.openmp + ]; + configureFlags = [ "--enable-shared" "--enable-threads" @@ -32,7 +38,7 @@ stdenv.mkDerivation { # all x86_64 have sse2 # however, not all float sizes fit ++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2" - ++ optional (stdenv.cc.isGNU && !stdenv.hostPlatform.isMusl) "--enable-openmp" + ++ [ "--enable-openmp" ] # doc generation causes Fortran wrapper generation which hard-codes gcc ++ optional (!withDoc) "--disable-doc";