-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.lab
44 lines (33 loc) · 1.83 KB
/
Dockerfile.lab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM dolfinx/lab:v0.8.0
LABEL maintainer="Pierric Mora <[email protected]>"
LABEL description=" elastodynamics with FEniCSx/DOLFINx "
WORKDIR /tmp
COPY . /tmp/
COPY ./demo /root/demo/
# Install elastodynamicsx and optional dependencies
RUN pip3 install . &&\
pip3 install tqdm pyvista[trame] --upgrade &&\
rm -rf /tmp/*
# ####### install dolfinx_mpc ############ #
# https://github.com/jorgensd/dolfinx_mpc/blob/main/docker/Dockerfile
# This argument should be the same as what-ever the python version of the dol
ARG PYTHON_VERSION=3.10
# Clone DOLFINX_MPC source dir
RUN git clone --branch v0.8.1 https://github.com/jorgensd/dolfinx_mpc.git
# Install real mode
RUN . /usr/local/bin/dolfinx-real-mode && \
. /usr/local/dolfinx-real/lib/dolfinx/dolfinx.conf && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx-real -DCMAKE_BUILD_TYPE=Developer -B build-dir-real dolfinx_mpc/cpp/ && \
ninja install -j4 -C build-dir-real && \
python3 -m pip install -v --break-system-packages --no-build-isolation --check-build-dependencies \
--target /usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir ./dolfinx_mpc/python
# Clean repo to remove build dir from pip
RUN rm -rf dolfinx_mpc/python/build
# Install complex mode
RUN . /usr/local/bin/dolfinx-complex-mode && \
. /usr/local/dolfinx-complex/lib/dolfinx/dolfinx.conf && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local/dolfinx-complex -DCMAKE_BUILD_TYPE=Developer -B build-dir-complex dolfinx_mpc/cpp/ && \
ninja install -j4 -C build-dir-complex && \
python3 -m pip install --break-system-packages -v --no-build-isolation --check-build-dependencies \
--target /usr/local/dolfinx-complex/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir ./dolfinx_mpc/python
WORKDIR /root