Commit d9ab657c authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'AthGeneration-master-20200217' into 'master'

Externals Update and AthGeneration Project Creation, master branch (2020.02.19.)

See merge request !30437
parents ac28b5e0 46869706
# $Id: CMakeLists.txt 801071 2017-03-20 22:11:25Z delsart $
################################################################################
# Package: xAODJet
################################################################################
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( xAODJet )
......@@ -14,45 +11,28 @@ set( extra_test_libs )
# Extra dependencies, when we are not in a standalone build:
if( NOT XAOD_STANDALONE )
set( extra_private_deps Control/SGTools )
set( extra_test_libs SGTools )
else()
set( extra_private_deps Control/xAODRootAccess )
set( extra_test_libs xAODRootAccess )
endif()
if( NOT SIMULATIONBASE )
set( extra_deps Event/xAOD/xAODBTagging Event/xAOD/xAODTrigger Event/xAOD/xAODPFlow)
if( NOT SIMULATIONBASE AND NOT GENERATIONBASE )
set( extra_srcs Root/JetTrigAuxContainer*.cxx )
set( extra_libs xAODBTagging xAODPFlow xAODTrigger )
endif()
if (BUILDVP1LIGHT)
if( BUILDVP1LIGHT_DIST STREQUAL "ubuntu")
set( extra_libs ${extra_libs} GenVector )
endif()
if( BUILDVP1LIGHT AND ( BUILDVP1LIGHT_DIST STREQUAL "ubuntu" ) )
list( APPEND extra_libs GenVector )
endif()
# Declare the package's dependencies:
atlas_depends_on_subdirs(
PUBLIC
Control/AthContainers
Control/AthLinks
Event/xAOD/xAODBase
Event/xAOD/xAODCore
${extra_deps}
PRIVATE
Control/CxxUtils
Event/xAOD/xAODCaloEvent
${extra_private_deps} )
# External dependencies:
find_package( ROOT COMPONENTS Core GenVector )
# Component(s) in the package:
atlas_add_library( xAODJet
xAODJet/*.h xAODJet/*.icc xAODJet/versions/*.h xAODJet/versions/*.icc
Root/*.cxx
Root/JetA*.cxx Root/JetC*.cxx Root/Jet_v*.cxx Root/xAODJetCLIDs.cxx
${extra_srcs}
PUBLIC_HEADERS xAODJet
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthLinks
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include <cmath>
#include "xAODJet/JetConstituentVector.h"
#include "xAODCaloEvent/CaloCluster.h"
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
#include "xAODPFlow/PFO.h"
#endif //SIMULATIONBASE
#endif // not SIMULATIONBASE or GENERATIONBASE
namespace xAOD {
......@@ -47,14 +47,14 @@ namespace xAOD {
}
return;
}
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
case Type::ParticleFlow: {
const xAOD::PFO *pfo = dynamic_cast<const xAOD::PFO*>(part);
if(pfo->ptEM()!=0) constit.SetCoordinates( pfo->ptEM(), pfo->etaEM(), pfo->phiEM(), pfo->mEM() );
else constit.SetCoordinates( 0, 1, 1, 0 ); // To avoid Warnings from root.
return;
}
#endif //SIMULATIONBASE
#endif // not SIMULATIONBASE or GENERATIONBASE
default:
break;// fall back on default kinematics
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIMULATIONBASE
// Local include(s):
#include "xAODJet/versions/JetTrigAuxContainer_v1.h"
......@@ -19,8 +17,6 @@ namespace xAOD {
AUX_VARIABLE( eta );
AUX_VARIABLE( phi );
AUX_VARIABLE( m );
}
} // namespace xAOD
#endif //SIMULATIONBASE
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIMULATIONBASE
// Local include(s):
#include "xAODJet/versions/JetTrigAuxContainer_v2.h"
......@@ -20,8 +18,6 @@ namespace xAOD {
AUX_VARIABLE( eta );
AUX_VARIABLE( phi );
AUX_VARIABLE( m );
}
} // namespace xAOD
#endif //SIMULATIONBASE
......@@ -259,7 +259,7 @@ namespace xAOD {
void Jet_v1::setInputType(JetInput::Type t) {inputAcc(*this)=t;}
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
static const SG::AuxElement::Accessor< ElementLink< BTaggingContainer > >
btagAcc1( "btagging" );
static const SG::AuxElement::Accessor< ElementLink< BTaggingContainer > >
......@@ -291,7 +291,7 @@ namespace xAOD {
btagAcc2( *this ) = el;
return;
}
#endif //SIMULATIONBASE
#endif // not SIMULATIONBASE or GENERATIONBASE
// void Jet_v1::toPersistent() {
// No longer needed, as this is done by the POOL converter for the aux container
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
//simple includes to force the CLASS_DEF to be encountered during compile
#include "xAODJet/JetAuxContainer.h"
#include "xAODJet/JetContainer.h"
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
#include "xAODJet/JetTrigAuxContainer.h"
#endif //SIMULATIONBASE
#endif // not SIMULATIONBASE or GENERATIONBASE
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODJET_JETTRIGAUXCONTAINER_H
#define XAODJET_JETTRIGAUXCONTAINER_H
#ifndef SIMULATIONBASE
// Local include(s):
#include "xAODJet/versions/JetTrigAuxContainer_v2.h"
......@@ -25,5 +25,4 @@ namespace xAOD {
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::JetTrigAuxContainer, 1285854532, 1 )
#endif //SIMULATIONBASE
#endif // XAODJET_JETAUXCONTAINER_H
#endif // XAODJET_JETTRIGAUXCONTAINER_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: JetTrigAuxContainer_v1.h 576027 2013-12-17 21:15:51Z delsart $
#ifndef XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V1_H
#define XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V1_H
#ifndef SIMULATIONBASE
// System include(s):
#include <vector>
......@@ -61,6 +59,5 @@ namespace xAOD {
// Declare the inheritance of the class:
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::JetTrigAuxContainer_v1, xAOD::ByteStreamAuxContainer_v1 );
#endif
#endif // XAODJET_VERSIONS_JETAUXCONTAINER_V1_H
#endif // XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V1_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// Dear emacs, this is -*- c++ -*-
// $Id: JetTrigAuxContainer_v2.h 2017-02-12 16:52 sschramm $
#ifndef XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V2_H
#define XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V2_H
#ifndef SIMULATIONBASE
// System include(s):
#include <vector>
......@@ -62,6 +60,5 @@ namespace xAOD {
// Declare the inheritance of the class:
#include "xAODCore/BaseInfo.h"
SG_BASE( xAOD::JetTrigAuxContainer_v2, xAOD::ByteStreamAuxContainer_v1 );
#endif
#endif // XAODJET_VERSIONS_JETAUXCONTAINER_V2_H
#endif // XAODJET_VERSIONS_JETTRIGAUXCONTAINER_V2_H
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef XAODJET_VERSIONS_JET_V1_H
......@@ -16,9 +16,9 @@
// xAOD include(s):
#include "xAODBase/IParticle.h"
#include "xAODBase/IParticleContainer.h"
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
#include "xAODBTagging/BTaggingContainer.h"
#endif //SIMULATIONBASE
#endif // not SIMULATIONBASE or GENERATIONBASE
// Local include(s):
//#include "xAODJet/JetConstituentIterator.h"
......@@ -236,14 +236,14 @@ namespace xAOD {
/// Set number by enum
template<class T>
void setAttribute( AttributeID type, const T& value );
#ifndef SIMULATIONBASE
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
/// Access to the associated btagging object
const BTagging* btagging() const;
/// Access to the associated btagging object
const ElementLink< BTaggingContainer >& btaggingLink() const;
/// Access to btagging objects
void setBTaggingLink( const ElementLink< BTaggingContainer>& el );
#endif
#endif // not SIMULATIONBASE or GENERATIONBASE
/// @}
////////////////////////////////////////////////////////
......
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// $Id: xAODJetDict.h 796773 2017-02-12 19:01:20Z sschramm $
#ifndef XAODJET_XAODJETDICT_H
#define XAODJET_XAODJETDICT_H
......@@ -24,8 +23,10 @@
#include "xAODJet/JetContainer.h"
#include "xAODJet/versions/JetContainer_v1.h"
#include "xAODJet/versions/JetAuxContainer_v1.h"
#if !defined(SIMULATIONBASE) and !defined(GENERATIONBASE)
#include "xAODJet/versions/JetTrigAuxContainer_v1.h"
#include "xAODJet/versions/JetTrigAuxContainer_v2.h"
#endif // not SIMULATIONBASE or GENERATIONBASE
#include "xAODJet/versions/Jet_v1.h"
#include "xAODJet/JetTypes.h"
......
......@@ -6,4 +6,4 @@
# forbidden.
# The version of atlas/atlasexternals to use:
AnalysisBaseExternalsVersion = 2.0.56
AnalysisBaseExternalsVersion = 2.0.57
......@@ -5,4 +5,4 @@
# an "origin/" prefix before it. For tags however this is explicitly
# forbidden.
AtlasExternalsVersion = 2.0.56
AtlasExternalsVersion = 2.0.57
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Set up the project.
cmake_minimum_required( VERSION 3.6 )
file( READ ${CMAKE_SOURCE_DIR}/version.txt _version )
string( STRIP ${_version} _version )
project( AthGeneration VERSION ${_version} LANGUAGES C CXX Fortran )
unset( _version )
# Configure flake8:
set( ATLAS_FLAKE8 "flake8_atlas --select ATL,F,E7,E9,W6 --enable-extension ATL902 --extend-ignore E701,E702,E741"
CACHE STRING "Default flake8 command" )
set( ATLAS_PYTHON_CHECKER "${ATLAS_FLAKE8} --filterFiles AthenaConfiguration"
CACHE STRING "Python checker command to run during Python module compilation" )
# Find the ATLAS CMake code:
find_package( AtlasCMake QUIET )
# Find the base project(s):
find_package( AthGenerationExternals REQUIRED )
find_package( Gaudi REQUIRED )
# Additional externals needed for the build/runtime:
find_package( Xrootd )
find_package( GSL )
find_package( Davix )
find_package( PNG )
find_package( BLAS )
find_package( AIDA )
# Set up the compilation option(s) for AthGeneration.
add_definitions( -DGENERATIONBASE )
set( GENERATIONBASE TRUE CACHE BOOL
"Flag specifying that this is a simulation release build" )
# Load all the files from the externals/ subdirectory:
file( GLOB _externals "${CMAKE_CURRENT_SOURCE_DIR}/externals/*.cmake" )
foreach( _external ${_externals} )
include( ${_external} )
get_filename_component( _extName ${_external} NAME_WE )
string( TOUPPER ${_extName} _extNameUpper )
message( STATUS "Taking ${_extName} from: ${${_extNameUpper}_LCGROOT}" )
unset( _extName )
unset( _extNameUpper )
endforeach()
unset( _external )
unset( _externals )
# Disable the usage of the --no-undefined linker flag:
atlas_disable_no_undefined()
# Set up CTest:
atlas_ctest_setup()
# Set up the "ATLAS project".
atlas_project( USE AthGenerationExternals ${AthGenerationExternals_VERSION}
PROJECT_ROOT ${CMAKE_SOURCE_DIR}/../../ )
# Install the external configurations:
install( DIRECTORY ${CMAKE_SOURCE_DIR}/externals
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} USE_SOURCE_PERMISSIONS )
# Generate the environment setup for the externals, to be used during the build:
lcg_generate_env( SH_FILE ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh )
# 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} "\${AthGeneration_DIR}/../../../.." )
endif()
if( NOT "$ENV{TDAQ_RELEASE_BASE}" STREQUAL "" )
list( APPEND _replacements $ENV{TDAQ_RELEASE_BASE}
"\${TDAQ_RELEASE_BASE}" )
endif()
# Now generate and install the installed setup files:
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 )
# Configure and install the post-configuration file:
string( REPLACE "$ENV{TDAQ_RELEASE_BASE}" "\$ENV{TDAQ_RELEASE_BASE}"
TDAQ-COMMON_ATROOT "${TDAQ-COMMON_ATROOT}" )
string( REPLACE "${TDAQ-COMMON_VERSION}" "\${TDAQ-COMMON_VERSION}"
TDAQ-COMMON_ATROOT "${TDAQ-COMMON_ATROOT}" )
configure_file( ${CMAKE_SOURCE_DIR}/cmake/PostConfig.cmake.in
${CMAKE_BINARY_DIR}/PostConfig.cmake @ONLY )
install( FILES ${CMAKE_BINARY_DIR}/PostConfig.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} )
# Package up the release using CPack:
atlas_cpack_setup()
The Full ATLAS Offline Software Project
=======================================
This is the configuration for building the full offline software from the
repository.
Build Instructions
------------------
To build the externals necessary for building this project itself, use the
build_externals.sh
script. It will build all the externals necessary for this project into a
subdirectory of the directory holding this repository, called `build`.
The sources of the externals will be checked out under `build/src`, the
build of the projects will commence under `build/build`, and the results of
the build will be installed under `build/install`.
RPMs created from the externals are copied under `build/` by the script.
Once the externals have finished building, you can initiate the full build
of the project against these newly built externals by executing the
build.sh
script. It uses the same directory layout inside the `build` directory as
was used for the externals.
Custom Builds
-------------
Of course it is perfectly allowed to set up a build by hand, not using the
`build.sh` script as well. In that case you have to make sure to have a
functional version of AthGenerationExternals set up in your environment, and point
the `GAUDI_ROOT` environment variable against the Gaudi version that you
want to use for the build.
You will also need to set the `TDAQ_RELEASE_BASE` environment variable for
the build to be successful. The simplest way of doing this is to use the
helper script:
Build/AtlasBuildScripts/TDAQ_RELEASE_BASE.sh
#!/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 one of the
# scripts 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 build type] [-b build dir] [-c] [-m] [-i] [-p] [-a] [-x opt] [-N]"
echo " -c: Execute CMake step"
echo " -m: Execute make step"
echo " -i: Execute install step"
echo " -p: Execute CPack step"
echo " -a: Abort on error"
echo " -x: Extra configuration argument(s) for CMake"
echo " -N: Use Ninja"
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"
EXE_CMAKE=""
EXE_MAKE=""
EXE_INSTALL=""
EXE_CPACK=""
NIGHTLY=true
EXTRACMAKE=()
BUILDTOOLTYPE=""
BUILDTOOL="make -k"
INSTALLRULE="install/fast"
while getopts ":t:b:hcmipax:N" opt; do
case $opt in
t)
BUILDTYPE=$OPTARG
;;
b)
BUILDDIR=$OPTARG
;;
c)
EXE_CMAKE="1"
;;
m)
EXE_MAKE="1"
;;
i)
EXE_INSTALL="1"
;;
p)
EXE_CPACK="1"
;;
a)
NIGHTLY=false
;;
x)
EXTRACMAKE+=($OPTARG)
;;
N)
BUILDTOOL="ninja -k 0"
BUILDTOOLTYPE="-GNinja"
INSTALLRULE="install"
;;
h)
usage
exit 0
;;
:)
echo "Argument -$OPTARG requires a parameter!"
usage
exit 1
;;
?)
echo "Unknown argument: -$OPTARG"
usage
exit 1
;;
esac
done
# If no step was explicitly specified, turn them all on:
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
# consider a pipe failed if ANY of the commands fails
set -o pipefail
{
test "X${NIGHTLY_STATUS}" != "X" && {
scriptsdir_nightly_status=${NIGHTLY_STATUS_SCRIPTS}
test "X$scriptsdir_nightly_status" = "X" && scriptsdir_nightly_status=${scriptsdir}/nightly_status
test -x $scriptsdir_nightly_status/status_on_exit.sh && trap $scriptsdir_nightly_status/status_on_exit.sh EXIT
}
}
# Source in our environment
AthGenerationSrcDir=$(dirname ${BASH_SOURCE[0]})
# The directory holding the helper scripts:
scriptsdir=${AthGenerationSrcDir}/../../Build/AtlasBuildScripts
scriptsdir=$(cd ${scriptsdir}; pwd)
if [ -z "$BUILDDIR" ]; then
BUILDDIR=${AthGenerationSrcDir}/../../../build
fi
mkdir -p ${BUILDDIR}
BUILDDIR=$(cd ${BUILDDIR} && pwd)
source $AthGenerationSrcDir/build_env.sh -b $BUILDDIR >& ${BUILDDIR}/build_env.log
cat ${BUILDDIR}/build_env.log
# create the actual build directory
mkdir -p ${BUILDDIR}/build/AthGeneration
cd ${BUILDDIR}/build/AthGeneration
# 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
# Now run the actual CMake configuration:
{ _time_ cmake ${BUILDTOOLTYPE} -DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE} \
${EXTRACMAKE[@]} \
-DCTEST_USE_LAUNCHERS:BOOL=TRUE \
${AthGenerationSrcDir}; } 2>&1 | tee cmake_config.log
fi
#log analyzer never affects return status in the parent shell:
{
test "X${NIGHTLY_STATUS}" != "X" && {
branch=$(basename $(cd ${BUILDDIR}/.. ; pwd)) #FIXME: should be taken from env.
timestamp_tmp=` basename ${BUILDDIR}/../.@@__* 2>/dev/null | sed 's,^\.,,' `
test "X$timestamp_tmp" != "X" || {
timestamp_tmp=@@__`date "+%Y-%m-%dT%H%M"`__@@ #to be used until the final stamp from ReleaseData is available
touch ${BUILDDIR}/../.${timestamp_tmp}
}
(set +e
${scriptsdir_nightly_status}/cmake_config_status.sh "$branch" "$BINARY_TAG" "$timestamp_tmp" AthGeneration ${BUILDDIR}/build/AthGeneration/cmake_config.log
)
} || true
}
# 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
# make:
if [ -n "$EXE_MAKE" ]; then
# Forcibly remove the merged CLID file from the previous build, to
# avoid issues with some library possibly changing the name/CLID
# of something during the build. Note that ${platform} is coming from
# the build_env.sh script.
rm -f ${platform}/share/clid.db
# Build the project.
{ _time_ ${BUILDTOOL}; } 2>&1 | tee cmake_build.log
fi
{
test "X${NIGHTLY_STATUS}" != "X" && {
(set +e