Installation
DOLFINx can be installed using various packages managers, run using containers, or built manually from source.
Binaries
See the README.md for recommendations and instructions.
Source
Installation of DOLFINx requires installation of the C++ core. Most users will also want the Python interface.
An example of how to build DOLFINx and its dependencies can be found in our RedHat Dockerfile and RedHat GitHub Actions workflow for a minimal set of tested steps that can be adapted to suit most Unix-like systems.
Dependencies
C++ core
The C++ core can be installed without Python as a dependency.
Required
C++ compiler (supporting the C++20 standard)
Boost, with the following compiled Boost components
timer
CMake [build dependency]
HDF5 (with MPI support enabled)
MPI supporting MPI standard version 3 or above.
UFCx [
ufcx.h
, provided by FFCx package or FFCx UFCx CMake install atffcx/cmake/*
]
From ParMETIS, KaHIP or PT-SCOTCH, ParMETIS is recommended.
Optional
Optional for demos
FFCx
PETSc and FFCx are optional but still recommended.
Python interface
Below are additional requirements for the Python interface to the C++ core.
Required
Python
Python cffi (https://cffi.readthedocs.io/)
FFCx, UFL and Basix Python interface.
mpi4py (https://mpi4py.readthedocs.io/)
nanobind (https://github.com/wjakob/nanobind)
NumPy (https://www.numpy.org)
scikit-build-core[pyproject] (https://scikit-build-core.readthedocs.io)
Optional
petsc4py (recommended)
Optional for demos
Numba
pyamg
pyvista (for plotting)
slepc4py
Building and installing
C++ core
The C++ core is built using CMake. Create a build directory in cpp/
,
e.g. mkdir -p build/
and in the build run directory:
cmake ../
make install
To set the installation prefix:
cmake -DCMAKE_INSTALL_PREFIX=<my-install-path> ../
make install
Python
After installation of the C++ core, from the python/
directory the
Python interface can be installed using:
pip install -r build-requirements.txt
pip install --check-build-dependencies --no-build-isolation .
Footnotes