Skip to content

Commit

Permalink
install opticks dependencies directly or via Spack
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Aug 1, 2024
1 parent 4e72453 commit 622994f
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG DEBIAN_FRONTEND=noninteractive
# Install Spack package manager
RUN apt update \
&& apt install -y build-essential ca-certificates coreutils curl environment-modules gfortran git gpg lsb-release python3 python3-distutils python3-venv unzip zip \
libglm-dev libglfw3-dev libimgui-dev libglew-dev libglu1-mesa-dev \
libssl-dev python-is-python3 \
cuda-nvcc-11-8 libcurand-dev-11-8 \
libxinerama-dev libxcursor-dev libxi-dev \
Expand All @@ -23,14 +22,21 @@ RUN echo "source /opt/spack/share/spack/setup-env.sh" > /etc/profile.d/z09_sourc

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

RUN <<EOF
spack install geant4
spack install boost+system+program_options+regex+filesystem
spack install cmake
spack install nlohmann-json
spack uninstall -f -y g4ndl
spack clean -a
EOF
RUN spack install geant4 \
&& spack uninstall -f -y g4ndl \
&& spack clean -a

RUN spack install boost+system+program_options+regex+filesystem \
&& spack install cmake \
&& spack install nlohmann-json \
&& spack clean -a

RUN spack install mesa ~llvm \
&& spack install glew \
&& spack install glfw \
&& spack install glm \
&& spack install glu \
&& spack clean -a

# Strip all the binaries
#RUN find -L /spack/opt/spack -type f -exec readlink -f '{}' \; | xargs file -i | grep 'charset=binary' | grep 'x-executable\|x-archive\|x-sharedlib' | awk -F: '{print $1}' | xargs strip -S
Expand All @@ -54,9 +60,15 @@ RUN sed -i 's/ autoload: direct/ autoload: none/g' /opt/spack/etc/s
RUN spack module tcl refresh -y
RUN cp -r /opt/spack/share/spack/modules/linux-ubuntu22.04-x86_64_v3 /opt/modules
RUN echo "module use --append /opt/modules" >> /etc/profile.d/z10_load_spack_modules.sh
RUN spack module tcl loads geant4 xerces-c clhep boost cmake nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh
RUN spack module tcl loads geant4 xerces-c clhep boost cmake mesa glew glfw glm glu nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh
RUN rm -fr /opt/spack/share/spack/modules/$linux-ubuntu22.04-x86_64_v3

RUN mkdir -p /opt/bcm && curl -sL https://github.com/boost-cmake/bcm/archive/refs/heads/master.tar.gz | tar -xz --strip-components 1 -C /opt/bcm \
&& cmake -B /tmp/build/bcm -S /opt/bcm && cmake --build /tmp/build/bcm --target install

RUN mkdir -p /opt/plog && curl -sL https://github.com/SergiusTheBest/plog/archive/refs/tags/1.1.10.tar.gz | tar -xz --strip-components 1 -C /opt/plog \
&& cmake -B /tmp/build/plog -S /opt/plog && cmake --build /tmp/build/plog --target install

# Set up non-interactive shells by sourcing all of the scripts in /et/profile.d/
RUN cat <<"EOF" > /etc/bash.nonint
if [ -d /etc/profile.d ]; then
Expand Down

0 comments on commit 622994f

Please sign in to comment.