Back to home page

EIC code displayed by LXR

 
 

    


Warning, /eic-opticks/Dockerfile is written in an unsupported language. File is not indexed.

0001 # syntax=docker/dockerfile:latest
0002 
0003 ARG OS=ubuntu24.04
0004 ARG CUDA_VERSION=13.0.2
0005 
0006 FROM nvidia/cuda:${CUDA_VERSION}-devel-${OS} AS base
0007 
0008 ARG OPTIX_VERSION=9.0.0
0009 ARG GEANT4_VERSION=11.3.2
0010 ARG CMAKE_VERSION=4.2.1
0011 ARG CMAKE_BUILD_JOBS
0012 
0013 ENV DEBIAN_FRONTEND=noninteractive
0014 
0015 RUN apt update \
0016  && apt install -y g++ gcc gzip tar python3 python-is-python3 python3-pip curl git \
0017  && apt clean \
0018  && rm -rf /var/lib/apt/lists/*
0019 
0020 RUN apt update \
0021  && apt install -y libssl-dev \
0022     nlohmann-json3-dev \
0023     libglfw3-dev libglu1-mesa-dev libxmu-dev libglew-dev libglm-dev \
0024     qt6-base-dev libxerces-c-dev libexpat1-dev \
0025  && apt clean \
0026  && rm -rf /var/lib/apt/lists/*
0027 
0028 RUN curl -fsSL https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz \
0029     | tar -xz --strip-components=1 -C /usr/local
0030 
0031 RUN mkdir -p /opt/clhep/src && curl -sL https://gitlab.cern.ch/CLHEP/CLHEP/-/archive/CLHEP_2_4_7_1/CLHEP-CLHEP_2_4_7_1.tar.gz | tar -xz --strip-components 1 -C /opt/clhep/src \
0032  && cmake -S /opt/clhep/src -B /opt/clhep/build \
0033  && cmake --build /opt/clhep/build --parallel "${CMAKE_BUILD_JOBS:-$(nproc)}" --target install \
0034  && rm -fr /opt/clhep
0035 
0036 RUN mkdir -p /opt/geant4/src && curl -sL https://github.com/Geant4/geant4/archive/refs/tags/v${GEANT4_VERSION}.tar.gz | tar -xz --strip-components 1 -C /opt/geant4/src \
0037  && cmake -S /opt/geant4/src -B /opt/geant4/build -DGEANT4_USE_SYSTEM_CLHEP=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_QT_QT6=ON -DGEANT4_USE_GDML=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_BUILD_MULTITHREADED=ON \
0038  && cmake --build /opt/geant4/build --parallel "${CMAKE_BUILD_JOBS:-$(nproc)}" --target install \
0039  && rm -fr /opt/geant4
0040 
0041 RUN mkdir -p /opt/plog/src && curl -sL https://github.com/SergiusTheBest/plog/archive/refs/tags/1.1.11.tar.gz | tar -xz --strip-components 1 -C /opt/plog/src \
0042  && cmake -S /opt/plog/src -B /opt/plog/build \
0043  && cmake --build /opt/plog/build --parallel "${CMAKE_BUILD_JOBS:-$(nproc)}" --target install \
0044  && rm -fr /opt/plog
0045 
0046 RUN mkdir -p /opt/optix && curl -sL https://github.com/NVIDIA/optix-dev/archive/refs/tags/v${OPTIX_VERSION}.tar.gz | tar -xz --strip-components 1 -C /opt/optix
0047 
0048 RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
0049 
0050 SHELL ["/bin/bash", "-l", "-c"]
0051 
0052 # Set up non-interactive shells by sourcing all of the scripts in /etc/profile.d/
0053 RUN cat <<"EOF" > /etc/bash.nonint
0054 if [ -d /etc/profile.d ]; then
0055   for i in /etc/profile.d/*.sh; do
0056     if [ -r $i ]; then
0057       . $i
0058     fi
0059   done
0060   unset i
0061 fi
0062 EOF
0063 
0064 RUN cat /etc/bash.nonint >> /etc/bash.bashrc
0065 
0066 ENV BASH_ENV=/etc/bash.nonint
0067 ENV OPTICKS_PREFIX=/opt/eic-opticks
0068 ENV OPTICKS_HOME=/workspaces/eic-opticks
0069 ENV OPTICKS_BUILD=/opt/eic-opticks/build
0070 ENV LD_LIBRARY_PATH=${OPTICKS_PREFIX}/lib:${LD_LIBRARY_PATH}
0071 ENV VIRTUAL_ENV=${OPTICKS_HOME}/.venv
0072 ENV PATH=${OPTICKS_PREFIX}/bin:${VIRTUAL_ENV}/bin:${PATH}
0073 ENV NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility
0074 
0075 WORKDIR $OPTICKS_HOME
0076 
0077 # Install Python dependencies
0078 COPY pyproject.toml uv.lock $OPTICKS_HOME/
0079 COPY optiphy $OPTICKS_HOME/optiphy
0080 RUN uv sync
0081 
0082 
0083 FROM base AS release
0084 
0085 ARG CMAKE_BUILD_JOBS
0086 
0087 COPY . $OPTICKS_HOME
0088 
0089 RUN cmake -S $OPTICKS_HOME -B $OPTICKS_BUILD -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX -DCMAKE_BUILD_TYPE=Release \
0090  && cmake --build $OPTICKS_BUILD --parallel "${CMAKE_BUILD_JOBS:-$(nproc)}" --target install
0091 
0092 
0093 FROM base AS develop
0094 
0095 ARG CMAKE_BUILD_JOBS
0096 
0097 RUN apt update && apt install -y x11-apps mesa-utils vim
0098 
0099 COPY . $OPTICKS_HOME
0100 
0101 RUN cmake -S $OPTICKS_HOME -B $OPTICKS_BUILD -DCMAKE_INSTALL_PREFIX=$OPTICKS_PREFIX -DCMAKE_BUILD_TYPE=Debug \
0102  && cmake --build $OPTICKS_BUILD --parallel "${CMAKE_BUILD_JOBS:-$(nproc)}" --target install