Skip to content

Commit

Permalink
fftw: Re-enable OpenMP with non-GCC and musl.
Browse files Browse the repository at this point in the history
Clang now supports OpenMP, and musl has no problem with it either.

Related to NixOS#7023 and NixOS#34645.

See also NixOS#79818.
  • Loading branch information
nh2 committed Feb 11, 2020
1 parent 19ff097 commit a72367a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkgs/development/libraries/fftw/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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";

Expand Down

0 comments on commit a72367a

Please sign in to comment.