Skip to content
Snippets Groups Projects
Forked from atlas / athena
85982 commits behind the upstream repository.
  • Attila Krasznahorkay's avatar
    d4b46804
    Updated all projects to atlasexternals-2.0.72. · d4b46804
    Attila Krasznahorkay authored
    At the same time, since the new tag uses LCG_97apython3_ATLAS_1 by default
    for all LCG based projects, removed the overrides from the build_externals.sh
    scripts of all projects for forcing the usage of LCG_97a_ATLAS_1.
    
    Also updated the Athena configuration to use the TDAQ installations compatible
    with Python 3 instead of Python 2.7, and removed the NumPy environment setup
    from the project. Since with LCG_97a we don't need that anymore.
    d4b46804
    History
    Updated all projects to atlasexternals-2.0.72.
    Attila Krasznahorkay authored
    At the same time, since the new tag uses LCG_97apython3_ATLAS_1 by default
    for all LCG based projects, removed the overrides from the build_externals.sh
    scripts of all projects for forcing the usage of LCG_97a_ATLAS_1.
    
    Also updated the Athena configuration to use the TDAQ installations compatible
    with Python 3 instead of Python 2.7, and removed the NumPy environment setup
    from the project. Since with LCG_97a we don't need that anymore.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build_externals.sh 3.20 KiB
#!/bin/bash
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Script building all the externals necessary for the nightly build.
#

# Stop on errors:
set -e

# Function printing the usage information for the script
usage() {
    echo "Usage: build_externals.sh [-t build_type] [-b build_dir] [-f] [-c] [-x]"
    echo " -f: Force rebuild of externals, otherwise if script"
    echo "     finds an external build present it will simply exit"
    echo " -c: Build the externals for the continuous integration (CI) system,"
    echo "     skipping the build of the externals RPMs."
    echo " -x: Extra cmake argument(s) to provide for the build(configuration)"
    echo "     of all externals needed by Athena."
    echo "If a build_dir is not given the default is '../build'"
    echo "relative to the athena checkout"
}

# Parse the command line arguments:
BUILDDIR=""
BUILDTYPE="RelWithDebInfo"
FORCE=""
CI=""
EXTRACMAKE=()
while getopts ":t:b:fch" opt; do
    case $opt in
        t)
            BUILDTYPE=$OPTARG
            ;;
        b)
            BUILDDIR=$OPTARG
            ;;
        f)
            FORCE="1"
            ;;
        c)
            CI="1"
            ;;
        x)
            EXTRACMAKE+=($OPTARG)
            ;;
        h)
            usage
            exit 0
            ;;
        :)
            echo "Argument -$OPTARG requires a parameter!"
            usage
            exit 1
            ;;
        ?)
            echo "Unknown argument: -$OPTARG"
            usage
            exit 1
            ;;
    esac
done

# We are in BASH, get the path of this script in a simple way:
thisdir=$(dirname ${BASH_SOURCE[0]})
thisdir=$(cd ${thisdir};pwd)

# Go to the main directory of the repository:
cd ${thisdir}/../..

# Check if the user specified any source/build directories:
if [ "$BUILDDIR" = "" ]; then
    BUILDDIR=${thisdir}/../../../build
fi
mkdir -p ${BUILDDIR}
BUILDDIR=$(cd $BUILDDIR; pwd)

if [ "$FORCE" = "1" ]; then
    echo "Force deleting existing build area..."
    rm -fr ${BUILDDIR}/install/VP1LightExternals
    rm -fr ${BUILDDIR}/src/VP1LightExternals
    rm -fr ${BUILDDIR}/build/VP1LightExternals
fi

# Create some directories:
mkdir -p ${BUILDDIR}/install

# Get the version of VP1Light for the build.
version=`cat ${thisdir}/version.txt`

# The directory holding the helper scripts:
scriptsdir=${thisdir}/../../Build/AtlasBuildScripts
scriptsdir=$(cd ${scriptsdir}; pwd)

# Flag for triggering the build of RPMs for the externals:
RPMOPTIONS="-r ${BUILDDIR}"
if [ "$CI" = "1" ]; then
    RPMOPTIONS=
fi

# Read in the tag/branch to use for VP1LightExternals:
VP1LightExternalsVersion=$(awk '/^VP1LightExternalsVersion/{print $3}' ${thisdir}/externals.txt)

# Check out VP1LightExternals from the right branch/tag:
${scriptsdir}/checkout_atlasexternals.sh \
    -t ${VP1LightExternalsVersion} \
    -s ${BUILDDIR}/src/VP1LightExternals

# Build VP1LightExternals:
export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/VP1LightExternals
${scriptsdir}/build_atlasexternals.sh \
    -s ${BUILDDIR}/src/VP1LightExternals \
    -b ${BUILDDIR}/build/VP1LightExternals \
    -i ${BUILDDIR}/install \
    -p VP1LightExternals ${RPMOPTIONS} -t ${BUILDTYPE} \
    -v ${version} \
    ${EXTRACMAKE[@]/#/-x }