Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ed8f2d3
updates to GENIE for reweight/updated container
wesketchum Sep 14, 2023
340a75e
Merge branch 'main' of https://github.com/LDMX-Software/docker
wesketchum Sep 14, 2023
a8eda4b
missed a line on the merge conflict
wesketchum Sep 14, 2023
274fbe1
updates for GENIE with pythia8 and reweight
wesketchum Sep 28, 2023
fff90a3
Merge branch 'main' of https://github.com/wesketchum/ldmxsw_docker
wesketchum Sep 28, 2023
8fd6c80
Merge branch 'main' of https://github.com/LDMX-Software/docker
wesketchum Jan 7, 2024
d092470
Merge remote-tracking branch 'ldmx/main'
wesketchum Feb 21, 2024
88fe974
updates to use hepmc3 as a medium for storing the GENIE event informa…
wesketchum May 2, 2024
e76a8e4
updates for reweight, and pyhepmc3
wesketchum Jul 25, 2024
f3275d4
Update OS to Ubuntu 24.04 and ROOT to 6.32.04
tvami Sep 24, 2024
ec924e1
Merge branch 'main' of https://github.com/LDMX-Software/docker into w…
wesketchum Oct 8, 2024
faf2f4a
update genie downloads to be based on set tags
wesketchum Oct 16, 2024
1050f15
restore manual building of ROOT and Pythia for C++20
tomeichlersmith Jan 28, 2025
ecc26b3
remove development layer naming
tomeichlersmith Jan 28, 2025
b46aba5
blindly re-enable LHAPDF and GENIE
tomeichlersmith Jan 29, 2025
4d3efe2
bump ROOT to RNTuple standardized 6.34
tomeichlersmith Jan 30, 2025
5daca69
updates for removing Pythia6
wesketchum Feb 19, 2025
3158df3
Merge remote-tracking branch 'ldmx/iss102-os-update' into wketchum_HE…
wesketchum Feb 19, 2025
d849cfe
bump patch of ROOT built, include geom target
tomeichlersmith Feb 21, 2025
ee74eb2
cant comment in Dockerfile like a script :angry:
tomeichlersmith Feb 21, 2025
944e3ff
update root options to work with genie build
wesketchum Feb 24, 2025
b125a30
Merge remote-tracking branch 'ldmx/iss102-os-update' into wketchum_HE…
wesketchum Feb 24, 2025
1d8cacc
update pythia8 and lhapdf minor versions, use tagged GENIE from weske…
wesketchum Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 81 additions & 83 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

FROM ubuntu:22.04
LABEL ubuntu.version="22.04"
MAINTAINER Tom Eichlersmith <eichl008@umn.edu>
FROM ubuntu:24.04
LABEL maintainer="Tom Eichlersmith <eichl008@umn.edu>, Tamas Almos Vami <Tamas.Almos.Vami@cern.ch>"
LABEL ubuntu.version="24.04"

ARG NPROC=1

Expand Down Expand Up @@ -50,7 +49,10 @@ RUN install-ubuntu-packages \
sudo \
time \
util-linux \
zsh
zsh \
libx11-dev \
libxmu-dev \
&& rm -rf /var/lib/apt/lists/*

# Basic python support, necessary for the build steps.
#
Expand All @@ -68,10 +70,10 @@ RUN install-ubuntu-packages \
#
# Adapted from acts-project/machines
###############################################################################
ENV __wget wget -q -O -
ENV __wget="wget -q -O -"
ENV __untar_to="tar -xz --strip-components=1 --directory"
ENV __untar="${__untar_to} src"
ENV __prefix /usr/local
ENV __prefix="/usr/local"

# this directory is where folks should "install" code compiled with the container
# i.e. folks should mount a local install directory to /externals so that the
Expand All @@ -86,9 +88,8 @@ ENV CMAKE_PREFIX_PATH="${EXTERNAL_INSTALL_DIR}:${__prefix}"
# Xerces-C
# Used by Geant4 to parse GDML
################################################################################
ENV XERCESC_VERSION="3.2.4"
ENV XERCESC_VERSION="3.3.0"
LABEL xercesc.version=${XERCESC_VERSION}
#LABEL xercesc.version="3.2.4"
RUN mkdir src &&\
${__wget} http://archive.apache.org/dist/xerces/c/3/sources/xerces-c-${XERCESC_VERSION}.tar.gz |\
${__untar} &&\
Expand All @@ -97,55 +98,38 @@ RUN mkdir src &&\
rm -rf src

###############################################################################
# PYTHIA6
#
# Needed for GENIE. Needs to be linked with ROOT.
# LHAPDF
#
# Looks complicated? Tell me about it.
# Core of what's done follows from here:
# https://root-forum.cern.ch/t/root-with-pythia6-and-pythia8/19211
# (1) Download pythia6 build tarball from ROOT. Known to lead to a build that can work with ROOT.
# (2) Download the latest Pythia6 (6.4.2.8) from Pythia. Yes, it's still ancient.
# (3) Declare extern some definitions that need to be extern via sed.
# Compiler/linker warns. Hard-won solution.
# (4) Build with C and FORTRAN the various pieces.
# (5) Put everything in a directory in the install area, and cleanup.
# Needed for GENIE
#
# (Ideally GENIE works with Pythia8? But not sure that works yet despite the adverts that it does.)
#
# - We disable the python subpackage because it is based on Python2 whose
# executable has been removed from Ubuntu 22.04.
###############################################################################
ENV PYTHIA_VERSION="6.428"
ENV PREVIOUS_PYTHIA_VERSION="6.416"
ENV PYTHIA_MAJOR_VERSION=6
LABEL pythia.version=${PYTHIA_VERSION}
#"6.428"
# Pythia uses an un-dotted version file naming convention. To deal with that
# we need some string manipulation and exports that work best with bash
SHELL ["/bin/bash", "-c"]
#ENV PYTHIA_MAJOR_VERSION=$(awk '{print int($1) }' <<< ${PYTHIA_VERSION} )
# export PYTHIA_MAJOR_VERSION=$(awk '{print int($1) }' <<< ${PYTHIA_VERSION} ) &&\
LABEL lhapdf.version="6.5.5"
RUN mkdir src &&\
${__wget} https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.5.5.tar.gz |\
${__untar} &&\
cd src &&\
./configure --disable-python --prefix=${__prefix} &&\
make -j$NPROC install &&\
cd ../ &&\
rm -rf src

###############################################################################
# PYTHIA8
###############################################################################
RUN install-ubuntu-packages \
rsync

LABEL pythia.version="8.313"
RUN mkdir src && \
export PYTHIA_VERSION_INTEGER=$(awk '{print $1*1000}' <<< ${PYTHIA_VERSION} ) &&\
export PREVIOUS_PYTHIA_VERSION_INTEGER=$(awk '{print $1*1000}' <<< ${PREVIOUS_PYTHIA_VERSION} ) &&\
${__wget} https://root.cern.ch/download/pythia${PYTHIA_MAJOR_VERSION}.tar.gz | ${__untar} &&\
wget --no-check-certificate https://pythia.org/download/pythia${PYTHIA_MAJOR_VERSION}/pythia${PYTHIA_VERSION_INTEGER}.f &&\
mv pythia${PYTHIA_VERSION_INTEGER}.f src/pythia${PYTHIA_VERSION_INTEGER}.f && rm -rf src/pythia${PREVIOUS_PYTHIA_VERSION_INTEGER}.f &&\
cd src/ &&\
sed -i 's/int py/extern int py/g' pythia${PYTHIA_MAJOR_VERSION}_common_address.c && \
sed -i 's/extern int pyuppr/int pyuppr/g' pythia${PYTHIA_MAJOR_VERSION}_common_address.c && \
sed -i 's/char py/extern char py/g' pythia${PYTHIA_MAJOR_VERSION}_common_address.c && \
echo 'void MAIN__() {}' >main.c && \
gcc -c -fPIC -shared main.c -lgfortran && \
gcc -c -fPIC -shared pythia${PYTHIA_MAJOR_VERSION}_common_address.c -lgfortran && \
gfortran -c -fPIC -shared pythia*.f && \
gfortran -c -fPIC -shared -fno-second-underscore tpythia${PYTHIA_MAJOR_VERSION}_called_from_cc.F && \
gfortran -shared -Wl,-soname,libPythia${PYTHIA_MAJOR_VERSION}.so -o libPythia${PYTHIA_MAJOR_VERSION}.so main.o pythia*.o tpythia*.o &&\
mkdir -p ${__prefix}/pythia${PYTHIA_MAJOR_VERSION} && cp -r * ${__prefix}/pythia${PYTHIA_MAJOR_VERSION}/ &&\
cd ../ && rm -rf src &&\
echo "${__prefix}/pythia${PYTHIA_MAJOR_VERSION}/" > /etc/ld.so.conf.d/pythia${PYTHIA_MAJOR_VERSION}.conf

SHELL ["/bin/sh", "-c"]
${__wget} https://pythia.org/download/pythia83/pythia8313.tgz | ${__untar} &&\
cd src &&\
./configure --with-lhapdf6 --prefix=${__prefix} &&\
make -j$NPROC install &&\
cd ../ &&\
rm -rf src

###############################################################################
# CERN's ROOT
# Needed for GENIE and serialization within the Framework
Expand Down Expand Up @@ -182,7 +166,6 @@ RUN install-ubuntu-packages \
libjpeg-dev \
liblz4-dev \
liblzma-dev \
libpcre++-dev \
libpng-dev \
libx11-dev \
libxext-dev \
Expand All @@ -195,36 +178,33 @@ RUN install-ubuntu-packages \
srm-ifce-dev \
libgsl-dev # Necessary for GENIE

ENV ROOT_VERSION="6.22.08"
ENV ROOT_VERSION="6.34.04"
LABEL root.version=${ROOT_VERSION}
RUN mkdir src &&\
${__wget} https://root.cern/download/root_v${ROOT_VERSION}.source.tar.gz |\
${__untar} &&\
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_INSTALL_PREFIX=${__prefix} \
-DCMAKE_INSTALL_LIBDIR=lib \
-Dgnuinstall=ON \
-Dgminimal=ON \
-Dasimage=ON \
-Dgeom=ON \
-Dgdml=ON \
-Dopengl=ON \
-Dpyroot=ON \
-Dxrootd=OFF \
-Dgsl_shared=ON \
-Dmathmore=ON \
-Dpythia6=ON \
-DPYTHIA6_LIBRARY=${__prefix}/pythia6/libPythia6.so \
-Dpythia8=ON \
-B build \
-S src \
&& cmake --build build --target install -j$NPROC &&\
rm -rf build src &&\
ldconfig
ENV ROOTSYS=${__prefix}
ENV PYTHONPATH=${ROOTSYS}/lib:${PYTHONPATH}
ENV JUPYTER_PATH=${ROOTSYS}/etc/notebook:${JUPYTER_PATH}
ENV JUPYTER_CONFIG_DIR=${ROOTSYS}/etc/notebook:${JUPYTER_CONFIG_DIR}
ENV CLING_STANDARD_PCH=none

###############################################################################
Expand Down Expand Up @@ -271,6 +251,7 @@ ENV G4ABLADATA="${G4DATADIR}/G4ABLA3.0"
ENV G4INCLDATA="${G4DATADIR}/G4INCL1.0"
ENV G4ENSDFSTATEDATA="${G4DATADIR}/G4ENSDFSTATE1.2.3"
ENV G4NEUTRONXSDATA="${G4DATADIR}/G4NEUTRONXS1.4"

################################################################################
# Install Eigen headers into container
#
Expand All @@ -295,24 +276,31 @@ RUN mkdir src &&\
rm -rf src

###############################################################################
# LHAPDF
# Install HEPMC for use as in interface with GENIE
#
# Needed for GENIE
#
# - We disable the python subpackage because it is based on Python2 whose
# executable has been removed from Ubuntu 22.04.
###############################################################################
ENV LHAPDF_VERSION="6.5.3"
LABEL lhapdf.version=${LHAPDF_VERSION}
ENV HEPMC3=3.3.0
LABEL hepmc3.version="${HEPMC3}"
RUN mkdir src &&\
${__wget} https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_VERSION}.tar.gz |\
${__wget} http://hepmc.web.cern.ch/hepmc/releases/HepMC3-${HEPMC3}.tar.gz |\
${__untar} &&\
cd src &&\
./configure --disable-python --prefix=${__prefix} &&\
make -j$NPROC install &&\
cd ../ &&\
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DHEPMC3_ENABLE_ROOTIO:BOOL=ON \
# -DHEPMC3_ENABLE_PROTOBUFIO:BOOL=ON \
-DHEPMC3_ENABLE_TEST:BOOL=OFF \
-DHEPMC3_INSTALL_INTERFACES:BOOL=ON \
-DHEPMC3_BUILD_STATIC_LIBS:BOOL=ON \
-DHEPMC3_BUILD_DOCS:BOOL=OFF \
-DHEPMC3_ENABLE_PYTHON:BOOL=ON \
-DHEPMC3_PYTHON_VERSIONS=3.10 \
-B src/build \
-S src \
&&\
cmake --build src/build --target install -j$NPROC && \
rm -rf src


###############################################################################
# GENIE
#
Expand Down Expand Up @@ -344,33 +332,43 @@ RUN install-ubuntu-packages \
liblog4cpp5-dev \
libtool


ENV GENIE_VERSION=3.02.00
#ENV GENIE_REWEIGHT_VERSION=1_02_00
LABEL genie.version=3.04.02
ENV GENIE_VERSION=3_04_02-ldmx
ENV GENIE=/usr/local/src/GENIE/Generator
#ENV GENIE_DOT_VERSION="$(sed 's,_,\.,g' <<< $GENIE_VERSION )"
LABEL genie.version=${GENIE_VERSION}

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

RUN mkdir -p ${GENIE} &&\
export ENV GENIE_GET_VERSION="$(sed 's,\.,_,g' <<< $GENIE_VERSION )" &&\
${__wget} https://github.com/GENIE-MC/Generator/archive/refs/tags/R-${GENIE_GET_VERSION}.tar.gz |\
#export ENV GENIE_GET_VERSION="$(sed 's,\.,_,g' <<< $GENIE_VERSION )" &&\
${__wget} https://github.com/wesketchum/Generator/archive/refs/tags/R-${GENIE_VERSION}.tar.gz |\
${__untar_to} ${GENIE} &&\
cd ${GENIE} &&\
./configure \
--enable-lhapdf6 \
--disable-lhapdf5 \
--enable-gfortran \
--with-gfortran-lib=/usr/x86_64-linux-gnu/ \
--disable-pythia8 \
--with-pythia6-lib=${__prefix}/pythia6 \
--disable-pythia6 \
--enable-pythia8 \
--with-pythia8-lib=${__prefix}/lib \
--enable-test \
--enable-hepmc3 \
--with-hepmc3-lib=/usr/local/lib \
--with-hepmc3-inc=/usr/local/include \
&& \
make -j$NPROC && \
make -j$NPROC install

SHELL ["/bin/sh", "-c"]
ENV GENIE_REWEIGHT_VERSION=1_04_00
ENV GENIE_REWEIGHT=/usr/local/src/GENIE/Reweight
RUN mkdir -p ${GENIE_REWEIGHT} &&\
#export ENV GENIE_REWEIGHT_GET_VERSION="$(sed 's,\.,_,g' <<< $GENIE_REWEIGHT_VERSION )" &&\
${__wget} https://github.com/GENIE-MC/Reweight/archive/refs/tags/R-${GENIE_REWEIGHT_VERSION}.tar.gz |\
${__untar_to} ${GENIE_REWEIGHT} &&\
cd ${GENIE_REWEIGHT} &&\
make -j$NPROC && \
make -j$NPROC install

###############################################################################
# Catch2
Expand Down Expand Up @@ -444,7 +442,7 @@ RUN ldconfig -v
# Extra python packages for analysis
###############################################################################
COPY ./python_packages.txt /etc/python_packages.txt
RUN python3 -m pip install --no-cache-dir --requirement /etc/python_packages.txt
RUN python3 -m pip install --no-cache-dir --break-system-packages --requirement /etc/python_packages.txt

# Dependencies for LDMX-sw and/or the container environment
RUN install-ubuntu-packages \
Expand Down
4 changes: 2 additions & 2 deletions ldmx-env-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export PYTHONPATH="${LDMX_SW_INSTALL}/python:${LDMX_SW_INSTALL}/lib:${PYTHONPATH
export PATH="${LDMX_SW_INSTALL}/bin:${PATH}"

#add what we need for GENIE
export LD_LIBRARY_PATH="${GENIE}/lib:/usr/local/pythia6:${LD_LIBRARY_PATH}"
export PATH="${GENIE}/bin:${PATH}"
export LD_LIBRARY_PATH="${GENIE}/lib:${GENIE_REWEIGHT}/lib:/usr/local/pythia6:${LD_LIBRARY_PATH}"
export PATH="${GENIE}/bin:${GENIE_REWEIGHT}/bin:${PATH}"

# Developer option: If a custom geant4 install is to be used, source the
# environment script from that install
Expand Down
57 changes: 29 additions & 28 deletions python_packages.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
contourpy==1.0.6
cycler==0.11.0
Cython==0.29.32
fonttools==4.38.0
joblib==1.2.0
kiwisolver==1.4.4
llvmlite==0.39.1
matplotlib==3.6.2
mplhep==0.3.26
mplhep-data==0.0.3
numba==0.56.4
numpy==1.21.5
packaging==21.3
pandas==1.5.2
Pillow==9.3.0
pip==22.0.2
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2022.6
scikit-learn==1.1.3
scipy==1.9.3
setuptools==59.6.0
six==1.16.0
threadpoolctl==3.1.0
uhi==0.3.2
uproot==4.3.7
wheel==0.37.1
xgboost==1.7.1
contourpy
cycler
Cython
fonttools
joblib
kiwisolver
llvmlite
matplotlib
mplhep
mplhep-data
numba
numpy
packaging
pandas
Pillow
pip
pyparsing
python-dateutil
pytz
scikit-learn
scipy
setuptools
six
threadpoolctl
uhi
uproot
wheel
xgboost
pyhepmc
Loading