|
1 | | -# Dockerfile for Firedrake with a full set of capabilities and applications installed. |
| 1 | +# Dockerfile for Firedrake with a full set of capabilities installed. |
2 | 2 |
|
3 | 3 | FROM firedrakeproject/firedrake-vanilla-default:latest |
4 | 4 |
|
5 | 5 | # Install optional dependencies |
6 | 6 | RUN pip install --verbose \ |
7 | 7 | --extra-index-url https://download.pytorch.org/whl/cpu \ |
8 | | - jax ngsPETSc torch vtk |
| 8 | + jax torch |
9 | 9 |
|
10 | | -# Set PYTHONPATH so netgen can be found |
11 | | -# (see https://github.com/NGSolve/netgen/issues/213) |
12 | | -ENV PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH |
13 | | - |
14 | | -# Install Firedrake apps |
15 | | -RUN pip install --verbose --src /opt \ |
16 | | - -e git+https://github.com/firedrakeproject/asQ.git#egg=asQ \ |
17 | | - -e git+https://bitbucket.org/pefarrell/defcon.git#egg=defcon \ |
18 | | - -e git+https://bitbucket.org/pefarrell/fascd.git#egg=fascd \ |
19 | | - -e git+https://github.com/FEMlium/FEMlium.git#egg=FEMlium \ |
20 | | - -e git+https://github.com/g-adopt/g-adopt.git#egg=gadopt \ |
21 | | - -e git+https://github.com/firedrakeproject/gusto.git#egg=gusto \ |
22 | | - -e git+https://github.com/firedrakeproject/Irksome.git#egg=Irksome \ |
23 | | - -e git+https://github.com/icepack/icepack.git#egg=icepack \ |
24 | | - -e git+https://github.com/thetisproject/thetis.git#egg=thetis |
| 10 | +# Install ngsPETSc and dependencies. Netgen do not package ARM wheels so |
| 11 | +# we have to build it from source in that case. If on x86 then we have to |
| 12 | +# set PYTHONPATH so netgen can be found (see https://github.com/NGSolve/netgen/issues/213). |
| 13 | +RUN \ |
| 14 | + if [ "$(dpkg --print-architecture)" == "arm64" ]; then \ |
| 15 | + apt-get update \ |
| 16 | + && apt-get -y install python3-tk libxmu-dev tk-dev tcl-dev cmake g++ libglu1-mesa-dev liblapacke-dev libocct-data-exchange-dev libocct-draw-dev occt-misc libtbb-dev libxi-dev \ |
| 17 | + && rm -rf /var/lib/apt/lists/* \ |
| 18 | + && mkdir /opt/ngsuite \ |
| 19 | + && git clone --branch=v6.2.2505 --single-branch https://github.com/NGSolve/netgen.git /opt/ngsuite/netgen-src \ |
| 20 | + && git -C /opt/ngsuite/netgen-src submodule update --init --recursive \ |
| 21 | + && mkdir /opt/ngsuite/netgen-build \ |
| 22 | + && mkdir /opt/ngsuite/netgen-install \ |
| 23 | + && cmake -DCMAKE="-cxx-flags=-flax-vector-conversions" -DCMAKE_INSTALL_PREFIX=/opt/ngsuite/netgen-install /opt/ngsuite/netgen-src \ |
| 24 | + && make \ |
| 25 | + && make install \ |
| 26 | + && export PATH=/opt/ngsuite/netgen-install/bin:$PATH \ |
| 27 | + && export PYTHONPATH=/opt/ngsuite/netgen-install/lib/python3.12/site-packages:$PYTHONPATH \ |
| 28 | + && pip install ngsPETSc --no-deps; \ |
| 29 | + else \ |
| 30 | + export PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH \ |
| 31 | + && pip install ngsPETSc; \ |
| 32 | + fi |
25 | 33 |
|
26 | 34 | # Install some other niceties |
27 | 35 | RUN apt-get update \ |
|
0 commit comments