Installation

Contents

Installation#

The package is partly written in C++ and relies on dolfinx. Users are encouraged to install scifem with pip in an environment where dolfinx is already installed or with conda.

pip#

To install the package with pip run

python3 -m pip install scifem --no-build-isolation

To install the development version you can run

python3 -m pip install --no-build-isolation git+https://github.com/scientificcomputing/scifem.git

Note that you should pass the flag --no-build-isolation to pip to avoid issues with the build environment, such as incompatible versions of nanobind.

spack#

The spack package manager is the recommended way to install scifem, and especially on HPC systems. For information about the package see: spack-package: py-scifem First, clone the spack repository and enable spack

git clone --depth=2 https://github.com/spack/spack.git
# For bash/zsh/sh
. spack/share/spack/setup-env.sh

# For tcsh/csh
source spack/share/spack/setup-env.csh

# For fish
. spack/share/spack/setup-env.fish

Next create an environment:

spack env create scifem_env
spack env activate scifem_env

Find the compilers on the system

spack compiler find

and install the relevant packages

spack add py-scifem+petsc+hdf5+biomed+adios2 ^mpich ^petsc+mumps+hypre ^py-fenics-dolfinx+petsc4py
spack concretize
spack install

Finally, note that spack needs some packages already installed on your system. On a clean ubuntu container for example one needs to install the following packages before running spack

apt update && apt install gcc unzip git python3-dev g++ gfortran xz-utils -y

conda#

To install the package with conda run

conda install -c conda-forge scifem