@@ -67,12 +67,14 @@ ONBUILD ADD dolfinx/ /src/dolfinx/
67
67
ONBUILD ADD dolfinx/docker/dolfinx_jit_options.json /root/.config/dolfinx/dolfinx_jit_options.json
68
68
ONBUILD ADD dolfinx/docker/ffcx_options.json /root/.config/ffcx/ffcx_options.json
69
69
70
- # The following ARGS are used in the DOLFINx layer.
71
- # They are safe defaults.
72
70
# CMake build type for DOLFINx C++ build. See CMake documentation.
73
71
ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release"
74
72
75
- ONBUILD RUN pip install --no-cache-dir nanobind scikit-build-core[pyproject]
73
+ # Using pip install `.[test]` with --no-dependencies and --no-build-isolation
74
+ # does not install necessary packages, hence install build and optional
75
+ # dependencies manually here.
76
+ ONBUILD RUN pip install --no-cache-dir -r dolfinx/python/build-requirements.txt && \
77
+ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set
76
78
77
79
# The dolfinx-onbuild container expects to have folders basix/ ufl/
78
80
# ffcx/ and dolfinx/ mounted/shared at /src.
@@ -84,6 +86,8 @@ ONBUILD RUN cd basix && cmake -G Ninja -DCMAKE_BUILD_TYPE=${DOLFINX_CMAKE_BUILD_
84
86
cd ../ffcx && pip install --no-cache-dir . && \
85
87
cd ../ && pip install --no-cache-dir ipython
86
88
89
+ # --no-dependencies necessary as --target does not contain any dependencies e.g.
90
+ # mpi4py - leading to unwanted rebuild.
87
91
ONBUILD RUN cd dolfinx && \
88
92
mkdir -p build-real && \
89
93
cd build-real && \
@@ -92,7 +96,7 @@ ONBUILD RUN cd dolfinx && \
92
96
cd ../python && \
93
97
PETSC_ARCH=linux-gnu-real64-32 pip -v install \
94
98
--config-settings=cmake.build-type="${DOLFINX_CMAKE_BUILD_TYPE}" --config-settings=install.strip=false --no-build-isolation --check-build-dependencies \
95
- --target /usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir '.[test] ' && \
99
+ --target /usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir '.' && \
96
100
git clean -fdx && \
97
101
cd ../ && \
98
102
mkdir -p build-complex && \
@@ -103,7 +107,7 @@ ONBUILD RUN cd dolfinx && \
103
107
cd ../python && \
104
108
PETSC_ARCH=linux-gnu-complex128-32 pip -v install \
105
109
--config-settings=cmake.build-type="${DOLFINX_CMAKE_BUILD_TYPE}" --config-settings=install.strip=false --no-build-isolation --check-build-dependencies \
106
- --target /usr/local/dolfinx-complex/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir '.[test] '
110
+ --target /usr/local/dolfinx-complex/lib/python${PYTHON_VERSION}/dist-packages --no-dependencies --no-cache-dir '.'
107
111
108
112
# Real by default.
109
113
ONBUILD ENV PKG_CONFIG_PATH=/usr/local/dolfinx-real/lib/pkgconfig:$PKG_CONFIG_PATH \
0 commit comments