diff --git a/Externals/CMSCombine/CMakeLists.txt b/Externals/CMSCombine/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..69f1faf5eb6182bfac8c809061714df7eb483dd6 --- /dev/null +++ b/Externals/CMSCombine/CMakeLists.txt @@ -0,0 +1,64 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# +# Package building CMSCombine for StatAnalysis releases +# + +# The name of the package: +atlas_subdir( CMSCombine ) + +find_package(Eigen QUIET) +if(NOT EIGEN_FOUND AND NOT ATLAS_BUILD_EIGEN) + message(STATUS "WARNING: Cannot build CMSCombine without Eigen") + return() +endif() + +# Set token if it exists, otherwise use no token +if(CI_JOB_TOKEN) + set( _token "gitlab-ci-token:${CI_JOB_TOKEN}@" ) +else() + set( _token "" ) +endif() + +set( STATANA_CMSCOMBINE_REPOSITORY "${CERN_GITLAB_WITH_TOKEN}/will/cmscombine.git" CACHE STRING "Repository of cmscombine" ) + +set( _buildDir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMSCombineBuild ) + +if(STATANA_VERBOSE) + set(_logging OFF) +else() + set(_logging ON) +endif() + +# Build lwtnn for the build area: +ExternalProject_Add( CMSCombine + PREFIX ${CMAKE_BINARY_DIR} + INSTALL_DIR ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM} + GIT_REPOSITORY ${STATANA_CMSCOMBINE_REPOSITORY} + GIT_TAG ${STATANA_CMSCOMBINE_VERSION} + BUILD_ALWAYS ${TRACK_CHANGES} + CMAKE_CACHE_ARGS + -DCMAKE_INSTALL_PREFIX:PATH=${_buildDir} + -DCMAKE_PREFIX_PATH:PATH=${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM} # ensures will discover the release's version of ROOT + LOG_DOWNLOAD ${_logging} LOG_CONFIGURE ${_logging} LOG_BUILD ${_logging} LOG_INSTALL ${_logging} + LOG_OUTPUT_ON_FAILURE 1 + UPDATE_COMMAND "" # needed for next line to work + UPDATE_DISCONNECTED TRUE) # skips reconfigure+build if just rerunning. +ExternalProject_Add_Step( CMSCombine buildinstall + COMMAND ${CMAKE_COMMAND} -E copy_directory ${_buildDir} <INSTALL_DIR> + COMMENT "Installing CMSCombine into the build area" + DEPENDEES install + ) + +if( ATLAS_BUILD_ROOT ) + add_dependencies ( CMSCombine ROOT ) +endif() + +add_dependencies( CMSCombine Eigen Boost ) + + +# Install CMSCombine: +install( DIRECTORY ${_buildDir}/ + DESTINATION . USE_SOURCE_PERMISSIONS OPTIONAL ) + +install( FILES cmake/FindCMSCombine.cmake + DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/modules OPTIONAL ) diff --git a/Externals/CMSCombine/cmake/FindCMSCombine.cmake b/Externals/CMSCombine/cmake/FindCMSCombine.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fb9645f8eb4147d494332d15a2508fc765ab58b1 --- /dev/null +++ b/Externals/CMSCombine/cmake/FindCMSCombine.cmake @@ -0,0 +1,31 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# +# Locate the CMSCombine external package. +# +# Defines: +# CMSCOMBINE_FOUND +# CMSCOMBINE_INCLUDE_DIR +# CMSCOMBINE_INCLUDE_DIRS +# CMSCOMBINE_LIBRARIES +# CMSCOMBINE_LIBRARY_DIRS +# +# The user can set CMSCOMBINE_ATROOT to guide the script. +# + +# Include the helper code: +include( AtlasInternals ) + +# Declare the module: +atlas_external_module( NAME CMSCombine + INCLUDE_SUFFIXES include INCLUDE_NAMES CMSCombine + LIBRARY_SUFFIXES lib + COMPULSORY_COMPONENTS CMSCombine ) + +# Handle the standard find_package arguments: +include( FindPackageHandleStandardArgs ) +find_package_handle_standard_args( CMSCombine DEFAULT_MSG CMSCOMBINE_INCLUDE_DIRS + CMSCOMBINE_LIBRARIES ) +mark_as_advanced( CMSCOMBINE_FOUND CMSCOMBINE_INCLUDE_DIR CMSCOMBINE_INCLUDE_DIRS + CMSCOMBINE_LIBRARIES CMSCOMBINE_LIBRARY_DIRS ) + + diff --git a/ProjectOptions/CMakeLists.txt b/ProjectOptions/CMakeLists.txt index ff1521a8d760a3292d03d7244ee8c8fd2ae4df0b..52aa02d7bb268912d7082e9b1011aac12a52f173 100644 --- a/ProjectOptions/CMakeLists.txt +++ b/ProjectOptions/CMakeLists.txt @@ -10,6 +10,7 @@ find_package( dcap QUIET ) find_package( Davix QUIET ) find_package( OpenSSL QUIET ) find_package( UUID QUIET ) +find_package( Eigen QUIET ) # find_package( TBB 2018 QUIET ) # - commented out because trouble with 2021 versions so just build in the project instead # Get the OS name. @@ -48,6 +49,14 @@ endif() option( ATLAS_BUILD_XROOTD "Build XRootD as part of the release" ${_flag} ) +if (NOT EIGEN_FOUND OR ATLAS_BUILD_EIGEN ) + set( _flag TRUE ) +else() + set( _flag FALSE ) +endif() + +option( ATLAS_BUILD_EIGEN "Build Eigen as part of the release" ${_flag} ) + # Decide whether to build DCAP. set( _flag FALSE ) #if( NOT DCAP_FOUND AND _osIsValid AND @@ -100,6 +109,7 @@ set( STATANA_ROOUNFOLD_VERSION "924c8b60" CACHE STRING "Version of RooUnfold" ) set( STATANA_QUICKFIT_VERSION "df48d3" CACHE STRING "Version of quickFit" ) set( STATANA_WORKSPACECOMBINER_VERSION "8c0a7050" CACHE STRING "Version of workspaceCombiner" ) set( STATANA_XMLANAWSBUILDER_VERSION "4b0d11f8" CACHE STRING "Version of xmlAnaWSBuilder" ) +set( STATANA_CMSCOMBINE_VERSION "b42ddbe7" CACHE STRING "Version of CMSCombine" ) option( TRACK_CHANGES "forces cmake to detect changes in directories of submodules and recompile if changes detected - slower to build, but required for development" ON) diff --git a/package_filters.txt b/package_filters.txt index f28ff71fdcb60e7de20087ee6272206920b7bb98..128fc551a86b8ce5839d0f7e75fd6508f8c34f4f 100644 --- a/package_filters.txt +++ b/package_filters.txt @@ -8,7 +8,8 @@ + Externals/atlasexternals/External/dcap # + Externals/atlasexternals/External/Python # + Externals/atlasexternals/External/TBB -- ROOT can build for us - +# eigen needed for cmscombine ++ Externals/atlasexternals/External/Eigen # Do not pick up anything else from atlasexternals. - Externals/atlasexternals.*