Skip to content

Instantly share code, notes, and snippets.

@vicentebolea
Last active June 26, 2024 20:28
Show Gist options
  • Select an option

  • Save vicentebolea/a16e2d3c515999723735daa77c016ad7 to your computer and use it in GitHub Desktop.

Select an option

Save vicentebolea/a16e2d3c515999723735daa77c016ad7 to your computer and use it in GitHub Desktop.
##=============================================================================
##
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
##=============================================================================
# Use --build-arg APPLY_FIX=ON to apply the fix
FROM ubuntu:22.04
LABEL maintainer "Vicente Adolfo Bolea Sanchez<[email protected]>"
# Base dependencies for building VTK-m projects
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
cmake \
curl \
g++ \
git \
make \
pkg-config \
ca-certificates \
&& \
apt clean
ENV KOKKOS_VERSION=4.3.01
ARG APPLY_FIX
RUN curl -L https://github.com/kokkos/kokkos/archive/refs/tags/$KOKKOS_VERSION.tar.gz | tar -xzf - && \
if [ "x$APPLY_FIX" = x"1" ]; then curl https://github.com/vicentebolea/kokkos/commit/d10dcd82260796fbdf9263a904dba21273315447.patch | git -C kokkos-$KOKKOS_VERSION apply -v; fi && \
if [ "x$APPLY_FIX" = x"2" ]; then curl https://github.com/vicentebolea/kokkos/commit/e4c8a1d4963ed480b50329a2852abc4c07442c93.patch | git -C kokkos-$KOKKOS_VERSION apply -v; fi && \
if [ "x$APPLY_FIX" = x"3" ]; then curl https://github.com/vicentebolea/kokkos/commit/74a23456ae9509a5d7a1aae1dd6afdff7df3745e.patch | git -C kokkos-$KOKKOS_VERSION apply -v; fi && \
cmake -S kokkos-$KOKKOS_VERSION -B build &&\
cmake --build build -v && \
cmake --install build --prefix=/opt/kokkos/$KOKKOS_VERSION && \
rm -rf build kokkos-$KOKKOS_VERSION
WORKDIR /root/reproducer
RUN cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(test)
find_package(Kokkos REQUIRED)
kokkos_compilation()
EOF
RUN Kokkos_DIR=/opt/kokkos/$KOKKOS_VERSION cmake --trace-expand .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment