Skip to content
Snippets Groups Projects
Commit dd5c58b9 authored by Attila Krasznahorkay's avatar Attila Krasznahorkay Committed by Adam Edward Barton
Browse files

Updated the build scripts for the new AtlasCMake behaviour.

This is how the CMake 3.15+ compatible version of our CMake
configuration has to be interacted with...
parent 47c92f5d
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 757 deletions
#!/bin/bash
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Script used for building Gaudi.
#
......@@ -14,7 +16,8 @@ set -o pipefail
usage() {
echo "Usage: build_Gaudi.sh <-s source dir> <-b build dir> " \
"<-i install dir> <-e externals dir> <-p externals project name> " \
"<-f platform name> [-r RPM dir] [-t build type] [-x extra CMake arguments]"
"<-f platform name> [-r RPM dir] [-t build type] [-v version] " \
"[-x extra CMake arguments]"
}
# Parse the command line arguments:
......@@ -26,8 +29,9 @@ EXTPROJECT=""
PLATFORM=""
RPMDIR=""
BUILDTYPE="Release"
PROJECTVERSION=""
EXTRACMAKE=()
while getopts ":s:b:i:e:p:f:r:t:x:h" opt; do
while getopts ":s:b:i:e:p:f:r:t:x:v:h" opt; do
case $opt in
s)
SOURCEDIR=$OPTARG
......@@ -56,6 +60,9 @@ while getopts ":s:b:i:e:p:f:r:t:x:h" opt; do
x)
EXTRACMAKE+=($OPTARG)
;;
v)
PROJECTVERSION=$OPTARG
;;
h)
usage
exit 0
......@@ -76,7 +83,7 @@ done
# Make sure that the required options were all specified:
if [ "$SOURCEDIR" = "" ] || [ "$BUILDDIR" = "" ] || [ "$INSTALLDIR" = "" ] \
|| [ "$EXTDIR" = "" ] || [ "$EXTPROJECT" = "" ] \
|| [ "$PLATFORM" = "" ]; then
|| [ "$PLATFORM" = "" ] || [ "$PROJECTVERSION" = "" ]; then
echo "Not all required parameters received!"
usage
exit 1
......@@ -89,8 +96,6 @@ cd ${BUILDDIR} || ((ERROR_COUNT++))
# Set up the externals project:
source ${EXTDIR}/setup.sh || ((ERROR_COUNT++))
#FIXME: simplify error counting below while keeping '| tee ...'
# Configure the build:
error_stamp=`mktemp .tmp.error.XXXXX` ; rm -f $error_stamp
{
......@@ -98,8 +103,8 @@ rm -f CMakeCache.txt
rm -rf * # Remove the full build temporarily, to fix GAUDI-1315
cmake -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} -DCTEST_USE_LAUNCHERS:BOOL=TRUE \
-DGAUDI_ATLAS:BOOL=TRUE -DGAUDI_ATLAS_BASE_PROJECT:STRING=${EXTPROJECT} \
-DCMAKE_INSTALL_PREFIX:PATH=/InstallArea/${PLATFORM} ${EXTRACMAKE[@]} \
${SOURCEDIR} || touch $error_stamp
-DCMAKE_INSTALL_PREFIX:PATH=/GAUDI/${PROJECTVERSION}/InstallArea/${PLATFORM} \
${EXTRACMAKE[@]} ${SOURCEDIR} || touch $error_stamp
} 2>&1 | tee cmake_config.log
test -f $error_stamp && ((ERROR_COUNT++))
rm -f $error_stamp
......
#!/bin/bash
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Example script used for building one of the projects from the atlasexternals
# repository.
#
......@@ -84,13 +86,9 @@ cd ${BUILDDIR} || ((ERROR_COUNT++))
# Extra settings for providing a project version for the build if necessary:
EXTRACONF=
if [ "$PROJECTVERSION" != "" ]; then
PNAME=$(echo ${PROJECT} | awk '{print toupper($0)}')
EXTRACONF=-D${PNAME}_PROJECT_VERSION:STRING=${PROJECTVERSION}
EXTRACONF=-DCMAKE_PROJECT_VERSION=${PROJECTVERSION}
fi
#FIXME: simplify error counting:
# Configure the build:
error_stamp=`mktemp .tmp.error.XXXXX` ; rm -f $error_stamp
{
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# This is the main CMakeLists.txt file for building the AnalysisBase
# software release.
#
# The minimum required CMake version:
cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
# Read in the project's version from a file called version.txt. But let it be
# overridden from the command line if necessary.
# Set up the project.
cmake_minimum_required( VERSION 3.6 )
file( READ ${CMAKE_SOURCE_DIR}/version.txt _version )
string( STRIP ${_version} _version )
set( ANALYSISBASE_PROJECT_VERSION ${_version}
CACHE STRING "Version of the AnalysisBase project to build" )
project( AnalysisBase VERSION ${_version} LANGUAGES C CXX )
unset( _version )
# This project is built on top of AnalysisBaseExternals:
......@@ -28,9 +25,8 @@ list( INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake )
# Set up CTest:
atlas_ctest_setup()
# Declare project name and version
atlas_project( AnalysisBase ${ANALYSISBASE_PROJECT_VERSION}
USE AnalysisBaseExternals ${AnalysisBaseExternals_VERSION}
# Set up the "ATLAS project".
atlas_project( USE AnalysisBaseExternals ${AnalysisBaseExternals_VERSION}
PROJECT_ROOT ${CMAKE_SOURCE_DIR}/../../ )
# Configure and install the post-configuration file:
......@@ -45,10 +41,6 @@ if( NOT "$ENV{NICOS_PROJECT_HOME}" STREQUAL "" )
get_filename_component( _buildDir $ENV{NICOS_PROJECT_HOME} PATH )
list( APPEND _replacements ${_buildDir} "\${AnalysisBase_DIR}/../../../.." )
endif()
if( NOT "$ENV{NICOS_PROJECT_RELNAME}" STREQUAL "" )
list( APPEND _replacements $ENV{NICOS_PROJECT_RELNAME}
"\${AnalysisBase_VERSION}" )
endif()
# Generate the environment configuration file(s):
lcg_generate_env(
......
#!/bin/bash
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Script for building the release on top of externals built using the
# script in this directory.
#
......@@ -156,7 +158,7 @@ fi
# Install the results:
if [ -n "$EXE_INSTALL" ]; then
_time_ make install/fast \
DESTDIR=${BUILDDIR}/install/AnalysisBase/${NICOS_PROJECT_VERSION} \
DESTDIR=${BUILDDIR}/install \
2>&1 | tee cmake_install.log
fi
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# This script sets up the build enironment for an AnalysisBase
# build, on top of a built set of externals.
#
......@@ -37,14 +39,14 @@ env_setup() {
BUILDDIR=${AnalysisBaseSrcDir}/../../../build
fi
# Get the version of AnalysisBase for the build.
version=`cat ${AnalysisBaseSrcDir}/version.txt`
# Set up the environment for the build:
export NICOS_PROJECT_VERSION=`cat ${AnalysisBaseSrcDir}/version.txt`
export NICOS_ATLAS_RELEASE=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_RELNAME=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AnalysisBase
export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/Athena
# Set up the AnalysisBaseExternals project:
extDir=${BUILDDIR}/install/AnalysisBaseExternals/${NICOS_PROJECT_VERSION}/InstallArea
extDir=${BUILDDIR}/install/AnalysisBaseExternals/${version}/InstallArea
if [ ! -d ${extDir} ]; then
echo "Didn't find the AnalysisBaseExternals project under ${extDir}"
fi
......
#!/bin/bash
#
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#
# Script building all the externals necessary for the nightly build.
#
......@@ -83,10 +85,8 @@ fi
# Create some directories:
mkdir -p ${BUILDDIR}/{src,install}
# Set some environment variables that the builds use internally:
export NICOS_PROJECT_VERSION=`cat ${thisdir}/version.txt`
export NICOS_ATLAS_RELEASE=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_RELNAME=${NICOS_PROJECT_VERSION}
# Get the version of AnalysisBase for the build.
version=`cat ${thisdir}/version.txt`
# The directory holding the helper scripts:
scriptsdir=${thisdir}/../../Build/AtlasBuildScripts
......@@ -114,6 +114,6 @@ export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AnalysisBaseExternals
${scriptsdir}/build_atlasexternals.sh \
-s ${BUILDDIR}/src/AnalysisBaseExternals \
-b ${BUILDDIR}/build/AnalysisBaseExternals \
-i ${BUILDDIR}/install/AnalysisBaseExternals/${NICOS_PROJECT_VERSION} \
-i ${BUILDDIR}/install \
-p AnalysisBaseExternals ${RPMOPTIONS} -t ${BUILDTYPE} \
-v ${NICOS_PROJECT_VERSION} ${EXTRACMAKE[@]/#/-x }
-v ${version} ${EXTRACMAKE[@]/#/-x }
......@@ -6,4 +6,4 @@
# forbidden.
# The version of atlas/atlasexternals to use:
AnalysisBaseExternalsVersion = 2.0.55
AnalysisBaseExternalsVersion = 2.0.56
22.0.3
22.0.9
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: AnalysisTopReleaseEnvironmentConfig.cmake 784551 2016-11-16 12:46:32Z krasznaa $
#
# This file holds the compile and runtime environment configuration specific
# for the analysis release.
#
# This is a standalone project, so set the appropriate compile flags:
add_definitions( -DROOTCORE )
add_definitions( -DXAOD_STANDALONE )
add_definitions( -DXAOD_ANALYSIS )
add_definitions( -DROOTCORE_RELEASE_SERIES=25 )
# And the same variables for CMake as well:
set( ROOTCORE TRUE CACHE BOOL
"Flag specifying that this is a \"RootCore\" release" )
set( XAOD_STANDALONE TRUE CACHE BOOL
"Flag specifying that this is a standalone build" )
set( XAOD_ANALYSIS TRUE CACHE BOOL
"Flag specifying that this is an analysis release" )
# Vatriable that should be picked up by the environment creation code:
set( AnalysisTopReleaseEnvironment_ENVIRONMENT
SET ROOTCOREDIR \${AnalysisTop_DIR}
SET ROOTCOREBIN \${AnalysisTop_DIR} )
# $Id: CMakeLists.txt 787093 2016-11-29 13:43:09Z krasznaa $
#
# This is the main CMakeLists.txt file for building the AnalysisTop
# software release.
#
# The minimum required CMake version:
cmake_minimum_required( VERSION 3.2 FATAL_ERROR )
# Read in the project's version from a file called version.txt. But let it be
# overridden from the command line if necessary.
file( READ ${CMAKE_SOURCE_DIR}/version.txt _version )
string( STRIP ${_version} _version )
set( ANALYSISBASE_PROJECT_VERSION ${_version}
CACHE STRING "Version of the AnalysisTop project to build" )
unset( _version )
# This project is built on top of AnalysisBaseExternals:
find_package( AnalysisBaseExternals REQUIRED )
# Find Python. This is needed because AnalysisBaseExternals sets up
# a wrong value for PYTHONHOME. And nothing in AnalysisBase builds
# against Python to correct it.
find_package( Python COMPONENTS Interpreter )
# Add the project's modules directory to CMAKE_MODULE_PATH:
list( INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/modules )
list( REMOVE_DUPLICATES CMAKE_MODULE_PATH )
# Install the files from modules/:
install( DIRECTORY ${CMAKE_SOURCE_DIR}/modules/
DESTINATION cmake/modules
USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE
PATTERN "*~" EXCLUDE )
# Include the AnalysisBase specific function(s) (probably no need to make AnalysisTop specific):
include( AnalysisBaseFunctions )
# Set up the build/runtime environment:
set( AnalysisTopReleaseEnvironment_DIR ${CMAKE_SOURCE_DIR} )
find_package( AnalysisTopReleaseEnvironment REQUIRED )
# Add the directory to the global include path, where the project
# will create the RootCore/Packages.h header:
include_directories( ${CMAKE_BINARY_DIR}/RootCore/include )
# Set up CTest:
atlas_ctest_setup()
# Declare project name and version
atlas_project( AnalysisTop ${ANALYSISTOP_PROJECT_VERSION}
USE AnalysisBaseExternals ${AnalysisBaseExternals_VERSION}
PROJECT_ROOT ${CMAKE_SOURCE_DIR}/../../ )
# Generate the RootCore/Packages.h header:
analysisbase_generate_release_header()
# Set up the load_packages.C script:
configure_file( ${CMAKE_SOURCE_DIR}/scripts/load_packages.C.in
${CMAKE_SCRIPT_OUTPUT_DIRECTORY}/load_packages.C @ONLY )
install( FILES ${CMAKE_SCRIPT_OUTPUT_DIRECTORY}/load_packages.C
DESTINATION ${CMAKE_INSTALL_SCRIPTDIR} )
# Configure and install the post-configuration file:
configure_file( ${CMAKE_SOURCE_DIR}/PostConfig.cmake.in
${CMAKE_BINARY_DIR}/PostConfig.cmake @ONLY )
install( FILES ${CMAKE_BINARY_DIR}/PostConfig.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} )
# Generate replacement rules for the installed paths:
set( _replacements )
if( NOT "$ENV{NICOS_PROJECT_HOME}" STREQUAL "" )
get_filename_component( _buildDir $ENV{NICOS_PROJECT_HOME} PATH )
list( APPEND _replacements ${_buildDir} "\${AnalysisTop_DIR}/../../../.." )
endif()
if( NOT "$ENV{NICOS_PROJECT_RELNAME}" STREQUAL "" )
list( APPEND _replacements $ENV{NICOS_PROJECT_RELNAME}
"\${AnalysisTop_VERSION}" )
endif()
# Generate the environment configuration file(s):
lcg_generate_env(
SH_FILE ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh )
lcg_generate_env(
SH_FILE ${CMAKE_BINARY_DIR}/env_setup_install.sh
REPLACE ${_replacements} )
install( FILES ${CMAKE_BINARY_DIR}/env_setup_install.sh
DESTINATION . RENAME env_setup.sh )
# Set up the release packaging:
atlas_cpack_setup()
# $Id: PostConfig.cmake.in 787191 2016-11-29 19:41:54Z krasznaa $
#
# File setting up some basic properties for the installed analysis releases.
#
# Make all compilation see the RootCore/Packages.h file:
include_directories( $ENV{AnalysisTop_DIR}/RootCore/include )
# This is a standalone project, so set the appropriate compile flags:
add_definitions( -DROOTCORE )
add_definitions( -DXAOD_STANDALONE )
add_definitions( -DXAOD_ANALYSIS )
add_definitions( -DROOTCORE_RELEASE_SERIES=$ENV{ROOTCORE_RELEASE_SERIES} )
# And some variables for CMake as well:
set( ROOTCORE TRUE CACHE BOOL
"Flag specifying that this is a \"RootCore\" release" )
set( XAOD_STANDALONE TRUE CACHE BOOL
"Flag specifying that this is a standalone build" )
set( XAOD_ANALYSIS TRUE CACHE BOOL
"Flag specifying that this is an analysis release" )
#!/bin/bash
#
# Script for building the release on top of externals built using the
# script in this directory.
#
_time_() { local c="time -p " ; while test "X$1" != "X" ; do c+=" \"$1\"" ; shift; done; ( eval "$c" ) 2>&1 | sed "s,^real[[:space:]],time::${c}:: real ," ; }
# Function printing the usage information for the script
usage() {
echo "Usage: build.sh [-t type] [-b dir] [-g generator] [-c] [-m] [-i] [-p] [-a]"
echo ""
echo " General flags:"
echo " -t: The (optional) CMake build type to use."
echo " -b: The (optional) build directory to use."
echo " -g: The (optional) CMake generator to use."
echo " -a: Abort on error."
echo " Build step selection:"
echo " -c: Execute the CMake step."
echo " -m: Execute the make/build step."
echo " -i: Execute the install step."
echo " -p: Execute the CPack step."
echo ""
echo " If none of the c, m, i or p options are set then the script will do"
echo " *all* steps. Otherwise only the enabled steps are run - it's your"
echo " reponsibility to ensure that precusors are in good shape"
}
# Parse the command line arguments:
BUILDDIR=""
BUILDTYPE="RelWithDebInfo"
GENERATOR="Unix Makefiles"
EXE_CMAKE=""
EXE_MAKE=""
EXE_INSTALL=""
EXE_CPACK=""
NIGHTLY=true
while getopts ":t:b:g:hcmipa" opt; do
case $opt in
t)
BUILDTYPE=$OPTARG
;;
b)
BUILDDIR=$OPTARG
;;
g)
GENERATOR=$OPTARG
;;
c)
EXE_CMAKE="1"
;;
m)
EXE_MAKE="1"
;;
i)
EXE_INSTALL="1"
;;
p)
EXE_CPACK="1"
;;
a)
NIGHTLY=false
;;
h)
usage
exit 0
;;
:)
echo "Argument -$OPTARG requires a parameter!"
usage
exit 1
;;
?)
echo "Unknown argument: -$OPTARG"
usage
exit 1
;;
esac
done
if [ -z "$EXE_CMAKE" -a -z "$EXE_MAKE" -a -z "$EXE_INSTALL" -a \
-z "$EXE_CPACK" ]; then
EXE_CMAKE="1"
EXE_MAKE="1"
EXE_INSTALL="1"
EXE_CPACK="1"
fi
# Stop on errors from here on out:
set -e
set -o pipefail
# Source in our environment
AnalysisTopSrcDir=$(dirname ${BASH_SOURCE[0]})
if [ -z "$BUILDDIR" ]; then
BUILDDIR=${AnalysisTopSrcDir}/../../../build
fi
mkdir -p ${BUILDDIR}
BUILDDIR=$(cd ${BUILDDIR} && pwd)
source $AnalysisTopSrcDir/build_env.sh -b $BUILDDIR >& ${BUILDDIR}/build_env.log
cat ${BUILDDIR}/build_env.log
# create the actual build directory
mkdir -p ${BUILDDIR}/build/AnalysisTop
cd ${BUILDDIR}/build/AnalysisTop
# CMake:
if [ -n "$EXE_CMAKE" ]; then
# Remove the CMakeCache.txt file, to force CMake to find externals
# from scratch in an incremental build.
rm -f CMakeCache.txt
# The package specific log files can only be generated with the Makefile
# and Ninja generators. Very notably it doesn't work with IDEs in general.
USE_LAUNCHERS=""
if [ "${GENERATOR}" = "Ninja" ] || [ "${GENERATOR}" = "Unix Makefiles" ]; then
USE_LAUNCHERS=-DCTEST_USE_LAUNCHERS:BOOL=TRUE
fi
# Now run the actual CMake configuration:
_time_ cmake -G "${GENERATOR}" \
-DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \
${USE_LAUNCHERS} \
${AnalysisTopSrcDir} 2>&1 | tee cmake_config.log
fi
# For nightly builds we want to get as far as we can:
if [ "$NIGHTLY" = true ]; then
# At this point stop worrying about errors:
set +e
fi
# Run the build:
if [ -n "$EXE_MAKE" ]; then
if [ "$NIGHTLY" = true ]; then
# In order to build the project in a nightly setup, allowing for some
# build steps to fail while still continuing, we need to use "make"
# directly. Only allowing the usage of the Makefile generator.
_time_ make -k 2>&1 | tee cmake_build.log
else
# However in a non-nightly setup we can just rely on CMake to start
# the build for us. In this case we can use any generator we'd like
# for the build. Notice however that the installation step can still
# be only done correctly by using GNU Make directly.
_time_ cmake --build . 2>&1 | tee cmake_build.log
fi
fi
# Install the results:
if [ -n "$EXE_INSTALL" ]; then
_time_ make install/fast \
DESTDIR=${BUILDDIR}/install/AnalysisTop/${NICOS_PROJECT_VERSION} \
2>&1 | tee cmake_install.log
fi
# Build an RPM for the release:
if [ -n "$EXE_CPACK" ]; then
_time_ cpack 2>&1 | tee cmake_cpack.log
FILES=$(ls AnalysisTop*.rpm AnalysisTop*.dmg AnalysisTop*.tar.gz)
cp ${FILES} ${BUILDDIR}/
fi
# This script sets up the build enironment for an AnalysisTop
# build, on top of a built set of externals.
#
# This script is kept separate from the build.sh
# wrapper so it can be sourced separately from it when
# clients want to manage their own build and just want
# to setup the build environment
env_usage() {
echo "Usage: build_env.sh [-b build dir]"
}
# This function actually sets up the environment for us
# (factorise it here in case it needs skipped)
env_setup() {
# As this script can be sourced we need to support zsh and
# possibly other Bourne shells
if [ "x${BASH_SOURCE[0]}" = "x" ]; then
# This trick should do the right thing under ZSH:
thisdir=$(dirname `print -P %x`)
if [ $? != 0 ]; then
echo "ERROR: This script must be sourced from BASH or ZSH"
return 1
fi
else
# The BASH solution is a bit more straight forward:
thisdir=$(dirname ${BASH_SOURCE[0]})
fi
AnalysisTopSrcDir=$(cd ${thisdir};pwd)
# The directory holding the helper scripts:
scriptsdir=${AnalysisTopSrcDir}/../../Build/AtlasBuildScripts
# Check if the user specified any source/build directories:
if [ "$BUILDDIR" = "" ]; then
BUILDDIR=${AnalysisTopSrcDir}/../../../build
fi
# Set up the environment for the build:
export NICOS_PROJECT_VERSION=`cat ${AnalysisTopSrcDir}/version.txt`
export NICOS_ATLAS_RELEASE=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_RELNAME=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AnalysisTop
# Set up the AnalysisBaseExternals project:
extDir=${BUILDDIR}/install/AnalysisBaseExternals/${NICOS_PROJECT_VERSION}/InstallArea
if [ ! -d ${extDir} ]; then
echo "Didn't find the AnalysisBaseExternals project under ${extDir}"
fi
echo "Setting up AnalysisBaseExternals from: ${extDir}"
source ${extDir}/*/setup.sh
}
# we need to reset the option index as we are sourcing this script
# http://stackoverflow.com/questions/23581368/bug-in-parsing-args-with-getopts-in-bash
OPTIND=1
# Parse the command line arguments:
BUILDDIR=""
while getopts "b:h" opt; do
case $opt in
b)
BUILDDIR=$OPTARG
;;
h)
env_usage
ABORT=1
;;
:)
echo "Argument -$OPTARG requires a parameter!"
env_usage
ABORT=1
;;
?)
echo "Unknown argument: -$OPTARG"
env_usage
ABORT=1
;;
esac
done
# Put a big wrapper around bad argument case, because
# a sourced script should not call "exit". This is quite
# annoying...
if [ -z "$ABORT" ]; then
env_setup
fi
#!/bin/bash
#
# 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]"
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 "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=""
while getopts ":t:b:fch" opt; do
case $opt in
t)
BUILDTYPE=$OPTARG
;;
b)
BUILDDIR=$OPTARG
;;
f)
FORCE="1"
;;
c)
CI="1"
;;
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/AnalysisBaseExternals
rm -fr ${BUILDDIR}/src/AnalysisBaseExternals
rm -fr ${BUILDDIR}/build/AnalysisBaseExternals
fi
# Create some directories:
mkdir -p ${BUILDDIR}/{src,install}
# Set some environment variables that the builds use internally:
export NICOS_PROJECT_VERSION=`cat ${thisdir}/version.txt`
export NICOS_ATLAS_RELEASE=${NICOS_PROJECT_VERSION}
export NICOS_PROJECT_RELNAME=${NICOS_PROJECT_VERSION}
# 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 AnalysisBaseExternals:
AnalysisBaseExternalsVersion=$(awk '/^AnalysisBaseExternalsVersion/{print $3}' ${thisdir}/externals.txt)
set -o pipefail
# Check out AnalysisBaseExternals from the right branch/tag:
${scriptsdir}/checkout_atlasexternals.sh \
-t ${AnalysisBaseExternalsVersion} \
-s ${BUILDDIR}/src/AnalysisBaseExternals 2>&1 | tee ${BUILDDIR}/src/checkout.AnalysisBaseExternals.log
# Build AnalysisBaseExternals:
export NICOS_PROJECT_HOME=$(cd ${BUILDDIR}/install;pwd)/AnalysisBaseExternals
${scriptsdir}/build_atlasexternals.sh \
-s ${BUILDDIR}/src/AnalysisBaseExternals \
-b ${BUILDDIR}/build/AnalysisBaseExternals \
-i ${BUILDDIR}/install/AnalysisBaseExternals/${NICOS_PROJECT_VERSION} \
-p AnalysisBaseExternals ${RPMOPTIONS} -t ${BUILDTYPE} \
-v ${NICOS_PROJECT_VERSION}
# Versions of the various externals to build before starting the build of
# this project, when doing a full stack nightly build.
AnalysisBaseExternalsVersion = 2.0.55
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: AnalysisBaseFunctions.cmake 787191 2016-11-29 19:41:54Z krasznaa $
#
# This module collects CMake functions that are useful when setting up an
# analysis release.
#
# Function generating a RootCore/Packages.h header
#
# This function should be called in the main CMakeLists.txt file of the
# project, after the atlas_project(...) call, in order to generate a header file
# called "RootCore/Packages.h", in the format that RootCore generates it in.
# With one define statement per package that was found in he release.
#
# Usage: analysisbase_generate_release_header()
#
function( analysisbase_generate_release_header )
# Get the list of packages that were found:
get_property( _packages GLOBAL PROPERTY ATLAS_EXPORTED_PACKAGES )
# Generate a "RootCore/Package.h" file, in the same format that
# RootCore does/did:
set( _packagesFileName
${CMAKE_BINARY_DIR}/RootCore/include/RootCore/Packages.h )
file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/RootCore/include/RootCore )
file( WRITE ${_packagesFileName}
"// Auto-generated file, please do not edit\n"
"#ifndef ROOTCORE_PACKAGES_H\n"
"#define ROOTCORE_PACKAGES_H\n\n" )
foreach( pkgname ${_packages} )
file( APPEND ${_packagesFileName}
"#define ROOTCORE_PACKAGE_${pkgname}\n" )
endforeach()
file( APPEND ${_packagesFileName} "\n#endif // not ROOTCORE_PACKAGES_H\n" )
unset( _packagesFileName )
unset( _packages )
# Install the header in the usual place:
install( DIRECTORY ${CMAKE_BINARY_DIR}/RootCore/include/
DESTINATION RootCore/include )
endfunction( analysisbase_generate_release_header )
#
# Packages to build as part of AnalysisBase:
#
+ AsgExternal/Asg_Test
+ AtlasTest/TestTools
+ Calorimeter/CaloGeoHelpers
+ Control/AthContainersInterfaces
+ Control/AthContainers
+ Control/AthLinksSA
+ Control/AthToolSupport/.*
+ Control/CxxUtils
+ Control/xAODRootAccess.*
+ DataQuality/GoodRunsLists
+ DetectorDescription/GeoPrimitives
+ DetectorDescription/IRegionSelector
+ DetectorDescription/RoiDescriptor
+ Event/EventPrimitives
+ Event/FourMomUtils
- Event/xAOD/.*AthenaPool
+ Event/xAOD/xAODMetaDataCnv
+ Event/xAOD/xAODTriggerCnv
- Event/xAOD/.*Cnv
+ Event/xAOD/.*
+ Generators/TruthUtils
+ InnerDetector/InDetRecTools/InDetTrackSelectionTool
+ InnerDetector/InDetRecTools/TrackVertexAssociationTool
+ MuonSpectrometer/MuonIdHelpers
+ PhysicsAnalysis/AnalysisCommon/AssociationUtils
+ PhysicsAnalysis/AnalysisCommon/CPAnalysisExamples
+ PhysicsAnalysis/AnalysisCommon/FsrUtils
+ PhysicsAnalysis/AnalysisCommon/IsolationSelection
+ PhysicsAnalysis/AnalysisCommon/PATCore
+ PhysicsAnalysis/AnalysisCommon/PATInterfaces
+ PhysicsAnalysis/AnalysisCommon/PMGTools
+ PhysicsAnalysis/AnalysisCommon/ParticleJetTools
+ PhysicsAnalysis/AnalysisCommon/PileupReweighting
+ PhysicsAnalysis/AnalysisCommon/ReweightUtils
+ PhysicsAnalysis/D3PDTools/.*
- PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools
+ PhysicsAnalysis/ElectronPhotonID/.*
+ PhysicsAnalysis/HiggsPhys/Run2/HZZ/Tools/ZMassConstraint
+ PhysicsAnalysis/Interfaces/.*
+ PhysicsAnalysis/JetMissingEtID/JetSelectorTools
+ PhysicsAnalysis/JetPhys/SemileptonicCorr
+ PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface
+ PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency
+ PhysicsAnalysis/MCTruthClassifier
+ PhysicsAnalysis/MuonID/MuonIDAnalysis/.*
+ PhysicsAnalysis/MuonID/MuonSelectorTools
+ PhysicsAnalysis/SUSYPhys/SUSYTools
+ PhysicsAnalysis/TauID/DiTauMassTools
+ PhysicsAnalysis/TauID/TauAnalysisTools
+ PhysicsAnalysis/TauID/TauCorrUncert
+ PhysicsAnalysis/TopPhys/QuickAna
+ PhysicsAnalysis/TrackingID/.*
+ Reconstruction/EventShapes/EventShapeInterface
- Reconstruction/Jet/JetAnalysisTools/JetAnalysisEDM
- Reconstruction/Jet/JetEvent.*
- Reconstruction/Jet/JetMonitoring
+ Reconstruction/Jet/JetReclustering
- Reconstruction/Jet/JetRec.+
- Reconstruction/Jet/JetSimTools
- Reconstruction/Jet/JetValidation
+ Reconstruction/Jet/Jet.*
+ Reconstruction/MET/METInterface
+ Reconstruction/MET/METUtilities
+ Reconstruction/MVAUtils
+ Reconstruction/PFlow/PFlowUtils
+ Reconstruction/egamma/egammaLayerRecalibTool
+ Reconstruction/egamma/egammaMVACalib
+ Reconstruction/egamma/egammaRecEvent
+ Reconstruction/tauRecTools
+ Tools/PathResolver
+ Trigger/TrigAnalysis/TrigAnalysisInterfaces
+ Trigger/TrigAnalysis/TrigBunchCrossingTool
+ Trigger/TrigAnalysis/TrigDecisionTool
+ Trigger/TrigAnalysis/TrigTauAnalysis/TrigTauMatching
+ Trigger/TrigAnalysis/TriggerMatchingTool
+ Trigger/TrigConfiguration/TrigConfBase
+ Trigger/TrigConfiguration/TrigConfHLTData
+ Trigger/TrigConfiguration/TrigConfInterfaces
+ Trigger/TrigConfiguration/TrigConfL1Data
+ Trigger/TrigConfiguration/TrigConfxAOD
+ Trigger/TrigEvent/TrigDecisionInterface
+ Trigger/TrigEvent/TrigNavStructure
+ Trigger/TrigEvent/TrigRoiConversion
+ Trigger/TrigEvent/TrigSteeringEvent
+ Trigger/TrigValidation/TrigAnalysisTest
#
# Packages to build as part of AnalysisTop:
#
+ PhysicsAnalysis/UpgradePhys/SmearingFunctions/UpgradePerformanceFunctions
+ PhysicsAnalysis/TopPhys/TopPhysUtils/TopDataPreparation
+ PhysicsAnalysis/TopPhys/xAOD/TopAnalysis
+ PhysicsAnalysis/TopPhys/xAOD/TopCPTools
+ PhysicsAnalysis/TopPhys/xAOD/TopConfiguration
+ PhysicsAnalysis/TopPhys/xAOD/TopCorrections
+ PhysicsAnalysis/TopPhys/xAOD/TopEvent
+ PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools
+ PhysicsAnalysis/TopPhys/xAOD/TopEventSelectionTools
+ PhysicsAnalysis/TopPhys/xAOD/TopExamples
+ PhysicsAnalysis/TopPhys/xAOD/TopFakes
+ PhysicsAnalysis/TopPhys/xAOD/TopHLUpgrade
+ PhysicsAnalysis/TopPhys/xAOD/TopJetSubstructure
+ PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools
+ PhysicsAnalysis/TopPhys/xAOD/TopParticleLevel
+ PhysicsAnalysis/TopPhys/xAOD/TopPartons
+ PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker
#
# No other packages
#
- .*
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#Project file for AnalysisTop
set( PROJECT_NAME "AnalysisTop" )
set( PROJECT_VERSION "2.6.3" )
# Other projects that this one depends on
set( PROJECT_DEPS "AnalysisTopExternals" "2.6.3" )
// $Id: load_packages.C.in 784551 2016-11-16 12:46:32Z krasznaa $
//
// This is a much simplified version of the RootCore script with the same
// name, basically just here to provide the existing scripts/tests with a
// file that they can use.
// System include(s):
#include <stdexcept>
// ROOT include(s):
#include <TSystem.h>
#include <TROOT.h>
/// Function setting up interactive ROOT to use the analysis release
///
/// In order to use macros or PyROOT scripts that make use of symbols
/// defined in the analysis release, the user has to execute this macro.
/// It takes care of setting up the compilation options of ACLiC, and
/// of calling xAOD::Init().
///
/// @param options An unused parameter, just to mimic the RootCore function
///
void load_packages( const char* options = "" ) {
// Make sure that some reasonable environment is set up:
const char* ROOTCOREDIR = gSystem->Getenv( "ROOTCOREDIR" );
if( ! ROOTCOREDIR ) {
throw std::runtime_error( "ROOTCOREDIR not set, please set "
"the environment" );
}
const std::string dir = ROOTCOREDIR;
const char* ROOTCOREBIN = gSystem->Getenv( "ROOTCOREBIN" );
if( ! ROOTCOREBIN ) {
throw std::runtime_error( "ROOTCOREBIN not set, please set "
"the environment");
}
const std::string bin = ROOTCOREBIN;
// Set the compilation options for ACLiC:
gSystem->AddIncludePath( "@CMAKE_CXX_FLAGS@" );
// Load the xAODRootAccess library, in a hard-coded way:
gSystem->Load( "libxAODRootAccess" );
gROOT->ProcessLine( "xAOD::Init().ignore()" );
return;
}
22.0.3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment