scotch: install *metis.h to subdirectory

SCOTCH has compatibility headers/libraries for the
MeTiS/ParMeTiS interface. However, the header files
"metis.h" and "parmetis.h" might cause conflict with
exsiting metis/parmetis packages. Hence move them to
subdirectory.
This commit is contained in:
qbisi
2025-09-28 01:19:21 +08:00
parent 0f237f6a34
commit c1601a2afa
2 changed files with 20 additions and 10 deletions
+8 -10
View File
@@ -108,16 +108,14 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional mpiSupport mpi
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
# Parmetis should be placed before scotch to avoid conflict of header file "parmetis.h"
buildInputs =
lib.optional withParmetis parmetis
++ lib.optional mpiSupport scalapack
++ [
blas
lapack
metis
scotch'
];
buildInputs = [
blas
lapack
metis
scotch'
]
++ lib.optional mpiSupport scalapack
++ lib.optional withParmetis parmetis;
doInstallCheck = true;
+12
View File
@@ -35,6 +35,10 @@ stdenv.mkDerivation (finalAttrs: {
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "BUILD_PTSCOTCH" withPtScotch)
# Prefix Scotch version of MeTiS routines
(lib.cmakeBool "SCOTCH_METIS_PREFIX" true)
# building tests is broken with SCOTCH_METIS_PREFIX enabled in 7.0.9
(lib.cmakeBool "ENABLE_TESTS" false)
];
nativeBuildInputs = [
@@ -63,6 +67,14 @@ stdenv.mkDerivation (finalAttrs: {
};
};
# SCOTCH provide compatibility with Metis/Parmetis interface.
# We install the metis compatible headers to subdirectory to
# avoid conflict with metis/parmetis.
postFixup = ''
mkdir -p $dev/include/scotch
mv $dev/include/{*metis,metisf}.h $dev/include/scotch
'';
meta = {
description = "Graph and mesh/hypergraph partitioning, graph clustering, and sparse matrix ordering";
longDescription = ''