chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / mu / mumps / package.nix
blob7d0e3e154cb4fd225ea55196f53c1a4a672915ee
2   blas,
3   fetchzip,
4   fetchpatch,
5   gfortran,
6   lapack,
7   lib,
8   metis,
9   scotch,
10   stdenv,
12 stdenv.mkDerivation (finalAttrs: {
13   name = "mumps";
14   version = "5.7.3";
16   src = fetchzip {
17     url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz";
18     hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw=";
19   };
21   patches = [
22     # Compatibility with coin-or-mumps version
23     (fetchpatch {
24       url = "https://raw.githubusercontent.com/coin-or-tools/ThirdParty-Mumps/bd0bdf9baa3f3677bd34fb36ce63b2b32cc6cc7d/mumps_mpi.patch";
25       hash = "sha256-70qZUKBVBpJOSRxYxng5Y6ct1fdCUQUGur3chDhGabQ=";
26     })
27   ];
29   postPatch =
30     ''
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
34     ''
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"
39     '';
41   configurePhase = ''
42     cp Make.inc/Makefile.debian.SEQ ./Makefile.inc
43   '';
45   makeFlags =
46     lib.optionals stdenv.hostPlatform.isDarwin [
47       "SONAME="
48       "LIBEXT_SHARED=.dylib"
49     ]
50     ++ [
51       "LSCOTCHDIR=${scotch}/lib"
52       "ISCOTCH=-I${scotch.dev}/include"
53       "LMETISDIR=${metis}/lib"
54       "IMETIS=-I${metis}/include"
55       "allshared"
56     ];
58   installPhase = ''
59     mkdir $out
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
65   '';
67   nativeBuildInputs = [ gfortran ];
69   buildInputs = [
70     blas
71     lapack
72     metis
73     scotch
74   ];
76   preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
77     install_name_tool \
78       -change    libmpiseq.dylib \
79         $out/lib/libmpiseq.dylib \
80       -change    libpord.dylib \
81         $out/lib/libpord.dylib \
82         $out/lib/libmumps_common.dylib
83     install_name_tool \
84       -change    libmpiseq.dylib \
85         $out/lib/libmpiseq.dylib \
86       -change    libpord.dylib \
87         $out/lib/libpord.dylib \
88       -id \
89         $out/lib/libcmumps.dylib \
90         $out/lib/libcmumps.dylib
91     install_name_tool \
92       -change    libmpiseq.dylib \
93         $out/lib/libmpiseq.dylib \
94       -change    libpord.dylib \
95         $out/lib/libpord.dylib \
96       -id \
97         $out/lib/libdmumps.dylib \
98         $out/lib/libdmumps.dylib
99     install_name_tool \
100       -change    libmpiseq.dylib \
101         $out/lib/libmpiseq.dylib \
102       -change    libpord.dylib \
103         $out/lib/libpord.dylib \
104       -id \
105         $out/lib/libsmumps.dylib \
106         $out/lib/libsmumps.dylib
107     install_name_tool \
108       -change    libmpiseq.dylib \
109         $out/lib/libmpiseq.dylib \
110       -change    libpord.dylib \
111         $out/lib/libpord.dylib \
112       -id \
113         $out/lib/libzmumps.dylib \
114         $out/lib/libzmumps.dylib
115     install_name_tool \
116       -id \
117         $out/lib/libmpiseq.dylib \
118         $out/lib/libmpiseq.dylib
119     install_name_tool \
120       -id \
121         $out/lib/libpord.dylib \
122         $out/lib/libpord.dylib
123   '';
125   meta = {
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 ];
130   };