mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 06:25:15 -04:00
59 lines
1.4 KiB
Docker
59 lines
1.4 KiB
Docker
# Dockerfile for CP2K continuous integration (CI) runs
|
|
#
|
|
# A stand-alone build in this folder can be performed with:
|
|
# podman build --shm-size=1g -f build_deps_spack.Dockerfile ../../
|
|
#
|
|
# Stage 1: Create a base image providing the dependencies for building a CP2K binary
|
|
|
|
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
|
|
|
FROM "${BASE_IMAGE}" AS build_deps
|
|
|
|
# Install packages required to build the CP2K dependencies with Spack
|
|
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
|
|
bzip2 \
|
|
ca-certificates \
|
|
cmake \
|
|
g++ gcc gfortran \
|
|
git \
|
|
gnupg \
|
|
libssh-dev \
|
|
libssl-dev \
|
|
libtool \
|
|
libtool-bin \
|
|
lsb-release \
|
|
make \
|
|
patch \
|
|
pkgconf \
|
|
python3 \
|
|
python3-dev \
|
|
python3-pip \
|
|
python3-venv \
|
|
unzip \
|
|
wget \
|
|
xxd \
|
|
xz-utils \
|
|
zstd \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Setup CUDA environment
|
|
ENV CUDA_HOME=/usr/local/cuda
|
|
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
|
|
|
|
# Retrieve the number of available CPU cores
|
|
ARG NUM_PROCS
|
|
ENV NUM_PROCS=${NUM_PROCS:-32}
|
|
|
|
ARG CP2K_VERSION
|
|
ENV CP2K_VERSION=${CP2K_VERSION:-psmp}
|
|
|
|
ARG FEATURE_FLAGS
|
|
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
|
|
|
# Build CP2K dependencies
|
|
WORKDIR /opt/cp2k
|
|
COPY ./tools/spack ./tools/spack
|
|
COPY ./tools/docker ./tools/docker
|
|
COPY ./make_cp2k.sh .
|
|
|
|
RUN ./make_cp2k.sh -bd_only -cray -cv ${CP2K_VERSION} -uc no -ue -j${NUM_PROCS} ${FEATURE_FLAGS}
|