-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM nvcr.io/nvidia/nvhpc:23.7-devel-cuda12.2-ubuntu20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get upgrade -y && apt-get install -y \ | ||
build-essential \ | ||
wget \ | ||
git \ | ||
bc \ | ||
ninja-build \ | ||
git \ | ||
libev-dev \ | ||
libevent-dev \ | ||
libhwloc-dev \ | ||
pkg-config \ | ||
clang-format-8 \ | ||
&& \ | ||
apt-get clean && rm -rf /var/lib/apt/list | ||
|
||
ENV PREFIX=/scratch | ||
ENV ARCHIVE_DIR=${PREFIX}/archive | ||
ENV SOURCE_DIR=${PREFIX}/source | ||
ENV BUILD_DIR=${PREFIX}/build | ||
ENV INSTALL_DIR=/opt | ||
|
||
RUN mkdir -p ${PREFIX} && \ | ||
cd ${PREFIX} && \ | ||
mkdir archive && \ | ||
mkdir source && \ | ||
mkdir build | ||
|
||
# Install CMake | ||
RUN export CMAKE_VERSION=3.22.2 && \ | ||
export CMAKE_SHA256=38b3befdee8fd2bac06954e2a77cb3072e6833c69d8cc013c0a3b26f1cfdfe37 && \ | ||
export CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz && \ | ||
export CMAKE_ARCHIVE=${ARCHIVE_DIR}/cmake.tar.gz && \ | ||
export CMAKE_BUILD_DIR=${BUILD_DIR}/cmake && \ | ||
wget --quiet ${CMAKE_URL} --output-document=${CMAKE_ARCHIVE} && \ | ||
echo "${CMAKE_SHA256} ${CMAKE_ARCHIVE}" | sha256sum -c && \ | ||
mkdir -p ${CMAKE_BUILD_DIR} && \ | ||
tar xf ${CMAKE_ARCHIVE} -C ${CMAKE_BUILD_DIR} --strip-components=1 && \ | ||
mv ${CMAKE_BUILD_DIR} ${INSTALL_DIR} && \ | ||
rm -rf ${CMAKE_ARCHIVE} && \ | ||
rm -rf ${CMAKE_BUILD_DIR} | ||
ENV PATH=${INSTALL_DIR}/cmake/bin:$PATH | ||
|
||
## Install Kokkos | ||
RUN export KOKKOS_SOURCE_DIR=${SOURCE_DIR}/kokkos && \ | ||
export KOKKOS_BUILD_DIR=${BUILD_DIR}/kokkos && \ | ||
export KOKKOS_INSTALL_DIR=${INSTALL_DIR}/kokkos && \ | ||
cd ${SOURCE_DIR} && git clone https://github.com/kokkos/kokkos && \ | ||
cd kokkos && \ | ||
git checkout 4.1.00 && \ | ||
mkdir -p ${KOKKOS_BUILD_DIR} && \ | ||
cd ${KOKKOS_BUILD_DIR} && \ | ||
cmake -DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_CXX_COMPILER=${KOKKOS_SOURCE_DIR}/bin/nvcc_wrapper \ | ||
-DCUDAToolkit_ROOT=/opt/nvidia/hpc_sdk/Linux_x86_64/23.7/cuda \ | ||
-DKokkos_ENABLE_CUDA=ON \ | ||
-DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=ON \ | ||
-DCMAKE_INSTALL_PREFIX=${KOKKOS_INSTALL_DIR} \ | ||
${KOKKOS_SOURCE_DIR} && \ | ||
make -j${N_PROCS} install && \ | ||
rm -rf ${KOKKOS_ARCHIVE} && \ | ||
rm -rf ${KOKKOS_BUILD_DIR} && \ | ||
rm -rf ${KOKKOS_SOURCE_DIR} | ||
ENV KOKKOS_ROOT=${INSTALL_DIR}/kokkos |