12 stdenv.mkDerivation (finalAttrs: {
17 url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz";
18 hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw=";
22 # Compatibility with coin-or-mumps version
24 url = "https://raw.githubusercontent.com/coin-or-tools/ThirdParty-Mumps/bd0bdf9baa3f3677bd34fb36ce63b2b32cc6cc7d/mumps_mpi.patch";
25 hash = "sha256-70qZUKBVBpJOSRxYxng5Y6ct1fdCUQUGur3chDhGabQ=";
31 # Compatibility with coin-or-mumps version
32 # https://github.com/coin-or-tools/ThirdParty-Mumps/blob/stable/3.0/get.Mumps#L66
33 cp libseq/mpi.h libseq/mumps_mpi.h
35 + lib.optionalString stdenv.hostPlatform.isDarwin ''
36 substituteInPlace src/Makefile --replace-fail \
37 "-Wl,\''$(SONAME),libmumps_common" \
38 "-Wl,-install_name,$out/lib/libmumps_common"
42 cp Make.inc/Makefile.debian.SEQ ./Makefile.inc
46 lib.optionals stdenv.hostPlatform.isDarwin [
48 "LIBEXT_SHARED=.dylib"
51 "LSCOTCHDIR=${scotch}/lib"
52 "ISCOTCH=-I${scotch.dev}/include"
53 "LMETISDIR=${metis}/lib"
54 "IMETIS=-I${metis}/include"
60 cp -r include lib $out
62 # Add some compatibility with coin-or-mumps
63 ln -s $out/include $out/include/mumps
64 cp libseq/mumps_mpi.h $out/include
67 nativeBuildInputs = [ gfortran ];
76 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
78 -change libmpiseq.dylib \
79 $out/lib/libmpiseq.dylib \
80 -change libpord.dylib \
81 $out/lib/libpord.dylib \
82 $out/lib/libmumps_common.dylib
84 -change libmpiseq.dylib \
85 $out/lib/libmpiseq.dylib \
86 -change libpord.dylib \
87 $out/lib/libpord.dylib \
89 $out/lib/libcmumps.dylib \
90 $out/lib/libcmumps.dylib
92 -change libmpiseq.dylib \
93 $out/lib/libmpiseq.dylib \
94 -change libpord.dylib \
95 $out/lib/libpord.dylib \
97 $out/lib/libdmumps.dylib \
98 $out/lib/libdmumps.dylib
100 -change libmpiseq.dylib \
101 $out/lib/libmpiseq.dylib \
102 -change libpord.dylib \
103 $out/lib/libpord.dylib \
105 $out/lib/libsmumps.dylib \
106 $out/lib/libsmumps.dylib
108 -change libmpiseq.dylib \
109 $out/lib/libmpiseq.dylib \
110 -change libpord.dylib \
111 $out/lib/libpord.dylib \
113 $out/lib/libzmumps.dylib \
114 $out/lib/libzmumps.dylib
117 $out/lib/libmpiseq.dylib \
118 $out/lib/libmpiseq.dylib
121 $out/lib/libpord.dylib \
122 $out/lib/libpord.dylib
126 description = "MUltifrontal Massively Parallel sparse direct Solver";
127 homepage = "http://mumps-solver.org/";
128 license = lib.licenses.cecill-c;
129 maintainers = with lib.maintainers; [ nim65s ];