From 0b2160ea3cbdfa033401a5716ad094b9d76aeacf Mon Sep 17 00:00:00 2001 From: qbisi Date: Tue, 4 Feb 2025 20:14:57 +0800 Subject: [PATCH] petsc: add scalapack and mumps support --- pkgs/by-name/pe/petsc/package.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/pe/petsc/package.nix b/pkgs/by-name/pe/petsc/package.nix index 2c29bfd2129a..6a13227e4031 100644 --- a/pkgs/by-name/pe/petsc/package.nix +++ b/pkgs/by-name/pe/petsc/package.nix @@ -19,6 +19,10 @@ withParmetis ? false, scotch, withPtscotch ? false, + scalapack, + withScalapack ? false, + mumps_par, + withMumps ? false, pkg-config, p4est, zlib, # propagated by p4est but required by petsc @@ -34,6 +38,8 @@ assert petsc-withp4est -> p4est.mpiSupport; assert withParmetis -> (withMetis && mpiSupport); assert withPtscotch -> mpiSupport; +assert withScalapack -> mpiSupport; +assert withMumps -> withScalapack; stdenv.mkDerivation rec { pname = "petsc"; @@ -59,7 +65,9 @@ stdenv.mkDerivation rec { ++ lib.optional petsc-withp4est p4est ++ lib.optional withMetis metis ++ lib.optional withParmetis parmetis - ++ lib.optional withPtscotch scotch; + ++ lib.optional withPtscotch scotch + ++ lib.optional withScalapack scalapack + ++ lib.optional withMumps mumps_par; postPatch = '' @@ -96,6 +104,14 @@ stdenv.mkDerivation rec { "--with-ptscotch-include=${scotch.dev}/include" "--with-ptscotch-lib=[-L${scotch}/lib,-lptscotch,-lptesmumps,-lptscotchparmetisv3,-lptscotcherr,-lesmumps,-lscotch,-lscotcherr]" ] + ++ lib.optionals withScalapack [ + "--with-scalapack=1" + "--with-scalapack-dir=${scalapack}" + ] + ++ lib.optionals withMumps [ + "--with-mumps=1" + "--with-mumps-dir=${mumps_par}" + ] ++ lib.optionals petsc-withp4est [ "--with-p4est=1" "--with-zlib-include=${zlib.dev}/include"