From 6e276fd5e3881fee11b852f631d9ae7d31f9e4ea Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 21 Dec 2024 05:49:23 -0800 Subject: [PATCH] superlu: fix darwin The update from 5.2.1 -> 7.0.0 causes superlu segfaults running the tests when linked with Accelerate due to superlu using the single precision interface. Set the Blas vendor to Generic to prevent cmake from using Accelerate and use the nixpkgs provided blas/lapack libraries. --- pkgs/by-name/su/superlu/package.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/su/superlu/package.nix b/pkgs/by-name/su/superlu/package.nix index c0877e7150b43..4487dedf7e08e 100644 --- a/pkgs/by-name/su/superlu/package.nix +++ b/pkgs/by-name/su/superlu/package.nix @@ -45,10 +45,16 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ blas ]; - cmakeFlags = [ - (lib.cmakeBool "BUILD_SHARED_LIBS" true) - (lib.cmakeBool "enable_fortran" true) - ]; + cmakeFlags = + [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "enable_fortran" true) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # prevent cmake from using Accelerate, which causes tests to segfault + # https://github.com/xiaoyeli/superlu/issues/155 + "-DBLA_VENDOR=Generic" + ]; doCheck = true;