Skip to content

Commit 31fe2eb

Browse files
authored
python312Pacakges.fenics-dolfinx: init at 0.9.0.post1 (#404613)
2 parents d53a0ca + 2bbc507 commit 31fe2eb

File tree

7 files changed

+431
-1
lines changed

7 files changed

+431
-1
lines changed

pkgs/by-name/ad/adios2/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: {
7171
bzip2
7272
lz4
7373
c-blosc2
74-
hdf5-mpi
74+
(hdf5-mpi.override { inherit mpi; })
7575
libfabric
7676
libpng
7777
libsodium
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
cmake,
6+
pkg-config,
7+
spdlog,
8+
pugixml,
9+
boost,
10+
petsc,
11+
slepc,
12+
kahip,
13+
adios2,
14+
python3Packages,
15+
catch2_3,
16+
withParmetis ? false,
17+
}:
18+
let
19+
dolfinxPackages = petsc.petscPackages.overrideScope (
20+
final: prev: {
21+
slepc = final.callPackage slepc.override { };
22+
adios2 = final.callPackage adios2.override { };
23+
kahip = final.callPackage kahip.override { };
24+
}
25+
);
26+
in
27+
stdenv.mkDerivation (finalAttrs: {
28+
version = "0.9.0.post1";
29+
pname = "dolfinx";
30+
31+
src = fetchFromGitHub {
32+
owner = "fenics";
33+
repo = "dolfinx";
34+
tag = "v${finalAttrs.version}";
35+
hash = "sha256-4IIx7vUZeDwOGVdyC2PBvfhVjrmGZeVQKAwgDYScbY0=";
36+
};
37+
38+
preConfigure = ''
39+
cd cpp
40+
'';
41+
42+
nativeBuildInputs = [
43+
cmake
44+
pkg-config
45+
];
46+
47+
buildInputs = [
48+
dolfinxPackages.kahip
49+
dolfinxPackages.scotch
50+
] ++ lib.optional withParmetis dolfinxPackages.parmetis;
51+
52+
propagatedBuildInputs = [
53+
spdlog
54+
pugixml
55+
boost
56+
petsc
57+
dolfinxPackages.hdf5
58+
dolfinxPackages.slepc
59+
dolfinxPackages.adios2
60+
python3Packages.fenics-basix
61+
python3Packages.fenics-ffcx
62+
];
63+
64+
cmakeFlags = [
65+
(lib.cmakeBool "DOLFINX_ENABLE_ADIOS2" true)
66+
(lib.cmakeBool "DOLFINX_ENABLE_PETSC" true)
67+
(lib.cmakeBool "DOLFIN_ENABLE_PARMETIS" withParmetis)
68+
(lib.cmakeBool "DOLFINX_ENABLE_SCOTCH" true)
69+
(lib.cmakeBool "DOLFINX_ENABLE_SLEPC" true)
70+
(lib.cmakeBool "DOLFINX_ENABLE_KAHIP" true)
71+
(lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin")
72+
(lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
73+
(lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include")
74+
];
75+
76+
passthru.tests = {
77+
unittests = stdenv.mkDerivation {
78+
pname = "${finalAttrs.pname}-unittests";
79+
inherit (finalAttrs) version src;
80+
81+
preConfigure = ''
82+
cd cpp/test
83+
'';
84+
85+
nativeBuildInputs = [
86+
cmake
87+
pkg-config
88+
];
89+
90+
buildInputs = [ finalAttrs.finalPackage ];
91+
92+
nativeCheckInputs = [ catch2_3 ];
93+
94+
doCheck = true;
95+
96+
installPhase = ''
97+
touch $out
98+
'';
99+
};
100+
};
101+
102+
meta = {
103+
homepage = "https://fenicsproject.org";
104+
downloadPage = "https://github.com/fenics/dolfinx";
105+
description = "Computational environment of FEniCSx and implements the FEniCS Problem Solving Environment in C++ and Python";
106+
changelog = "https://github.com/fenics/dolfinx/releases/tag/${finalAttrs.src.tag}";
107+
license = with lib.licenses; [
108+
bsd2
109+
lgpl3Plus
110+
];
111+
platforms = lib.platforms.unix;
112+
maintainers = with lib.maintainers; [ qbisi ];
113+
};
114+
})

pkgs/by-name/pe/petsc/package.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ let
7878
petscPackages = lib.makeScope newScope (self: {
7979
inherit
8080
mpi
81+
python3
82+
python3Packages
8183
# global override options
8284
mpiSupport
8385
fortranSupport
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
scikit-build-core,
6+
nanobind,
7+
cmake,
8+
ninja,
9+
pkg-config,
10+
blas,
11+
lapack,
12+
numpy,
13+
sympy,
14+
scipy,
15+
matplotlib,
16+
fenics-ufl,
17+
pytest-xdist,
18+
pytestCheckHook,
19+
}:
20+
21+
buildPythonPackage rec {
22+
pname = "fenics-basix";
23+
version = "0.9.0";
24+
pyproject = true;
25+
26+
src = fetchFromGitHub {
27+
owner = "fenics";
28+
repo = "basix";
29+
tag = "v${version}";
30+
hash = "sha256-jLQMDt6zdl+oixd5Qevn4bvxBsXpTNcbH2Os6TC9sRQ=";
31+
};
32+
33+
dontUseCmakeConfigure = true;
34+
35+
build-system = [
36+
scikit-build-core
37+
nanobind
38+
];
39+
40+
nativeBuildInputs = [
41+
cmake
42+
ninja
43+
pkg-config
44+
];
45+
46+
dependencies = [
47+
numpy
48+
];
49+
50+
buildInputs = [
51+
blas
52+
lapack
53+
];
54+
55+
# Prefer finding BLAS and LAPACK via pkg-config.
56+
# Avoid using the Accelerate.framework from the Darwin SDK.
57+
# Also, avoid mistaking BLAS for LAPACK.
58+
env.CMAKE_ARGS = lib.cmakeBool "BLA_PREFER_PKGCONFIG" true;
59+
60+
pythonImportsCheck = [
61+
"basix"
62+
];
63+
64+
nativeCheckInputs = [
65+
sympy
66+
scipy
67+
matplotlib
68+
fenics-ufl
69+
pytest-xdist
70+
pytestCheckHook
71+
];
72+
73+
meta = {
74+
homepage = "https://fenicsproject.org";
75+
downloadPage = "https://github.com/fenics/basix";
76+
description = "Finite element definition and tabulation runtime library";
77+
changelog = "https://github.com/fenics/basix/releases/tag/${src.tag}";
78+
license = lib.licenses.mit;
79+
maintainers = with lib.maintainers; [ qbisi ];
80+
};
81+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
lib,
3+
stdenv,
4+
toPythonModule,
5+
fetchFromGitHub,
6+
buildPythonPackage,
7+
8+
# build-system
9+
scikit-build-core,
10+
nanobind,
11+
12+
# nativeBuildInputs
13+
cmake,
14+
ninja,
15+
pkg-config,
16+
17+
# buildInputs
18+
dolfinx,
19+
20+
# dependency
21+
numpy,
22+
cffi,
23+
mpi4py,
24+
petsc4py,
25+
slepc4py,
26+
adios2,
27+
kahip,
28+
fenics-ffcx,
29+
fenics-basix,
30+
fenics-ufl,
31+
32+
# nativeCheckInputs
33+
scipy,
34+
matplotlib,
35+
pytest-xdist,
36+
pytestCheckHook,
37+
writableTmpDirAsHomeHook,
38+
mpiCheckPhaseHook,
39+
40+
# custom options
41+
withParmetis ? false,
42+
43+
# passthru.tests
44+
fenics-dolfinx,
45+
mpich,
46+
}:
47+
48+
let
49+
fenicsPackages = petsc4py.petscPackages.overrideScope (
50+
final: prev: {
51+
slepc = final.callPackage slepc4py.override { };
52+
adios2 = final.callPackage adios2.override { };
53+
kahip = final.callPackage kahip.override { };
54+
dolfinx = final.callPackage dolfinx.override { inherit withParmetis; };
55+
}
56+
);
57+
in
58+
buildPythonPackage rec {
59+
inherit (dolfinx)
60+
version
61+
src
62+
;
63+
pname = "fenics-dolfinx";
64+
pyproject = true;
65+
66+
pythonRelaxDeps = [
67+
"cffi"
68+
"fenics-ufl"
69+
];
70+
71+
preConfigure = ''
72+
cd python
73+
'';
74+
75+
dontUseCmakeConfigure = true;
76+
77+
build-system = [
78+
scikit-build-core
79+
nanobind
80+
];
81+
82+
nativeBuildInputs = [
83+
cmake
84+
ninja
85+
pkg-config
86+
fenicsPackages.mpi
87+
];
88+
89+
buildInputs = [
90+
fenicsPackages.dolfinx
91+
];
92+
93+
dependencies = [
94+
numpy
95+
cffi
96+
fenics-basix
97+
fenics-ffcx
98+
fenics-ufl
99+
petsc4py
100+
fenicsPackages.slepc
101+
fenicsPackages.adios2
102+
fenicsPackages.kahip
103+
(mpi4py.override { inherit (fenicsPackages) mpi; })
104+
];
105+
106+
doCheck = true;
107+
108+
nativeCheckInputs = [
109+
scipy
110+
matplotlib
111+
pytest-xdist
112+
pytestCheckHook
113+
writableTmpDirAsHomeHook
114+
mpiCheckPhaseHook
115+
];
116+
117+
preCheck = ''
118+
rm -rf dolfinx
119+
'';
120+
121+
pythonImportsCheck = [
122+
"dolfinx"
123+
];
124+
125+
disabledTests = [
126+
# require cffi<1.17
127+
"test_cffi_expression"
128+
"test_hexahedron_mesh"
129+
];
130+
131+
passthru = {
132+
tests =
133+
{
134+
complex = fenics-dolfinx.override {
135+
petsc4py = petsc4py.override { scalarType = "complex"; };
136+
};
137+
}
138+
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
139+
mpich = fenics-dolfinx.override {
140+
petsc4py = petsc4py.override { mpi = mpich; };
141+
};
142+
};
143+
};
144+
145+
meta = {
146+
homepage = "https://fenicsproject.org";
147+
downloadPage = "https://github.com/fenics/dolfinx";
148+
description = "Computational environment of FEniCSx and implements the FEniCS Problem Solving Environment in C++ and Python";
149+
changelog = "https://github.com/fenics/dolfinx/releases/tag/${src.tag}";
150+
license = with lib.licenses; [
151+
bsd2
152+
lgpl3Plus
153+
];
154+
platforms = lib.platforms.unix;
155+
maintainers = with lib.maintainers; [ qbisi ];
156+
};
157+
}

0 commit comments

Comments
 (0)