FROM ubuntu:22.04

SHELL ["/bin/bash", "-c"]

###########################
# Install Ubuntu packages #
###########################

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
    vim \
    git \
    git-lfs \
    cmake \
    build-essential

##############################
# Create directory structure #
##############################

RUN mkdir /vtkmtutorial

################
# Clone        #
################

RUN git clone --branch release https://gitlab.kitware.com/vtk/vtk-m.git /vtkmtutorial/vtk-m
RUN cd /vtkmtutorial/vtk-m ; ./Utilities/GitSetup/setup-lfs

###############
# Build VTK-m #
###############

RUN cmake -S /vtkmtutorial/vtk-m -B /vtkmtutorial/vtk-m-build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DVTKm_ENABLE_TUTORIALS=ON \
  -DCMAKE_CXX_COMPILER="g++" \
  -DCMAKE_C_COMPILER="gcc"
RUN cmake --build /vtkmtutorial/vtk-m-build -j10
 
#####################
# Working directory #
#####################

WORKDIR /vtkmtutorial/vtk-m-build/tutorial

