Unverified Commit f957af6d authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

superlu_dist: 9.1.0 -> 9.2.0 (#456119)

parents fdeea097 a9281f95
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ stdenv.mkDerivation {
    hash = "sha256-L9SLyr7XuBUniMH3JtaBrUHIGzVTF5pr014xovQf2cI=";
  };

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace-fail "cmake_minimum_required(VERSION 2.8)" "cmake_minimum_required(VERSION 3.10)"
  '';

  nativeBuildInputs = [ cmake ];
  enableParallelBuilding = true;
  buildInputs = [
+16 −5
Original line number Diff line number Diff line
@@ -13,19 +13,30 @@ mc64ad_dist.c was removed (DFSG nonfree), create stubs
+
+/* only mc64id_dist and mc64ad_dist are referenced by SuperLU-Dist code */
+
+/* Subroutine */ int_t mc64id_dist(int_t *icntl)
+/* Subroutine */ int mc64id_dist(int *icntl)
+{
+    fprintf(stderr, "SuperLU-Dist: MC64 functionality not available.\n(It uses code under a non-free HSL licence which does not permit redistribution).\nAborting mc64id_dist.\n");
+    abort();
+    return 0;
+}
+
+int_t mc64ad_dist(int_t *job, int_t *n, int_t *ne, int_t *
+	ip, int_t *irn, double *a, int_t *num, int_t *cperm,
+	int_t *liw, int_t *iw, int_t *ldw, double *dw, int_t *
+	icntl, int_t *info)
+int mc64ad_dist(int *job, int *n, int_t *ne, int_t *
+	ip, int_t *irn, double *a, int *num, int_t *cperm,
+	int_t *liw, int_t *iw, int_t *ldw, double *dw, int *
+	icntl, int *info)
+{
+    fprintf(stderr, "SuperLU-Dist: MC64 functionality not available.\n(It uses code under a non-free HSL licence which does not permit redistribution).\nAborting mc64ad_dist.\n");
+    abort();
+    return 0;
+}
--- a/SRC/prec-independent/util.c
+++ b/SRC/prec-independent/util.c
@@ -217,7 +217,7 @@ void set_default_options_dist(superlu_dist_options_t *options)
 #else
     options->ColPerm = MMD_AT_PLUS_A;
 #endif
-    options->RowPerm = LargeDiag_MC64;
+    options->RowPerm = NOROWPERM;
     options->ReplaceTinyPivot = NO;
     options->IterRefine = SLU_DOUBLE;
     options->Trans = NOTRANS;
 No newline at end of file
+34 −39
Original line number Diff line number Diff line
@@ -13,18 +13,17 @@
  mpiCheckPhaseHook,
  metis,
  parmetis,
  withExamples ? false,
  fortranSupport ? true,
  enableOpenMP ? true,
  # Todo: ask for permission of unfree parmetis
  withParmetis ? false,
}:
  isILP64 ? false,

assert (!blas.isILP64) && (!lapack.isILP64);
  # passthru.tests
  superlu_dist,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "superlu_dist";
  version = "9.1.0";
  version = "9.2.0";

  __structuredAttrs = true;

@@ -34,38 +33,25 @@ stdenv.mkDerivation (finalAttrs: {
    tag = "v${finalAttrs.version}";
    # Remove non‐free files.
    postFetch = "rm $out/SRC/prec-independent/mc64ad_dist.c";
    hash = "sha256-NMAEtTmTY189p8BlmsTugwMuxKZh+Bs1GyuwUHkLA1U=";
    hash = "sha256-i/Gg+9oMNNRlviwXUSRkWNaLRZLPWZRtA1fGYqh2X0k=";
  };

  patches = [
    ./mc64ad_dist-stub.patch
    (fetchurl {
      url = "https://github.com/xiaoyeli/superlu_dist/commit/8ef3f7fda091529d7e7f16087864fee66c4834c9.patch";
      hash = "sha256-kCSqojYKpk75m+FwhS0hXHSybm+GZzOYikePcf2U3Fw=";
    })
  ];

  postPatch = ''
    substituteInPlace SRC/prec-independent/util.c \
      --replace-fail "LargeDiag_MC64" "NOROWPERM"
  '';

  nativeBuildInputs = [
    cmake
    pkg-config
  ]
  ++ lib.optionals fortranSupport [
    gfortran
  ];

  buildInputs =
    lib.optionals (enableOpenMP && stdenv.cc.isClang) [
      # cmake can not find mpi if openmp is placed after mpi
      llvmPackages.openmp
    ]
    ++ [
  buildInputs = [
    mpi
      lapack
    # always build with lp64 BLAS/LAPACK.
    # see https://github.com/xiaoyeli/superlu_dist/issues/132#issuecomment-2323093701
    (blas.override { isILP64 = false; })
    (lapack.override { isILP64 = false; })
  ]
  ++ lib.optionals withParmetis [
    metis
@@ -73,20 +59,20 @@ stdenv.mkDerivation (finalAttrs: {
  ]
  ++ lib.optionals stdenv.cc.isClang [
    gfortran.cc.lib
    llvmPackages.openmp
  ];

  propagatedBuildInputs = [ blas ];

  cmakeFlags = [
    (lib.cmakeBool "enable_examples" withExamples)
    (lib.cmakeBool "enable_openmp" enableOpenMP)
    (lib.cmakeBool "enable_examples" false)
    (lib.cmakeBool "enable_openmp" true)
    (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
    (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
    (lib.cmakeBool "XSDK_ENABLE_Fortran" fortranSupport)
    (lib.cmakeBool "XSDK_ENABLE_Fortran" true)
    (lib.cmakeBool "BLA_PREFER_PKGCONFIG" true)
    (lib.cmakeBool "TPL_ENABLE_INTERNAL_BLASLIB" false)
    (lib.cmakeBool "TPL_ENABLE_LAPACKLIB" true)
    (lib.cmakeBool "TPL_ENABLE_PARMETISLIB" withParmetis)
    (lib.cmakeFeature "XSDK_INDEX_SIZE" (if isILP64 then "64" else "32"))
  ]
  ++ lib.optionals withParmetis [
    (lib.cmakeFeature "TPL_PARMETIS_LIBRARIES" "-lmetis -lparmetis")
@@ -95,8 +81,17 @@ stdenv.mkDerivation (finalAttrs: {

  doCheck = true;

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [ mpiCheckPhaseHook ];

  passthru = {
    inherit isILP64;
    tests = {
      ilp64 = superlu_dist.override { isILP64 = true; };
    };
  };

  meta = {
    homepage = "https://portal.nersc.gov/project/sparse/superlu/";
    license = with lib.licenses; [