Skip to content

Commit 3e64d44

Browse files
authored
Fix Dockerfiles (#7703)
1 parent 39c688e commit 3e64d44

3 files changed

Lines changed: 24 additions & 55 deletions

File tree

Dockerfile.cuda

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ RUN cd /tmp && \
2424
ln -s /usr/local/include/elpa_openmp-$ELPA_VER/elpa /usr/local/include/ && \
2525
cd /tmp && rm -rf elpa-$ELPA_VER
2626

27+
# RapidJSON
28+
RUN cd /tmp && wget --quiet https://codeload.github.com/Tencent/rapidjson/tar.gz/24b5e7a -O rapidjson-24b5e7a.tar.gz
29+
RUN tar -xzf rapidjson-24b5e7a.tar.gz && cd rapidjson-24b5e7a
30+
RUN cmake -B build -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
31+
RUN cmake --build build --target install
32+
RUN cd /tmp && rm -r rapidjson-24b5e7a
33+
2734
ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null
2835

2936
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \

Dockerfile.gnu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-wit
2626
--no-check-certificate --quiet -O libtorch.zip && \
2727
unzip -q libtorch.zip -d /opt && rm libtorch.zip
2828

29+
# RapidJSON
30+
RUN cd /tmp && wget --quiet https://codeload.github.com/Tencent/rapidjson/tar.gz/24b5e7a -O rapidjson-24b5e7a.tar.gz
31+
RUN tar -xzf rapidjson-24b5e7a.tar.gz && cd rapidjson-24b5e7a
32+
RUN cmake -B build -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
33+
RUN cmake --build build --target install
34+
RUN cd /tmp && rm -r rapidjson-24b5e7a
35+
2936
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake
3037

3138
ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null

Dockerfile.intel

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,12 @@
1-
FROM ubuntu:22.04
1+
FROM intel/oneapi-hpckit:2025.2.2-0-devel-ubuntu22.04
22

33
RUN apt-get update && apt-get install -y \
44
bc cmake git gnupg gcc g++ python3-numpy sudo wget vim unzip \
55
libcereal-dev libxc-dev libgtest-dev libgmock-dev libbenchmark-dev \
66
pkg-config build-essential autoconf automake libtool
77

8-
# Following steps by https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html .
9-
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
10-
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
11-
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
12-
| sudo tee /etc/apt/sources.list.d/oneAPI.list
13-
14-
# To save disk space, only install the essential components, but not the whole toolkit.
15-
RUN apt-get update && \
16-
apt-get install -y \
17-
intel-oneapi-compiler-dpcpp-cpp \
18-
intel-oneapi-compiler-fortran \
19-
intel-oneapi-mkl-devel \
20-
intel-oneapi-mkl-sycl-devel \
21-
intel-oneapi-mkl-sycl-distributed-dft-devel \
22-
intel-oneapi-mpi-devel \
23-
intel-oneapi-vtune && \
24-
apt-get clean && \
25-
rm -rf /var/lib/apt/lists/*
26-
27-
RUN ls -la /opt/intel/oneapi/mkl/latest/lib/intel64/*sycl*dft*
28-
RUN ls -la /opt/intel/oneapi/mkl/latest/lib/intel64/*dis*
29-
30-
# Set oneAPI environment variables
31-
ENV ONEAPI_ROOT=/opt/intel/oneapi
32-
ENV I_MPI_ROOT=${ONEAPI_ROOT}/mpi/latest
33-
ENV MKLROOT=${ONEAPI_ROOT}/mkl/latest
34-
ENV CMPLR_ROOT=${ONEAPI_ROOT}/compiler/latest
35-
36-
# Set library paths and include paths
37-
ENV LIBRARY_PATH=${ONEAPI_ROOT}/tbb/latest/lib/intel64/gcc4.8:${ONEAPI_ROOT}/mpi/latest/lib:${MKLROOT}/lib/intel64:${ONEAPI_ROOT}/compiler/latest/lib/:${LIBRARY_PATH}
38-
ENV LD_LIBRARY_PATH=${ONEAPI_ROOT}/tbb/latest/lib/intel64/gcc4.8:${ONEAPI_ROOT}/mpi/latest/lib:${MKLROOT}/lib/intel64:${ONEAPI_ROOT}/compiler/latest/lib/:${LD_LIBRARY_PATH}
39-
ENV PATH=${ONEAPI_ROOT}/vtune/latest/bin64:${ONEAPI_ROOT}/mpi/latest/bin:${MKLROOT}/bin/intel64:${ONEAPI_ROOT}/compiler/latest/bin:${PATH}
40-
ENV CPATH=${MKLROOT}/include:${ONEAPI_ROOT}/mpi/latest/include:${CPATH}
41-
ENV PKG_CONFIG_PATH=${MKLROOT}/lib/pkgconfig:${ONEAPI_ROOT}/mpi/latest/lib/pkgconfig:${PKG_CONFIG_PATH}
42-
43-
# Set CMAKE related paths
44-
ENV CMAKE_PREFIX_PATH=${ONEAPI_ROOT}/tbb/latest:${MKLROOT}/lib/cmake:${ONEAPI_ROOT}/dpl/latest/lib/cmake:${ONEAPI_ROOT}/dnnl/latest/lib/cmake:${ONEAPI_ROOT}/dal/latest:${ONEAPI_ROOT}/compiler/latest:${CMAKE_PREFIX_PATH}
45-
46-
SHELL ["/bin/bash", "-c"]
47-
ENV CC=mpiicx CXX=mpiicpx FC=mpiifx
48-
49-
# Verify oneAPI installation
50-
RUN source ${ONEAPI_ROOT}/setvars.sh && \
51-
echo "=== Verify compiler ===" && \
52-
which mpiicx && mpiicx --version && \
53-
echo "=== Verify MKL ===" && \
54-
ls ${MKLROOT}/lib/intel64/ && \
55-
echo "=== Verify MPI ===" && \
56-
which mpirun && mpirun --version
57-
588
# https://elpa.mpcdf.mpg.de/software/tarball-archive/ELPA_TARBALL_ARCHIVE.html
59-
RUN source /opt/intel/oneapi/setvars.sh && \
60-
cd /tmp && \
9+
RUN cd /tmp && \
6110
ELPA_VER=2022.11.001 && \
6211
wget -q https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/$ELPA_VER/elpa-$ELPA_VER.tar.gz && \
6312
tar xzf elpa-$ELPA_VER.tar.gz && rm elpa-$ELPA_VER.tar.gz && \
@@ -68,8 +17,14 @@ RUN source /opt/intel/oneapi/setvars.sh && \
6817
ln -s /usr/local/include/elpa_openmp-$ELPA_VER/elpa /usr/local/include/ && \
6918
cd /tmp && rm -rf elpa-$ELPA_VER
7019

71-
# rapidjson and libtorch
72-
RUN cd /tmp && git clone --depth 1 https://github.com/Tencent/rapidjson.git && cp -r rapidjson/include/rapidjson /usr/include/ && rm -rf rapidjson
20+
# RapidJSON
21+
RUN cd /tmp && wget --quiet https://codeload.github.com/Tencent/rapidjson/tar.gz/24b5e7a -O rapidjson-24b5e7a.tar.gz
22+
RUN tar -xzf rapidjson-24b5e7a.tar.gz && cd rapidjson-24b5e7a
23+
RUN cmake -B build -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF
24+
RUN cmake --build build --target install
25+
RUN cd /tmp && rm -r rapidjson-24b5e7a
26+
27+
# LibTorch (Note: Using pre-built Torch library with MKL might cause issues)
7328
RUN wget -q https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcpu.zip -O /tmp/libtorch.zip && \
7429
unzip -q /tmp/libtorch.zip -d /opt && rm -f /tmp/libtorch.zip
7530
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake:${CMAKE_PREFIX_PATH}

0 commit comments

Comments
 (0)