Skip to content

Commit

Permalink
Synchronize Dockerfiles with triqs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoemi09 authored and Wentzell committed Nov 4, 2024
1 parent 393cc4e commit ef4c7dd
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
34 changes: 18 additions & 16 deletions packaging/Dockerfile.msan
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM --platform=linux/amd64 ubuntu:23.04
FROM --platform=linux/amd64 ubuntu:24.04
ARG APPNAME=nda
ARG LLVM=17
ARG LLVM=18
ARG NTHREAD=10

RUN apt-get update && apt-get install -y lsb-release wget software-properties-common && \
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
#wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang-${LLVM} \
cmake \
g++-12 \
g++ \
gfortran \
git \
vim \
Expand All @@ -32,7 +32,7 @@ RUN apt-get update && apt-get install -y lsb-release wget software-properties-co
python3-pip \
python3-scipy

ENV PYTHON_VERSION=3.11 \
ENV PYTHON_VERSION=3.12 \
CC=clang-${LLVM} CXX=clang++-${LLVM} \
LLVM_ROOT=/usr/lib/llvm-${LLVM}

Expand All @@ -57,16 +57,16 @@ ENV CXXFLAGS="$MSAN_FLAGS -Wno-unused-command-line-argument $CUSTOM_LIBCXX_FLAGS
MSAN_SYMBOLIZER_PATH=${LLVM_ROOT}/bin/llvm-symbolizer

# Static zlib using fPIC to be linked into hdf5
ADD https://www.zlib.net/zlib-1.3.tar.gz /tmp/
RUN cd /tmp && tar xf /tmp/zlib-1.3.tar.gz && cd zlib-1.3 && \
ADD https://www.zlib.net/zlib-1.3.1.tar.gz /tmp/
RUN cd /tmp && tar xf /tmp/zlib-1.3.1.tar.gz && cd zlib-1.3.1 && \
CFLAGS="-fPIC $CFLAGS" ./configure --prefix=/opt/zlib && make -j${NTHREAD} && make install && \
cd /tmp #&& rm -rf /tmp/zlib*

# HDF5
ADD https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_14_2.tar.gz /tmp/
RUN cd /tmp && tar xf /tmp/hdf5-1_14_2.tar.gz && chmod 1777 . && \
ADD https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_14_3.tar.gz /tmp/
RUN cd /tmp && tar xf /tmp/hdf5-1_14_3.tar.gz && chmod 1777 . && \
mkdir build && cd build && \
cmake /tmp/hdf5-hdf5-1_14_2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/hdf5 \
cmake /tmp/hdf5-hdf5-1_14_3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/hdf5 \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DZLIB_LIBRARY=/opt/zlib/lib/libz.a -DZLIB_INCLUDE_DIR:PATH=/opt/zlib/include && \
make -j${NTHREAD} && make install && \
cd /tmp && rm -rf /tmp/hdf5-* /tmp/build
Expand All @@ -79,17 +79,17 @@ RUN cd /tmp && tar xf /tmp/libevent-2.1.12-stable.tar.gz && cd libevent-2.1.12-s
cd /tmp && rm -rf /tmp/libevent*

# hwloc
ADD https://download.open-mpi.org/release/hwloc/v2.9/hwloc-2.9.3.tar.bz2 /tmp/
ADD https://download.open-mpi.org/release/hwloc/v2.10/hwloc-2.10.0.tar.bz2 /tmp/
COPY packaging/hwloc.patch /tmp/
RUN cd /tmp && tar xf /tmp/hwloc-2.9.3.tar.bz2 && cd hwloc-2.9.3 && patch -p0 -i /tmp/hwloc.patch && \
RUN cd /tmp && tar xf /tmp/hwloc-2.10.0.tar.bz2 && cd hwloc-2.10.0 && patch -p0 -i /tmp/hwloc.patch && \
./configure --prefix=/opt/openmpi --enable-shared && make -j${NTHREAD} && make install && \
cd /tmp && rm -rf /tmp/hwloc*

# OpenMPI
ADD https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.bz2 /tmp/
RUN cd /tmp && tar xf /tmp/openmpi-4.1.5.tar.bz2 && cd openmpi-4.1.5 && \
ADD https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.bz2 /tmp/
RUN cd /tmp && tar xf /tmp/openmpi-5.0.2.tar.bz2 && cd openmpi-5.0.2 && \
./configure --prefix=/opt/openmpi --enable-shared --disable-mpi-fortran --disable-pty-support --with-hwloc=/opt/openmpi --with-libevent=/opt/openmpi && make -j${NTHREAD} && make install && \
cd /tmp && rm -rf /tmp/openmpi-4.1.5*
cd /tmp && rm -rf /tmp/openmpi-5.0.2*
ENV MPI_HOME=/opt/openmpi \
MPICC=/opt/openmpi/bin/mpicc

Expand All @@ -104,7 +104,9 @@ ENV SRC=/src \
BUILD=/home/build \
INSTALL=/usr/local \
PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages \
CMAKE_PREFIX_PATH=/usr/lib/cmake/$APPNAME
CMAKE_PREFIX_PATH=/usr/lib/cmake/$APPNAME \
OPENBLAS_NUM_THREADS=1 \
MKL_NUM_THREADS=1

COPY . ${SRC}/$APPNAME
WORKDIR ${BUILD}/$APPNAME
Expand Down
13 changes: 6 additions & 7 deletions packaging/Dockerfile.sanitize
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM ubuntu:22.04
ARG LLVM=15
FROM ubuntu:24.04
ARG LLVM=18

RUN apt-get update && apt-get install -y lsb-release wget software-properties-common && \
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
#wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang-${LLVM} \
cmake \
g++-12 \
g++ \
gfortran \
git \
vim \
lldb-${LLVM} \
hdf5-tools \
libblas-dev \
libboost-dev \
libclang-${LLVM}-dev \
libc++-${LLVM}-dev \
Expand All @@ -22,7 +21,7 @@ RUN apt-get update && apt-get install -y lsb-release wget software-properties-co
libgfortran5 \
libgmp-dev \
libhdf5-dev \
liblapack-dev \
libopenblas-dev \
libopenmpi-dev \
openmpi-bin \
openmpi-common \
Expand All @@ -36,7 +35,7 @@ RUN apt-get update && apt-get install -y lsb-release wget software-properties-co
python3-pip \
python3-scipy

ENV PYTHON_VERSION=3.10 \
ENV PYTHON_VERSION=3.12 \
CC=clang-${LLVM} CXX=clang++-${LLVM} CXXFLAGS="-stdlib=libc++" \
ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-${LLVM}/bin/llvm-symbolizer \
ASAN_OPTIONS=symbolize=1:detect_leaks=0:alloc_dealloc_mismatch=0 \
Expand Down
26 changes: 13 additions & 13 deletions packaging/Dockerfile.ubuntu-clang
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM ubuntu:22.04
ARG LLVM=15
FROM ubuntu:24.04
ARG LLVM=18

# This platform includes dependencies for building docs
RUN apt-get update && apt-get install -y lsb-release wget software-properties-common && \
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
#wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM} && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang-${LLVM} \
cmake \
g++-12 \
g++ \
gfortran \
git \
vim \
lldb-${LLVM} \
hdf5-tools \
libblas-dev \
libboost-dev \
libclang-${LLVM}-dev \
libc++-${LLVM}-dev \
Expand All @@ -23,7 +22,7 @@ RUN apt-get update && apt-get install -y lsb-release wget software-properties-co
libgfortran5 \
libgmp-dev \
libhdf5-dev \
liblapack-dev \
libopenblas-dev \
libopenmpi-dev \
openmpi-bin \
openmpi-common \
Expand All @@ -35,15 +34,16 @@ RUN apt-get update && apt-get install -y lsb-release wget software-properties-co
python3-matplotlib \
python3-mpi4py \
python3-numpy \
python3-numpydoc \
python3-pip \
python3-scipy \
python3-ipython && \
#python3-sphinx \
#python3-nbsphinx \
#python3-sphinx-rtd-theme && \
pip3 install myst-parser linkify-it-py && \
pip3 install sphinx==5.3.0 nbsphinx sphinx-rtd-theme
python3-ipython \
python3-sphinx \
python3-sphinx-rtd-theme \
python3-nbsphinx \
python3-myst-parser \
python3-linkify-it

ENV PYTHON_VERSION=3.10 \
ENV PYTHON_VERSION=3.12 \
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}
13 changes: 6 additions & 7 deletions packaging/Dockerfile.ubuntu-gcc
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
cmake \
g++-12 \
g++ \
gfortran \
git \
vim \
lldb-13 \
lldb \
hdf5-tools \
libblas-dev \
libboost-dev \
libfftw3-dev \
libgfortran5 \
libgmp-dev \
libhdf5-dev \
liblapack-dev \
libopenblas-dev \
libopenmpi-dev \
openmpi-bin \
openmpi-common \
Expand All @@ -27,5 +26,5 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-pip \
python3-scipy

ENV PYTHON_VERSION=3.10 \
CC=gcc-12 CXX=g++-12
ENV PYTHON_VERSION=3.12 \
CC=gcc CXX=g++

0 comments on commit ef4c7dd

Please sign in to comment.