When you use docker, you get a container that contains all PETSc builds (real-32/64 and complex 32/64).
You can find this in $PETSC_DIR
, which in the dolfinx/dolfinx
image is at /usr/local/petsc
.
If you set $PETSC_ARCH
to linux-gnu-complex-64
,
You can follow the following instructions, after starting the dolfinx/dolfinx
container:
docker run -ti -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/root/shared -w /root/shared --rm dolfinx/dolfinx
cd /root
source dolfinx-complex-mode
rm -rf /usr/local/dolfinx-complex
export PETSC_ARCH=linux-gnu-complex-64
pip3 uninstall petsc4py slepc4py
pip3 install petsc4py
pip3 install slepc4py
git clone https://github.com/FEniCS/dolfinx.git
cmake -G Ninja -B build-dir-complex -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx-complex -S ./dolfinx/cpp/
cmake --build build-dir-complex --parallel 3
cmake --install build-dir-complex
pip3 install ./dolfinx/python/ --upgrade