1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#
# This file was created by generate_dockerfiles.py.
# Usage: podman build --shm-size=1g -f ./Dockerfile.test_nvhpc ../../
#
FROM ubuntu:22.04
# Install Ubuntu packages.
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
apt-transport-https \
ca-certificates \
dirmngr \
gnupg2 \
libopenblas-dev \
make \
nano \
python3 \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK
RUN echo 'deb https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' > /etc/apt/sources.list.d/nvhpc.list
# Install NVIDIA's HPC SDK but only keep the compilers to reduce Docker image size.
RUN apt-get update -qq && \
apt-get install -qq --no-install-recommends nvhpc-22-11 && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.11/math_libs && \
rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.11/comm_libs && \
rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.11/profilers && \
rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.11/cuda
ENV PATH ${PATH}:/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/compilers/bin
# Install CP2K using Linux-x86-64-nvhpc.ssmp.
WORKDIR /opt/cp2k
COPY ./Makefile .
COPY ./src ./src
COPY ./exts ./exts
COPY ./data ./data
COPY ./tests ./tests
COPY ./tools/build_utils ./tools/build_utils
COPY ./tools/regtesting ./tools/regtesting
COPY ./arch/Linux-x86-64-nvhpc.ssmp /opt/cp2k/arch/
# This takes over an hour!
RUN make -j ARCH=Linux-x86-64-nvhpc VERSION=ssmp cp2k
|