From 05fb9b070f5eede965f8b6e867a7ace0eef824ad Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 2 Aug 2024 17:03:23 +0200 Subject: [PATCH] mumps: init at 5.7.3 --- pkgs/by-name/mu/mumps/package.nix | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 pkgs/by-name/mu/mumps/package.nix diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix new file mode 100644 index 000000000000..978ee246084a --- /dev/null +++ b/pkgs/by-name/mu/mumps/package.nix @@ -0,0 +1,77 @@ +{ + blas, + fetchzip, + fetchpatch, + gfortran, + lapack, + lib, + metis, + scotch, + stdenv, +}: +stdenv.mkDerivation (finalAttrs: { + name = "mumps"; + version = "5.7.3"; + + src = fetchzip { + url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz"; + hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw="; + }; + + patches = [ + # Compatibility with coin-or-mumps version + (fetchpatch { + url = "https://raw.githubusercontent.com/coin-or-tools/ThirdParty-Mumps/bd0bdf9baa3f3677bd34fb36ce63b2b32cc6cc7d/mumps_mpi.patch"; + hash = "sha256-70qZUKBVBpJOSRxYxng5Y6ct1fdCUQUGur3chDhGabQ="; + }) + ]; + + postPatch = '' + # Compatibility with coin-or-mumps version + # https://github.com/coin-or-tools/ThirdParty-Mumps/blob/stable/3.0/get.Mumps#L66 + cp libseq/mpi.h libseq/mumps_mpi.h + ''; + + configurePhase = '' + cp Make.inc/Makefile.debian.SEQ ./Makefile.inc + ''; + + makeFlags = + lib.optionals stdenv.isDarwin [ + "SONAME=" + "LIBEXT_SHARED=.dylib" + ] + ++ [ + "LSCOTCHDIR=${scotch}/lib" + "ISCOTCH=-I${scotch}/include" + "LMETISDIR=${metis}/lib" + "IMETIS=-I${metis}/include" + "allshared" + ]; + + installPhase = '' + mkdir $out + cp -r include lib $out + + # Add some compatibility with coin-or-mumps + ln -s $out/include $out/include/mumps + cp libseq/mumps_mpi.h $out/include + ''; + + nativeBuildInputs = [ gfortran ]; + + buildInputs = [ + blas + lapack + metis + scotch + ]; + + meta = { + description = "MUltifrontal Massively Parallel sparse direct Solver"; + homepage = "http://mumps-solver.org/"; + license = lib.licenses.cecill-c; + maintainers = with lib.maintainers; [ nim65s ]; + broken = stdenv.isDarwin; + }; +})