diff --git a/pkgs/development/libraries/science/chemistry/cppe/default.nix b/pkgs/development/libraries/science/chemistry/cppe/default.nix index 51083e5a2ae9..9781ce780660 100644 --- a/pkgs/development/libraries/science/chemistry/cppe/default.nix +++ b/pkgs/development/libraries/science/chemistry/cppe/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, cmake }: +{ stdenv, lib, fetchFromGitHub, cmake, llvmPackages }: stdenv.mkDerivation rec { pname = "cppe"; @@ -11,7 +11,8 @@ stdenv.mkDerivation rec { sha256 = "sha256-guM7+ZWDJLcAUJtPkKLvC4LYSA2eBvER7cgwPZ7FxHw="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ]; diff --git a/pkgs/development/python-modules/cppe/default.nix b/pkgs/development/python-modules/cppe/default.nix index df00bd8dd120..52031bab74f7 100644 --- a/pkgs/development/python-modules/cppe/default.nix +++ b/pkgs/development/python-modules/cppe/default.nix @@ -1,5 +1,6 @@ { buildPythonPackage , lib +, stdenv , cmake , cppe , eigen @@ -12,6 +13,7 @@ , pandas , polarizationsolver , pytest +, llvmPackages }: buildPythonPackage rec { @@ -31,7 +33,12 @@ buildPythonPackage rec { dontUseCmakeConfigure = true; - buildInputs = [ pybind11 ]; + buildInputs = [ pybind11 ] + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + + NIX_CFLAGS_LINK = lib.optional stdenv.cc.isClang "-lomp"; + + hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow"; checkInputs = [ pytest