superlu_dist: support ilp64

This commit is contained in:
qbisi
2025-10-27 18:58:06 +08:00
parent ce16aebad6
commit a9281f952c
2 changed files with 32 additions and 14 deletions
@@ -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;
+16 -9
View File
@@ -15,9 +15,11 @@
parmetis,
# 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";
@@ -38,11 +40,6 @@ stdenv.mkDerivation (finalAttrs: {
./mc64ad_dist-stub.patch
];
postPatch = ''
substituteInPlace SRC/prec-independent/util.c \
--replace-fail "LargeDiag_MC64" "NOROWPERM"
'';
nativeBuildInputs = [
cmake
pkg-config
@@ -51,8 +48,10 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
mpi
blas
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,6 +72,7 @@ stdenv.mkDerivation (finalAttrs: {
(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")
@@ -85,6 +85,13 @@ stdenv.mkDerivation (finalAttrs: {
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; [