Skip to content

Commit

Permalink
mfem: init at 4.7
Browse files Browse the repository at this point in the history
Init mfem built with optional dependencies mpi, suitesparse, mumps_par.
  • Loading branch information
qbisi committed Nov 11, 2024
1 parent c7b5a3c commit 8b277ad
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions pkgs/by-name/mf/mfem/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
gfortran,
mpi,
mpiCheckPhaseHook,
blas,
hypre,
metis,
suitesparse,
mumps_par,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mfem";
version = "4.7";

src = fetchFromGitHub {
owner = "mfem";
repo = "mfem";
rev = "v${finalAttrs.version}";
hash = "sha256-NJI8ABsfnnzMETfyscpNX8qK72BFF9FfxsY0J48aRtg=";
};

nativeBuildInputs = [
cmake
gfortran
];

buildInputs = [
mpi
blas
hypre
metis
suitesparse
mumps_par
];

cmakeFlags = [
(lib.cmakeBool "MFEM_ENABLE_TESTING" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "MFEM_USE_MPI" true)
(lib.cmakeBool "MFEM_USE_SUITESPARSE" true)
(lib.cmakeBool "MFEM_USE_MUMPS" true)
(lib.cmakeFeature "MUMPS_REQUIRED_PACKAGES" (
lib.concatStringsSep ";" (
[
"MPI"
"MPI_Fortran"
"METIS"
"ScaLAPACK"
"LAPACK"
"BLAS"
]
++ lib.optional mumps_par.withParmetis "ParMETIS"
)
))
];

doCheck = true;

nativeCheckInputs = [ mpiCheckPhaseHook ];

meta = {
description = "Free, lightweight, scalable C++ library for finite element methods";
homepage = "https://mfem.org";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ qbisi ];
platforms = lib.platforms.linux;
};
})

0 comments on commit 8b277ad

Please sign in to comment.