Skip to content

Commit aa6677b

Browse files
committed
build mpi from source
1 parent 338a801 commit aa6677b

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

build/Dockerfile

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ LABEL org.opencontainers.image.source https://github.com/su2code/Docker-Builds
44

55
ENV LANG C.UTF-8
66
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
7+
8+
# Install dependencies (NO openmpi from apt)
79
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
810
apt-utils \
911
python3 \
@@ -14,22 +16,47 @@ RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
1416
cmake \
1517
python3-numpy \
1618
python3-scipy \
17-
python3-mpi4py \
1819
swig \
19-
libopenmpi-dev \
2020
libopenblas-dev \
21-
openmpi-bin \
2221
ccache \
2322
petsc-dev \
2423
python3-petsc4py \
2524
python3-rtree \
25+
wget \
26+
ca-certificates \
27+
libhwloc-dev \
28+
libevent-dev \
29+
flex \
30+
bison \
2631
&& rm -rf /var/lib/apt/lists/* \
2732
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
2833
&& /usr/sbin/update-ccache-symlinks \
2934
&& echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
3035

31-
# Copies your code file from your action repository to the filesystem path `/` of the container
32-
COPY compileSU2.sh /compileSU2.sh
36+
# ---- Build OpenMPI 5 from source ----
37+
WORKDIR /tmp
38+
39+
RUN wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.5.tar.gz \
40+
&& tar -xzf openmpi-5.0.5.tar.gz \
41+
&& cd openmpi-5.0.5 \
42+
&& ./configure \
43+
--prefix=/opt/openmpi \
44+
--enable-mpi-cxx \
45+
--with-hwloc \
46+
--with-libevent \
47+
&& make -j$(nproc) \
48+
&& make install \
49+
&& ldconfig \
50+
&& rm -rf /tmp/openmpi-5.0.5*
51+
52+
# Environment for OpenMPI
53+
ENV PATH="/opt/openmpi/bin:$PATH"
54+
ENV LD_LIBRARY_PATH="/opt/openmpi/lib:$LD_LIBRARY_PATH"
55+
56+
# Reinstall mpi4py against this MPI
57+
RUN pip3 install --no-cache-dir --force-reinstall mpi4py
3358

3459
# Code file to execute when the docker container starts up (`entrypoint.sh`)
60+
COPY compileSU2.sh /compileSU2.sh
61+
3562
ENTRYPOINT ["/compileSU2.sh"]

0 commit comments

Comments
 (0)