Skip to content

Commit

Permalink
First attempt at just building it
Browse files Browse the repository at this point in the history
  • Loading branch information
EinarElen committed Jan 24, 2024
1 parent 9803801 commit 1615224
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,44 @@ RUN install-ubuntu-packages \
cmake-curses-gui \
gdb \
libasan8 \
lld
lld \
rsync # Required for Pythia8's make install command
ENV PYTHIA_VERSION="8.310"
ENV PYTHIA_MAJOR_VERSION=8
LABEL pythia8.version=${PYTHIA8_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} ) &&\
RUN mkdir src && \
git clone https://gitlab.com/Pythia8/releases/ --single-branch --branch pythia8310 pythia8 && \
cd pythia8 && ./configure --cxx-common="-O3 -g -std=c++17" --prefix ${__prefix} && \
make -j${NPROC} && \
make install && \
cd ../ && rm -rf src
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
# add any ssl certificates to the container to trust
COPY ./certs/ /usr/local/share/ca-certificates
Expand Down

0 comments on commit 1615224

Please sign in to comment.