ARG BASE=rocm/dev-ubuntu-20.04:5.6 FROM $BASE ARG NPROCS=4 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -yq \ build-essential \ bc \ curl \ git \ kmod \ wget \ jq \ vim \ gdb \ ccache \ libbz2-dev \ libicu-dev \ python-dev \ autotools-dev \ libopenmpi-dev \ rocthrust \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* ENV PATH=/opt/rocm/bin:$PATH RUN KEYDUMP_URL=https://cloud.cees.ornl.gov/download && \ KEYDUMP_FILE=keydump && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE} && \ wget --quiet ${KEYDUMP_URL}/${KEYDUMP_FILE}.sig && \ gpg --import ${KEYDUMP_FILE} && \ gpg --verify ${KEYDUMP_FILE}.sig ${KEYDUMP_FILE} && \ rm ${KEYDUMP_FILE}* # Install CMake ENV CMAKE_DIR=/opt/cmake RUN CMAKE_VERSION=3.22.4 && \ CMAKE_KEY=2D2CEF1034921684 && \ CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION} && \ CMAKE_SCRIPT=cmake-${CMAKE_VERSION}-Linux-x86_64.sh && \ CMAKE_SHA256=cmake-${CMAKE_VERSION}-SHA-256.txt && \ wget --quiet ${CMAKE_URL}/${CMAKE_SHA256} && \ wget --quiet ${CMAKE_URL}/${CMAKE_SHA256}.asc && \ wget --quiet ${CMAKE_URL}/${CMAKE_SCRIPT} && \ gpg --verify ${CMAKE_SHA256}.asc ${CMAKE_SHA256} && \ grep -i ${CMAKE_SCRIPT} ${CMAKE_SHA256} | sed -e s/linux/Linux/ | sha256sum --check && \ mkdir -p ${CMAKE_DIR} && \ sh ${CMAKE_SCRIPT} --skip-license --prefix=${CMAKE_DIR} && \ rm cmake* ENV PATH=${CMAKE_DIR}/bin:$PATH # Install Boost ENV BOOST_DIR=/opt/boost RUN BOOST_VERSION=1.79.0 && \ BOOST_VERSION_UNDERSCORE=$(echo "$BOOST_VERSION" | sed -e "s/\./_/g") && \ BOOST_KEY=379CE192D401AB61 && \ BOOST_URL=https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source && \ BOOST_ARCHIVE=boost_${BOOST_VERSION_UNDERSCORE}.tar.bz2 && \ SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \ wget --quiet ${BOOST_URL}/${BOOST_ARCHIVE} && \ wget --quiet ${BOOST_URL}/${BOOST_ARCHIVE}.json && \ cat ${BOOST_ARCHIVE}.json | jq -r '. | .sha256 + " " + .file' | sha256sum --check && \ mkdir -p boost && \ tar -xf ${BOOST_ARCHIVE} -C boost --strip-components=1 && \ cd boost && \ CXXFLAGS="-w" ./bootstrap.sh \ --prefix=${BOOST_DIR} \ && \ ./b2 -j${NPROCS} \ hardcode-dll-paths=true dll-path=${BOOST_DIR}/lib \ link=shared \ variant=release \ cxxflags=-w \ install \ && \ rm -rf ${SCRATCH_DIR} # Install Google Benchmark support library ENV BENCHMARK_DIR=/opt/benchmark RUN SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \ git clone https://github.com/google/benchmark.git -b v1.6.1 && \ cd benchmark && \ mkdir build && cd build && \ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=${BENCHMARK_DIR} -D BENCHMARK_ENABLE_TESTING=OFF .. && \ make -j${NPROCS} && make install && \ rm -rf ${SCRATCH_DIR} # Install Kokkos ARG KOKKOS_VERSION=4.3.00 ARG KOKKOS_OPTIONS="-DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_OPENMP=ON" ENV KOKKOS_DIR=/opt/kokkos RUN KOKKOS_URL=https://github.com/kokkos/kokkos/archive/${KOKKOS_VERSION}.tar.gz && \ KOKKOS_ARCHIVE=kokkos-${KOKKOS_HASH}.tar.gz && \ SCRATCH_DIR=/scratch && mkdir -p ${SCRATCH_DIR} && cd ${SCRATCH_DIR} && \ wget --quiet ${KOKKOS_URL} --output-document=${KOKKOS_ARCHIVE} && \ mkdir -p kokkos && \ tar -xf ${KOKKOS_ARCHIVE} -C kokkos --strip-components=1 && \ cd kokkos && \ mkdir -p build && cd build && \ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=${KOKKOS_DIR} -D CMAKE_CXX_COMPILER=hipcc ${KOKKOS_OPTIONS} .. && \ make -j${NPROCS} install && \ rm -rf ${SCRATCH_DIR}