Unverified Commit c2401037 authored by natsukium's avatar natsukium Committed by Luna Nova
Browse files

metis: 5.1.0 -> 5.2.1



Co-authored-by: default avatarLuna <git@lunnova.dev>
parent 47fec804
Loading
Loading
Loading
Loading
+31 −16
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  unzip,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  gklib,
  llvmPackages,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "metis";
  version = "5.1.0";
  version = "5.2.1";

  src = fetchurl {
    url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-${version}.tar.gz";
    sha256 = "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn";
  src = fetchFromGitHub {
    owner = "KarypisLab";
    repo = "METIS";
    tag = "v${finalAttrs.version}";
    hash = "sha256-eddLR6DvZ+2LeR0DkknN6zzRvnW+hLN2qeI+ETUPcac=";
  };

  cmakeFlags = [
    "-DGKLIB_PATH=../GKlib"
    # remove once updated past https://github.com/KarypisLab/METIS/commit/521a2c360dc21ace5c4feb6dc0b7992433e3cb0f
    "-DCMAKE_SKIP_BUILD_RPATH=ON"
  patches = [
    # fix gklib link error
    (fetchpatch {
      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/metis/files/metis-5.2.1-add-gklib-as-required.patch?id=c78ecbd3fdf9b33e307023baf0de12c4448dd283";
      hash = "sha256-uoXMi6pMs5VrzUmjsLlQYFLob1A8NAt9CbFi8qhQXVQ=";
    })
  ];
  nativeBuildInputs = [
    unzip
    cmake

  nativeBuildInputs = [ cmake ];

  buildInputs = [ gklib ] ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;

  preConfigure = ''
    make config
  '';

  cmakeFlags = [
    (lib.cmakeBool "OPENMP" true)
    (lib.cmakeBool "SHARED" (!stdenv.hostPlatform.isStatic))
  ];

  meta = {
    description = "Serial graph partitioning and fill-reducing matrix ordering";
    homepage = "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview";
    homepage = "https://github.com/KarypisLab/METIS";
    license = lib.licenses.asl20;
    platforms = lib.platforms.all;
  };
}
})