From 139ac1e9da4906a45b24d8616ed1268def3db053 Mon Sep 17 00:00:00 2001 From: qbisi Date: Thu, 17 Apr 2025 16:44:09 +0800 Subject: [PATCH 1/2] superlu_dist: add fortran support for Darwin platform --- pkgs/by-name/su/superlu_dist/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/su/superlu_dist/package.nix b/pkgs/by-name/su/superlu_dist/package.nix index a2e5677ed2ef..79324369668c 100644 --- a/pkgs/by-name/su/superlu_dist/package.nix +++ b/pkgs/by-name/su/superlu_dist/package.nix @@ -13,7 +13,7 @@ metis, parmetis, withExamples ? false, - fortranSupport ? stdenv.hostPlatform.isLinux, + fortranSupport ? true, enableOpenMP ? true, # Todo: ask for permission of unfree parmetis withParmetis ? false, @@ -69,6 +69,9 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals withParmetis [ metis parmetis + ] + ++ lib.optionals stdenv.cc.isClang [ + gfortran.cc.lib ]; propagatedBuildInputs = [ blas ]; From f13a20e645033b35f2f5bf05d6be2e20d61bb499 Mon Sep 17 00:00:00 2001 From: qbisi Date: Sat, 19 Apr 2025 18:54:30 +0800 Subject: [PATCH 2/2] superlu_dist: use pkg-config to find LAPACK CMake in Nixpkgs may mistakenly detect BLAS or the Apple SDK framework when locating the LAPACK directory. This issue can be resolved by setting BLA_PREFER_PKGCONFIG=ON. --- pkgs/by-name/su/superlu_dist/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/su/superlu_dist/package.nix b/pkgs/by-name/su/superlu_dist/package.nix index 79324369668c..2a92911d417f 100644 --- a/pkgs/by-name/su/superlu_dist/package.nix +++ b/pkgs/by-name/su/superlu_dist/package.nix @@ -5,6 +5,7 @@ fetchurl, llvmPackages, cmake, + pkg-config, gfortran, blas, lapack, @@ -52,6 +53,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake + pkg-config ] ++ lib.optionals fortranSupport [ gfortran @@ -83,6 +85,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic) (lib.cmakeBool "XSDK_ENABLE_Fortran" fortranSupport) + (lib.cmakeBool "BLA_PREFER_PKGCONFIG" true) (lib.cmakeBool "TPL_ENABLE_INTERNAL_BLASLIB" false) (lib.cmakeBool "TPL_ENABLE_LAPACKLIB" true) (lib.cmakeBool "TPL_ENABLE_PARMETISLIB" withParmetis)