From 835481c663bcdf9538974e435fb6cf5bfb2a1144 Mon Sep 17 00:00:00 2001 From: qbisi Date: Fri, 6 Jun 2025 02:41:01 +0800 Subject: [PATCH 1/4] mumps: 5.7.3 -> 5.8.0 --- pkgs/by-name/mu/mumps/package.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index fb2fbc92ccd3..1b79186b4724 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -46,14 +46,14 @@ let in stdenv.mkDerivation (finalAttrs: { name = "mumps"; - version = "5.7.3"; + version = "5.8.0"; # makeFlags contain space and one should use makeFlagsArray+ # Setting this magic var is an optional solution __structuredAttrs = true; src = fetchzip { url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz"; - hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw="; + hash = "sha256-opJW7+Z/YhyUFwYTTTuWZuykz8Z4do6/XTBThHyTVCs="; }; postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -74,7 +74,7 @@ stdenv.mkDerivation (finalAttrs: { "LIBEXT_SHARED=.dylib" ] ++ [ - "ISCOTCH=-I${scotch.dev}/include" + "ISCOTCH=-I${lib.getDev scotch}/include" "LMETIS=${LMETIS}" "LSCOTCH=${LSCOTCH}" "ORDERINGSF=${ORDERINGSF}" @@ -114,9 +114,12 @@ stdenv.mkDerivation (finalAttrs: { ]; doInstallCheck = true; + nativeInstallCheckInputs = lib.optional mpiSupport mpiCheckPhaseHook; + installCheckPhase = '' runHook preInstallCheck + ${lib.optionalString stdenv.hostPlatform.isDarwin "export DYLD_LIBRARY_PATH=$out/lib\n"} ${lib.optionalString mpiSupport "export MPIRUN='mpirun -n 2'\n"} cd examples @@ -131,6 +134,7 @@ stdenv.mkDerivation (finalAttrs: { $MPIRUN ./csimpletest_save_restore Date: Fri, 6 Jun 2025 02:41:29 +0800 Subject: [PATCH 2/4] mumps: sort inputs order --- pkgs/by-name/mu/mumps/package.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index 1b79186b4724..83a2b3c0aaf8 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -1,19 +1,19 @@ { - blas, + lib, + stdenv, fetchzip, gfortran, + fixDarwinDylibNames, + blas, lapack, - lib, + scalapack, + scotch, metis, parmetis, - withParmetis ? false, # default to false due to unfree license - scotch, - withPtScotch ? mpiSupport, - stdenv, - fixDarwinDylibNames, - mpiSupport ? false, mpiCheckPhaseHook, - scalapack, + mpiSupport ? false, + withParmetis ? false, # default to false due to unfree license + withPtScotch ? mpiSupport, }: assert withParmetis -> mpiSupport; assert withPtScotch -> mpiSupport; From 1d751b390079bd01efb6bc93ac9483e6f2081641 Mon Sep 17 00:00:00 2001 From: qbisi Date: Fri, 6 Jun 2025 02:47:17 +0800 Subject: [PATCH 3/4] mumps: use strictDeps --- pkgs/by-name/mu/mumps/package.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index 83a2b3c0aaf8..88aa4f0f3d1c 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchzip, + mpi, gfortran, fixDarwinDylibNames, blas, @@ -51,6 +52,8 @@ stdenv.mkDerivation (finalAttrs: { # Setting this magic var is an optional solution __structuredAttrs = true; + strictDeps = true; + src = fetchzip { url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz"; hash = "sha256-opJW7+Z/YhyUFwYTTTuWZuykz8Z4do6/XTBThHyTVCs="; @@ -98,9 +101,12 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/include/mumps_seq/mpi.h $out/include/mumps_mpi.h ''; - nativeBuildInputs = [ - gfortran - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = + [ + gfortran + ] + ++ lib.optional mpiSupport mpi + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; # Parmetis should be placed before scotch to avoid conflict of header file "parmetis.h" buildInputs = From abf4471761389186445db0d0dfcfc9051a20973a Mon Sep 17 00:00:00 2001 From: qbisi Date: Fri, 6 Jun 2025 03:31:26 +0800 Subject: [PATCH 4/4] mumps: allow static build --- pkgs/by-name/mu/mumps/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index 88aa4f0f3d1c..9d613b4b057d 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -12,6 +12,7 @@ metis, parmetis, mpiCheckPhaseHook, + static ? stdenv.hostPlatform.isStatic, mpiSupport ? false, withParmetis ? false, # default to false due to unfree license withPtScotch ? mpiSupport, @@ -85,7 +86,7 @@ stdenv.mkDerivation (finalAttrs: { "OPTC=-O3" "OPTL=-O3" "SCALAP=-lscalapack" - "allshared" + "${if static then "all" else "allshared"}" ]; installPhase =