mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 06:25:15 -04:00
parent
a2edeeb2c6
commit
29578c7298
2 changed files with 15 additions and 18 deletions
|
|
@ -3,14 +3,11 @@
|
||||||
# A stand-alone build in this folder can be performed with:
|
# A stand-alone build in this folder can be performed with:
|
||||||
# podman build --build-arg DEPS_IMAGE=<image id> --shm-size=1g -f build_cp2k_spack.Dockerfile ../../
|
# podman build --build-arg DEPS_IMAGE=<image id> --shm-size=1g -f build_cp2k_spack.Dockerfile ../../
|
||||||
#
|
#
|
||||||
# Author: Matthias Krack (MK)
|
# Stage 2: Build CP2K
|
||||||
#
|
|
||||||
|
|
||||||
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
||||||
ARG DEPS_IMAGE=${DEPS_IMAGE:-}
|
ARG DEPS_IMAGE=${DEPS_IMAGE:-}
|
||||||
|
|
||||||
###### Stage 2: Build CP2K ######
|
|
||||||
|
|
||||||
FROM "${DEPS_IMAGE}" AS build_cp2k
|
FROM "${DEPS_IMAGE}" AS build_cp2k
|
||||||
|
|
||||||
# Setup CUDA environment
|
# Setup CUDA environment
|
||||||
|
|
@ -24,15 +21,17 @@ ENV NUM_PROCS=${NUM_PROCS:-32}
|
||||||
ARG FEATURE_FLAGS
|
ARG FEATURE_FLAGS
|
||||||
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
||||||
|
|
||||||
# Update CP2K files
|
|
||||||
WORKDIR /opt/cp2k
|
|
||||||
RUN rm -rf benchmarks cmake data src tests tools
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Build CP2K
|
# Build CP2K
|
||||||
|
WORKDIR /opt/cp2k
|
||||||
|
COPY ./src ./src
|
||||||
|
COPY ./data ./data
|
||||||
|
COPY ./tools/build_utils ./tools/build_utils
|
||||||
|
COPY ./cmake ./cmake
|
||||||
|
COPY ./CMakeLists.txt .
|
||||||
|
|
||||||
RUN ./make_cp2k.sh -cray -cv ${CP2K_VERSION} -uc no -j${NUM_PROCS} ${FEATURE_FLAGS}
|
RUN ./make_cp2k.sh -cray -cv ${CP2K_VERSION} -uc no -j${NUM_PROCS} ${FEATURE_FLAGS}
|
||||||
|
|
||||||
###### Stage 3: Install CP2K ######
|
# Stage 3: Install CP2K
|
||||||
|
|
||||||
FROM "${BASE_IMAGE}" AS install_cp2k
|
FROM "${BASE_IMAGE}" AS install_cp2k
|
||||||
|
|
||||||
|
|
@ -50,11 +49,11 @@ COPY --from=build_cp2k /opt/cp2k/spack/spack/opt/spack ./spack/spack/opt/spack
|
||||||
COPY --from=build_cp2k /opt/cp2k/install ./install
|
COPY --from=build_cp2k /opt/cp2k/install ./install
|
||||||
|
|
||||||
# Install CP2K regression tests
|
# Install CP2K regression tests
|
||||||
COPY --from=build_cp2k /opt/cp2k/tests ./tests
|
COPY ./tests ./tests
|
||||||
COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
|
COPY --from=build_cp2k /opt/cp2k/src/grid/sample_tasks ./src/grid/sample_tasks
|
||||||
|
|
||||||
# Install CP2K/Quickstep CI benchmarks
|
# Install CP2K/Quickstep CI benchmarks
|
||||||
COPY --from=build_cp2k /opt/cp2k/benchmarks/CI ./benchmarks/CI
|
COPY ./benchmarks/CI ./benchmarks/CI
|
||||||
|
|
||||||
# Do not rely only on LD_LIBRARY_PATH because it is fragile
|
# Do not rely only on LD_LIBRARY_PATH because it is fragile
|
||||||
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
|
COPY --from=build_cp2k /etc/ld.so.conf.d/cp2k.conf /etc/ld.so.conf.d/cp2k.conf
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@
|
||||||
# A stand-alone build in this folder can be performed with:
|
# A stand-alone build in this folder can be performed with:
|
||||||
# podman build --shm-size=1g -f build_deps_spack.Dockerfile ../../
|
# podman build --shm-size=1g -f build_deps_spack.Dockerfile ../../
|
||||||
#
|
#
|
||||||
# Author: Matthias Krack (MK)
|
|
||||||
#
|
|
||||||
# Stage 1: Create a base image providing the dependencies for building a CP2K binary
|
# Stage 1: Create a base image providing the dependencies for building a CP2K binary
|
||||||
|
|
||||||
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
ARG BASE_IMAGE=${BASE_IMAGE:-ubuntu:26.04}
|
||||||
|
|
@ -52,10 +50,10 @@ ENV CP2K_VERSION=${CP2K_VERSION:-psmp}
|
||||||
ARG FEATURE_FLAGS
|
ARG FEATURE_FLAGS
|
||||||
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
ENV FEATURE_FLAGS=${FEATURE_FLAGS:-}
|
||||||
|
|
||||||
# Copy CP2K repository into container
|
|
||||||
WORKDIR /opt
|
|
||||||
COPY . cp2k/
|
|
||||||
|
|
||||||
# Build CP2K dependencies
|
# Build CP2K dependencies
|
||||||
WORKDIR /opt/cp2k
|
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}
|
RUN ./make_cp2k.sh -bd_only -cray -cv ${CP2K_VERSION} -uc no -ue -j${NUM_PROCS} ${FEATURE_FLAGS}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue