scotch: sort build inputs; make ptscotch optional (#446322)
This commit is contained in:
@@ -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 (
|
||||
@@ -47,7 +48,7 @@ let
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "mumps";
|
||||
pname = "mumps";
|
||||
version = "5.8.1";
|
||||
# makeFlags contain space and one should use makeFlagsArray+
|
||||
# Setting this magic var is an optional solution
|
||||
@@ -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}"
|
||||
@@ -107,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;
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
# External libraries options
|
||||
withHdf5 ? withCommonDeps,
|
||||
withMetis ? withCommonDeps,
|
||||
withZlib ? (withP4est || withPtscotch),
|
||||
withZlib ? (withP4est || withPtScotch),
|
||||
withScalapack ? withCommonDeps && mpiSupport,
|
||||
withParmetis ? withFullDeps, # parmetis is unfree
|
||||
withPtscotch ? withCommonDeps && mpiSupport,
|
||||
withPtScotch ? withCommonDeps && mpiSupport,
|
||||
withMumps ? withCommonDeps,
|
||||
withP4est ? withFullDeps,
|
||||
withHypre ? withCommonDeps && mpiSupport,
|
||||
@@ -67,7 +67,7 @@ assert withP4est -> (mpiSupport && withZlib);
|
||||
# Package parmetis depend on metis and mpi support
|
||||
assert withParmetis -> (withMetis && mpiSupport);
|
||||
|
||||
assert withPtscotch -> (mpiSupport && withZlib);
|
||||
assert withPtScotch -> (mpiSupport && withZlib);
|
||||
assert withScalapack -> mpiSupport;
|
||||
assert (withMumps && mpiSupport) -> withScalapack;
|
||||
assert withHypre -> mpiSupport;
|
||||
@@ -83,6 +83,7 @@ let
|
||||
fortranSupport
|
||||
pythonSupport
|
||||
precision
|
||||
withPtScotch
|
||||
;
|
||||
enableMpi = self.mpiSupport;
|
||||
|
||||
@@ -139,7 +140,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional withP4est petscPackages.p4est
|
||||
++ lib.optional withMetis petscPackages.metis
|
||||
++ lib.optional withParmetis petscPackages.parmetis
|
||||
++ lib.optional withPtscotch petscPackages.scotch
|
||||
++ lib.optional withPtScotch petscPackages.scotch
|
||||
++ lib.optional withScalapack petscPackages.scalapack
|
||||
++ lib.optional withMumps petscPackages.mumps
|
||||
++ lib.optional withHypre petscPackages.hypre
|
||||
@@ -184,7 +185,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional pythonSupport "--with-petsc4py=1"
|
||||
++ lib.optional withMetis "--with-metis=1"
|
||||
++ lib.optional withParmetis "--with-parmetis=1"
|
||||
++ lib.optional withPtscotch "--with-ptscotch=1"
|
||||
++ lib.optional withPtScotch "--with-ptscotch=1"
|
||||
++ lib.optional withScalapack "--with-scalapack=1"
|
||||
++ lib.optional withMumps "--with-mumps=1"
|
||||
++ lib.optional (withMumps && !mpiSupport) "--with-mumps-serial=1"
|
||||
@@ -197,11 +198,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optional withFftw "--with-fftw=1"
|
||||
++ lib.optional withSuitesparse "--with-suitesparse=1";
|
||||
|
||||
hardeningDisable = lib.optionals debug [
|
||||
"fortify"
|
||||
"fortify3"
|
||||
];
|
||||
|
||||
installTargets = [ (if withExamples then "install" else "install-lib") ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
bison,
|
||||
bzip2,
|
||||
cmake,
|
||||
fetchFromGitLab,
|
||||
flex,
|
||||
gfortran,
|
||||
lib,
|
||||
mpi,
|
||||
stdenv,
|
||||
zlib,
|
||||
fetchFromGitLab,
|
||||
cmake,
|
||||
gfortran,
|
||||
bison,
|
||||
flex,
|
||||
bzip2,
|
||||
xz,
|
||||
zlib,
|
||||
mpi,
|
||||
withPtScotch ? false,
|
||||
testers,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -30,22 +32,49 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"out"
|
||||
];
|
||||
|
||||
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
||||
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 = [
|
||||
cmake
|
||||
gfortran
|
||||
bison
|
||||
flex
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
bison
|
||||
bzip2
|
||||
mpi
|
||||
flex
|
||||
xz
|
||||
zlib
|
||||
];
|
||||
|
||||
propagatedBuildInputs = lib.optionals withPtScotch [
|
||||
mpi
|
||||
];
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
cmake-config = testers.hasCmakeConfigModules {
|
||||
moduleNames = [ "SCOTCH" ];
|
||||
package = finalAttrs.finalPackage;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# 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 = ''
|
||||
@@ -54,6 +83,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
homepage = "http://www.labri.fr/perso/pelegrin/scotch";
|
||||
license = lib.licenses.cecill-c;
|
||||
maintainers = [ lib.maintainers.bzizou ];
|
||||
maintainers = with lib.maintainers; [
|
||||
bzizou
|
||||
qbisi
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user