Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save thomas-robinson/bf8a6dfc40e9ec7ed1fa14d13df343a4 to your computer and use it in GitHub Desktop.

Select an option

Save thomas-robinson/bf8a6dfc40e9ec7ed1fa14d13df343a4 to your computer and use it in GitHub Desktop.
FROM intel/oneapi-hpckit:2025.3.0-0-devel-ubuntu24.04 as builder
LABEL maintainer="HPC-ME Development"
...
# Clone Spack v1.1.0
RUN mkdir -p /opt && cd /opt && \
git clone -b v1.1.0 https://github.com/spack/spack.git
...
# Add packages with oneapi compiler
RUN cd /opt/spack-environment && \
. /opt/spack/share/spack/setup-env.sh && \
spack env activate . && \
spack add 'bacio %oneapi@2025.3.0' && \
spack add 'hdf5 +fortran +hl +szip ~mpi %oneapi@2025.3.0' && \
spack add 'libyaml %oneapi@2025.3.0' && \
spack add 'nccmp %oneapi@2025.3.0' && \
spack add 'netcdf-c ~mpi %oneapi@2025.3.0' && \
spack add 'netcdf-fortran %oneapi@2025.3.0' && \
spack add 'sp %oneapi@2025.3.0' && \
spack add 'w3emc %oneapi@2025.3.0' && \
spack add 'w3nco %oneapi@2025.3.0' && \
spack add 'zlib %oneapi@2025.3.0' && \
spack add 'zlib-ng %oneapi@2025.3.0'
...
# Install all packages
RUN cd /opt/spack-environment && \
. /opt/spack/share/spack/setup-env.sh && \
spack env activate . && \
spack install --fail-fast -j 4 && \
spack gc -y || \
# Setup environment
ENV SPACK_ROOT=/opt/spack
ENV LD_LIBRARY_PATH=/opt/spack-environment/.spack-env/view/lib:$LD_LIBRARY_PATH
ENV LIBRARY_PATH=/opt/spack-environment/.spack-env/view/lib:$LIBRARY_PATH
ENV PATH=/opt/spack-environment/.spack-env/view/bin:$PATH
ENTRYPOINT [ "/bin/bash" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment