-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init mfem built with optional dependencies mpi, suitesparse, mumps_par.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
}) |