Skip to content

Commit

Permalink
[build] simplify docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed Jun 27, 2023
1 parent cc75c3d commit 62c3e08
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions Docker/openmpi_dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,14 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
libevent-dev \
libpmi2-0-dev \
cython3 \
# comment the next 4 lines if you want to build openmpi manually
libopenmpi-dev \
openmpi-bin \
openmpi-common \
openmpi-doc \
libfabric-dev \
libomp-${LLVM}-dev \
# Jupyter lab packages
texlive \
dvipng \
texlive-latex-extra \
texlive-fonts-recommended \
nodejs

# install openmpi and compile openmpi manually
# this is to ensure PMI compatibility with cray systems
RUN wget -q https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz \
&& tar xf openmpi-4.1.5.tar.gz \
&& cd openmpi-4.1.5 \
&& ./configure --prefix=/usr --enable-mpi-cxx --with-libfabric=/usr \
--with-hwloc=/usr --with-hwloc-libdir=/usr/lib/x86_64-linux-gnu \
--with-libevent=/usr --with-libevent-libdir=/usr/lib/x86_64-linux-gnu \
--with-pmi=/usr/include/slurm --with-pmi-libdir=/usr/lib/x86_64-linux-gnu \
CFLAGS="-I/usr/include/slurm" \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -rf openmpi-4.1.5.tar.gz openmpi-4.1.5

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\
nodejs \
python3-dev \
python3-mako \
python3-numpy \
Expand All @@ -73,6 +55,22 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
apt-get autoclean -y && \
rm -rf /var/cache/apt/* /var/lib/apt/lists/*

# install openmpi and compile openmpi manually
# this is to ensure PMI compatibility with cray systems
# RUN wget -q https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz \
# && tar xf openmpi-4.1.5.tar.gz \
# && cd openmpi-4.1.5 \
# && ./configure --prefix=/usr --enable-mpi-cxx --with-libfabric=/usr \
# --with-hwloc=/usr --with-hwloc-libdir=/usr/lib/x86_64-linux-gnu \
# --with-libevent=/usr --with-libevent-libdir=/usr/lib/x86_64-linux-gnu \
# --with-pmi=/usr/include/slurm --with-pmi-libdir=/usr/lib/x86_64-linux-gnu \
# CFLAGS="-I/usr/include/slurm" \
# && make -j$(nproc) \
# && make install \
# && ldconfig \
# && cd .. \
# && rm -rf openmpi-4.1.5.tar.gz openmpi-4.1.5

RUN pip3 install --no-cache-dir \
mpi4py \
cython \
Expand Down Expand Up @@ -102,8 +100,6 @@ RUN pip3 install --no-cache-dir \
ipympl \
RISE

RUN jupyter-lab build

ENV PYTHON_VERSION=3.10 \
CC=clang-${LLVM} CXX=clang++-${LLVM} CXXFLAGS="-stdlib=libc++"
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM} 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM} --slave /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-${LLVM}
Expand Down

0 comments on commit 62c3e08

Please sign in to comment.