Commit c9997c4e authored by qbisi's avatar qbisi
Browse files

mumps: remove unnecessary patch from coin-or-mumps

The coin-or project ipopt use a thirdparty-mumps, this variant renames `libseq/mpi.h`
to `libseq/mumps_mpi.h` to avoid conflicts when building in a MPI environment.
See https://github.com/coin-or/Ipopt/blob/stable/3.14/ChangeLog.md?plain=1#L582.
Nix packagers don't need to worry about this cause we build in a sandbox environment.
For parrallel version of mumps built with mpi support, libseq is not needed and there will be no conflicts.
parent 66d928e8
Loading
Loading
Loading
Loading
+6 −20
Original line number Diff line number Diff line
@@ -18,21 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
    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
    ''
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace src/Makefile --replace-fail \
      "-Wl,\''$(SONAME),libmumps_common" \
      "-Wl,-install_name,$out/lib/libmumps_common"
@@ -63,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {

    # Add some compatibility with coin-or-mumps
    ln -s $out/include $out/include/mumps
    cp libseq/mumps_mpi.h $out/include
    cp libseq/mpi.h $out/include/mumps_mpi.h
  '';

  nativeBuildInputs = [ gfortran ];