scotch: make ptscotch optional

This commit is contained in:
qbisi
2025-09-28 01:19:21 +08:00
parent 190975084d
commit 0f237f6a34
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -20,6 +20,7 @@
assert withParmetis -> mpiSupport;
assert withPtScotch -> mpiSupport;
let
scotch' = scotch.override { inherit withPtScotch; };
profile = if mpiSupport then "debian.PAR" else "debian.SEQ";
LMETIS = toString ([ "-lmetis" ] ++ lib.optional withParmetis "-lparmetis");
LSCOTCH = toString (
@@ -78,7 +79,7 @@ stdenv.mkDerivation (finalAttrs: {
"LIBEXT_SHARED=.dylib"
]
++ [
"ISCOTCH=-I${lib.getDev scotch}/include"
"ISCOTCH=-I${lib.getDev scotch'}/include"
"LMETIS=${LMETIS}"
"LSCOTCH=${LSCOTCH}"
"ORDERINGSF=${ORDERINGSF}"
@@ -115,7 +116,7 @@ stdenv.mkDerivation (finalAttrs: {
blas
lapack
metis
scotch
scotch'
];
doInstallCheck = true;
+3 -1
View File
@@ -10,6 +10,7 @@
xz,
zlib,
mpi,
withPtScotch ? false,
testers,
}:
@@ -33,6 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "BUILD_PTSCOTCH" withPtScotch)
];
nativeBuildInputs = [
@@ -48,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
zlib
];
propagatedBuildInputs = [
propagatedBuildInputs = lib.optionals withPtScotch [
mpi
];