Commit 80bc2891 authored by Simon Braß's avatar Simon Braß
Browse files

Update URLS. Handle HepMC2 in a special way.

parent d877920e
Pipeline #7094 passed with stage
in 37 minutes and 1 second
......@@ -24,28 +24,53 @@ url_automake="http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz"
url_libtool="http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz"
# O'Caml
url_ocaml="http://caml.inria.fr/pub/distrib/ocaml-4.04/ocaml-4.04.0.tar.gz"
url_ocaml="http://caml.inria.fr/pub/distrib/ocaml-4.09/ocaml-4.09.0.tar.gz"
# Whizard External Dependencies
url_hepmc="http://lcgapp.cern.ch/project/simu/HepMC/download/HepMC-2.06.09.tar.gz"
url_lhapdf="https://www.hepforge.org/archive/lhapdf/LHAPDF-6.2.1.tar.gz"
#url_lhapdf=http://www.hepforge.org/archive/lhapdf/lhapdf-5.9.1.tar.gz
url_fastjet="http://fastjet.fr/repo/fastjet-3.3.1.tar.gz"
url_openloops="http://www.hepforge.org/archive/openloops/OpenLoops-1.3.1.tar.gz"
url_pythia8="http://home.thep.lu.se/~torbjorn/pythia8/pythia8235.tgz"
url_hepmc="https://hepmc.web.cern.ch/hepmc/releases/hepmc2.06.10.tgz"
dir_hepmc="HepMC-2.06.10" # The HepMC packages comes with an enstranged nomenclature.
url_lhapdf="https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.2.3.tar.gz"
url_fastjet="http://fastjet.fr/repo/fastjet-3.3.2.tar.gz"
url_openloops="https://openloops.hepforge.org/downloads?f=OpenLoops-2.1.0.tar.gz"
url_pythia8="http://home.thep.lu.se/~torbjorn/pythia8/pythia8243.tgz"
# WHIZARD
url_whizard_git="git@gitlab.tp.nt.uni-siegen.de:whizard/development.git"
url_whizard="http://www.hepforge.org/archive/whizard/whizard-2.6.4.tar.gz"
# Analysis Tools
url_rivet="http://rivet.hepforge.org/hg/bootstrap/raw-file/2.6.0/rivet-bootstrap"
url_rivet="http://rivet.hepforge.org/hg/bootstrap/raw-file/3.0.2/rivet-bootstrap"
########################################################################
function fetch_pkg_filename () {
local url="${1}"
# --spider: test whether file exists (do not download)
# -S: print response header
# We expect an content-description with the field fielname (HepForge).
wget -S --spider "${url}" 2>&1 | grep -e 'filename' | cut -d'=' -f2
}
# The actual basename of package is quite cumbersome:
# 1. HepForge uses downloads by HTTP requests, i.e. the filename does not match the basename of the URL,
# 2. Most packages follow along the standard line: naming their archives in them same way as they do for the archived directory.
# However, there are some deviant packages and they do other things.
# We have to cover them.
function basename_pkg () {
local url="${1}"
local suffix="${2:-.tar.gz}"
# \todo{sbrass: Implement this.}
if ! grep -q "hepforge" <<< "${url}"; then
basename "${url}" "${suffix}"
else
fetch_pkg_filename "${url}" | xargs basename -s .tar.gz
fi
}
function download_untar_pkg () {
local url="${1}"
wget --no-check-certificate --no-verbose "${url}" -O- | tar xz;
# --content-disposition: Use filename from HTTPS header, if available.
wget -q --content-disposition "${url}" -O- | tar xz
}
function make_make_install () {
......@@ -61,10 +86,23 @@ function make_make_install () {
build_generic () {
local url="${1}"
local config="${2:-}"
local name="$(basename ${url} .tar.gz)"
local name="$(basename_pkg ${url} .tar.gz)"
test -d "${name}" || download_untar_pkg "${url}"
cd "${name}" && \
make_make_install "${config}" && \
cd "${BUILD}"
}
build_hepmc () {
local url="${1}"
local config="${2}"
local name="${dir_hepmc}"
test -d "${name}" || download_untar_pkg "${url}"
cd "${name}" && \
make_make_install "${config}"
./bootstrap && \
make_make_install "${config}" && \
# Ignore their warning about in src builds.
cd "${BUILD}"
}
build_ocaml () {
......@@ -75,12 +113,12 @@ build_ocaml () {
./configure -prefix ${PREFIX} && \
make world.opt && \
make install && \
cd -
cd "${BUILD}"
}
build_openloops () {
local url="${1}"
local name="$(basename ${url} .tar.gz)"
local name="$(basename_pkg ${url} .tar.gz)"
local dirname="OpenLoops"
test -d "${PREFIX}" || mkdir -p "${PREFIX}"
cd ${PREFIX} && \
......@@ -99,7 +137,8 @@ build_pythia8 () {
name="$(basename ${url} .tgz)"
test -d "${name}" || download_untar_pkg "${url}"
cd "${name}" && \
make_make_install "${config}"
make_make_install "${config}" && \
cd "${BUILD}"
}
build_rivet () {
......@@ -122,7 +161,7 @@ build_rivet () {
mv "${PREFIX}/rivetenv.csh" "${PREFIX}/bin" && \
mv "${PREFIX}/rivetenv.sh" "${PREFIX}/bin" && \
mv "${PREFIX}/yodaenv.sh" "${PREFIX}/bin" && \
cd -
cd "${BUILD}"
}
# Download and build package with NAME from URL, log the progress to LOGDIR/NAME.log.
......@@ -140,6 +179,20 @@ build_and_log () {
fi
}
build_and_log_hepmc () {
local name="${1}"
local url="${2}"
local config="${3:-}"
echo "Build ${name} ... " && \
build_hepmc "${url}" "${config}" 2>&1 1>"${LOG}/${name}.log"
if test $? -eq 0; then
echo "... finished."
else
echo "... failed. See ${LOG}/${name}.log."
exit 2
fi
}
build_and_log_ocaml () {
local url="${1}"
local name="OCaml"
......@@ -238,7 +291,8 @@ function help() {
echo " - whizard-config : Print WHIZARD configuration flags."
echo
echo "Environment variables:"
echo " - FORCE [False|True]"
echo " - FORCE [False|True] Force build of autotools, although the underlying system provides them."
echo " - DEBUG [False|True]"
}
########################################################################
......@@ -302,7 +356,7 @@ function main() {
;;
hepmc)
CONFIG="${HEPMC_CONFIG[@]}"
build_and_log "HepMC2" "${url_hepmc}" "${CONFIG}"
build_and_log_hepmc "HepMC2" "${url_hepmc}" "${CONFIG}"
;;
lhapdf)
CONFIG="${LHAPDF_CONFIG[@]}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment