diff --git a/Projects/AthDerivationExternals/CMakeLists.txt b/Projects/AthDerivationExternals/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f3b238fd7d8abc3bd25113e9bf6c98d9fa6544a1 --- /dev/null +++ b/Projects/AthDerivationExternals/CMakeLists.txt @@ -0,0 +1,80 @@ +# +# Project file for the AthDerivationExternals project. +# + +# The minimum required CMake version: +cmake_minimum_required( VERSION 3.2 FATAL_ERROR ) + +# If the user didn't specify AtlasCMake_DIR explicitly, pick up that code +# from this repository: +if( "${AtlasCMake_DIR}" STREQUAL "" AND "$ENV{AtlasCMake_DIR}" STREQUAL "" ) + set( AtlasCMake_DIR ${CMAKE_SOURCE_DIR}/../../Build/AtlasCMake ) +endif() + +# If the user didn't specify LCG_DIR explicitly, pick up the code from this +# repository: +if( "${LCG_DIR}" STREQUAL "" AND "$ENV{LCG_DIR}" STREQUAL "" ) + set( LCG_DIR ${CMAKE_SOURCE_DIR}/../../Build/AtlasLCG ) +endif() + +# 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( ATHDERIVATIONEXTERNALS_PROJECT_VERSION ${_version} + CACHE STRING "Version of the AthDerivationExternals project to build" ) +unset( _version ) + +# Find the ATLAS CMake code: +find_package( AtlasCMake REQUIRED ) + +# Set up which LCG version to use: +set( LCG_VERSION_POSTFIX "" ) +set( LCG_VERSION_NUMBER 87 ) +find_package( LCG ${LCG_VERSION_NUMBER} REQUIRED EXACT ) + +# Set up CTest: +atlas_ctest_setup() + +# Declare project name and version +atlas_project( AthDerivationExternals ${ATHDERIVATIONEXTERNALS_PROJECT_VERSION} + PROJECT_ROOT ${CMAKE_SOURCE_DIR}/../../ + FORTRAN ) + +# Configure and install the post-configuration file: +configure_file( ${CMAKE_SOURCE_DIR}/PostConfig.cmake.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PostConfig.cmake @ONLY ) +install( FILES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/PostConfig.cmake + DESTINATION ${CMAKE_INSTALL_CMAKEDIR} ) + +# Install the export sanitizer script: +install( FILES ${CMAKE_SOURCE_DIR}/atlas_export_sanitizer.cmake.in + DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/modules/skeletons ) + +# Install the Gaudi CPack configuration module: +install( FILES ${CMAKE_SOURCE_DIR}/GaudiCPackSettings.cmake + DESTINATION ${CMAKE_INSTALL_CMAKEDIR}/modules ) + +# 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} + "\${AthDerivationExternals_DIR}/../../../.." ) +endif() +if( NOT "$ENV{NICOS_PROJECT_RELNAME}" STREQUAL "" ) + list( APPEND _replacements $ENV{NICOS_PROJECT_RELNAME} + "\${AthDerivationExternals_VERSION}" ) +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 ) + +# Package up the release using CPack: +atlas_cpack_setup() diff --git a/Projects/AthDerivationExternals/GaudiCPackSettings.cmake b/Projects/AthDerivationExternals/GaudiCPackSettings.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fee20774b0b680db3579963943ca3bab24bf1895 --- /dev/null +++ b/Projects/AthDerivationExternals/GaudiCPackSettings.cmake @@ -0,0 +1,62 @@ +# +# This file is picked up by Gaudi, when it's built against +# AthDerivationExternals. It configures how Gaudi should use CPack. +# + +# Tell the user what's happening: +message( STATUS "Configuring GAUDI to use the AthDerivationExternals CPack settings" ) + +# Remember the project name: +set( _projectName ${CMAKE_PROJECT_NAME} ) +# Remember the project version: +set( _projectVersion ${CMAKE_PROJECT_VERSION} ) +set( _projectVersionMajor ${CMAKE_PROJECT_VERSION_MAJOR} ) +set( _projectVersionMinor ${CMAKE_PROJECT_VERSION_MINOR} ) +set( _projectVersionPatch ${CMAKE_PROJECT_VERSION_PATCH} ) + +# Set the GAUDI version according to NICOS, if the environment variables +# are available: +if( NOT "$ENV{NICOS_ATLAS_ALT_RELEASE}" STREQUAL "" AND + NOT "$ENV{NICOS_ATLAS_ALT_RELEASE}" STREQUAL "None" ) + set( CMAKE_PROJECT_VERSION $ENV{NICOS_ATLAS_ALT_RELEASE} ) +elseif( NOT "$ENV{NICOS_ATLAS_RELEASE}" STREQUAL "" ) + set( CMAKE_PROJECT_VERSION $ENV{NICOS_ATLAS_RELEASE} ) +else() + set( CMAKE_PROJECT_VERSION "${AthDerivationExternals_VERSION}" ) +endif() + +# Decode the version string into 3 numbers: +set( PROJECT_VERSION_REGEX "([0-9]+).([0-9]+).([0-9]+)" ) +if( CMAKE_PROJECT_VERSION MATCHES ${PROJECT_VERSION_REGEX} ) + set( CMAKE_PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1} ) + set( CMAKE_PROJECT_VERSION_MINOR ${CMAKE_MATCH_2} ) + set( CMAKE_PROJECT_VERSION_PATCH ${CMAKE_MATCH_3} ) +endif() +unset( PROJECT_VERSION_REGEX ) + +# Call the package GAUDI, and not Gaudi: +set( CMAKE_PROJECT_NAME "GAUDI" ) + +# Make the GAUDI package depend on the AthDerivationExternals one: +set( ATLAS_BASE_PROJECTS AthDerivationExternals + ${AthDerivationExternals_VERSION} ) + +# Do the regular ATLAS CPack configuration: +include( AtlasInternals ) +atlas_cpack_setup() + +# Set up a ReleaseData file for Gaudi: +atlas_generate_releasedata() + +# Clean up: +set( CMAKE_PROJECT_VERSION ${_projectVersion} ) +unset( _projectVersion ) +set( CMAKE_PROJECT_VERSION_MAJOR ${_projectVersionMajor} ) +unset( _projectVersionMajor ) +set( CMAKE_PROJECT_VERSION_MINOR ${_projectVersionMinor} ) +unset( _projectVersionMinor ) +set( CMAKE_PROJECT_VERSION_PATCH ${_projectVersionPatch} ) +unset( _projectVersionPatch ) +set( CMAKE_PROJECT_NAME ${_projectName} ) +unset( _projectName ) +unset( ATLAS_BASE_PROJECTS ) diff --git a/Projects/AthDerivationExternals/PostConfig.cmake.in b/Projects/AthDerivationExternals/PostConfig.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..c990e778d12bd43ee5bf23106ba7bc2ef73a87c0 --- /dev/null +++ b/Projects/AthDerivationExternals/PostConfig.cmake.in @@ -0,0 +1,24 @@ +# +# This file is used to configure which externals should be picked up from +# external (AFS/CVMFS) sources. +# + +# Find LCG: +set( LCG_VERSION_POSTFIX @LCG_VERSION_POSTFIX@ ) +if( AthDerivationExternals_FIND_QUIETLY ) + find_package( LCG @LCG_VERSION_NUMBER@ REQUIRED EXACT QUIET ) +else() + find_package( LCG @LCG_VERSION_NUMBER@ REQUIRED EXACT ) +endif() + +# Set the platform name for Gaudi, and the externals: +set( ATLAS_PLATFORM @ATLAS_PLATFORM@ ) + +# Add all custom compilation options: +set( CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard used for the build" ) +add_definitions( -DGAUDI_V20_COMPAT ) +add_definitions( -DATLAS_GAUDI_V21 ) +add_definitions( -DHAVE_GAUDI_PLUGINSVC ) + +# Make sure that CMake can find the custom built BLAS and LAPACK libraries: +set( BLA_STATIC TRUE ) diff --git a/Projects/AthDerivationExternals/README.md b/Projects/AthDerivationExternals/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f22cae5f9b64657b3a4b04ac7046903e5caa5cd3 --- /dev/null +++ b/Projects/AthDerivationExternals/README.md @@ -0,0 +1,7 @@ +AthDerivationExternals +====================== + +This project builds all the externals needed by the derivation software of +ATLAS. It picks up most of the externals from an LCG release. Only adding +software that is either specific to ATLAS, or needs to be built in a way +specific to the experiment. diff --git a/Projects/AthDerivationExternals/atlas_export_sanitizer.cmake.in b/Projects/AthDerivationExternals/atlas_export_sanitizer.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..bf9bc5470d11731603b37eda344fcbc207adbb9a --- /dev/null +++ b/Projects/AthDerivationExternals/atlas_export_sanitizer.cmake.in @@ -0,0 +1,77 @@ +# +# This script is used to tweak the exported file created by CMake for +# describing the installed targets of a release, not to treat it as a +# fatal error if one of the targets is missing. Which can very much +# be the case in a nightly, if a package fails building. But it should +# not stop the downstream projects from building all together. +# + +# Look for specific target files: +set( _fileName "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/" ) +set( _fileName "${_fileName}@CMAKE_INSTALL_CMAKEDIR@/" ) +set( _fileName "${_fileName}@CMAKE_PROJECT_NAME@Config-targets-*.cmake" ) +file( GLOB _targetFiles ${_fileName} ) +foreach( _file ${_targetFiles} ) + # Add a line at the end of each file that clears out the + # _IMPORT_CHECK_TARGETS variable. So that no targets would be checked + # at the build configuration time. + file( APPEND "${_file}" + "# Don't check the imported targets:\n" + "set(_IMPORT_CHECK_TARGETS)\n" ) +endforeach() + +# The name of the main file to sanitize: +set( _fileName "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/" ) +set( _fileName "${_fileName}@CMAKE_INSTALL_CMAKEDIR@/" ) +set( _fileName "${_fileName}@CMAKE_PROJECT_NAME@Config-targets.cmake" ) + +# Read in the generated targets file: +file( READ ${_fileName} _targetsContent ) + +# Do all the necessary string replacements. It has to be done in this +# complicated way, as semicolons in the string are interpreted by string(...) +# as list delimeters. And are removed if I give the content as a single +# value. +set( _outputContent ) +foreach( _element ${_targetsContent} ) + # Lower the level of fatal messages to warning. To make nightlies with + # package failures still useful for code development. + string( REPLACE "FATAL_ERROR" "WARNING" _newContent ${_element} ) + # Make the paths coming from LCG be treated as absolute paths, and not + # relative ones. + if( ${CMAKE_VERSION} VERSION_LESS 3.4.0 ) + string( REPLACE "\${_IMPORT_PREFIX}/\${LCG_RELEASE_BASE}" + "\${LCG_RELEASE_BASE}" _newContent ${_newContent} ) + else() + string( REPLACE "\${_IMPORT_PREFIX}/\\\${LCG_RELEASE_BASE}" + "\\\${LCG_RELEASE_BASE}" _newContent ${_newContent} ) + string( REPLACE "\\\${LCG_RELEASE_BASE}" + "\${LCG_RELEASE_BASE}" _newContent ${_newContent} ) + endif() + # Replace the absolute tdaq paths with ones relying on an environment + # variable: + if( NOT "$ENV{TDAQ_RELEASE_BASE}" STREQUAL "" ) + string( REPLACE "$ENV{TDAQ_RELEASE_BASE}" "\$ENV{TDAQ_RELEASE_BASE}" + _newContent ${_newContent} ) + endif() + # Make the directories pointing at AthDerivationExternals be relative paths: + string( REGEX REPLACE + "/[^ \"]*/AthDerivationExternals/[^/]+/InstallArea/([^/]+)" + "\$ENV{@CMAKE_PROJECT_NAME@_DIR}/../../../../AthDerivationExternals/\$ENV{@CMAKE_PROJECT_NAME@_VERSION}/InstallArea/\\1" + _newContent ${_newContent} ) + # Append it to the full string: + if( _outputContent ) + set( _outputContent "${_outputContent}\;${_newContent}" ) + else() + set( _outputContent "${_newContent}" ) + endif() +endforeach() + +# Overwrite the original file with the new content: +file( WRITE ${_fileName} ${_outputContent} ) + +# Unset all created variables: +unset( _targetsContent ) +unset( _newContent ) +unset( _outputContent ) +unset( _fileName ) diff --git a/Projects/AthDerivationExternals/package_filters.txt b/Projects/AthDerivationExternals/package_filters.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4c0133e03f07edeb808f2556b5e8e80b08586d7 --- /dev/null +++ b/Projects/AthDerivationExternals/package_filters.txt @@ -0,0 +1,17 @@ +# +# List of packages to build as part of AthDerivationExternals. +# ++ External/Blas ++ External/CheckerGccPlugins ++ External/CLHEP ++ External/FFTW ++ External/FastJet ++ External/FastJetContrib ++ External/Gdb ++ External/GPerfTools ++ External/GoogleTest ++ External/Lapack ++ External/MKL ++ External/dSFMT ++ External/yampl +- .* diff --git a/Projects/AthDerivationExternals/version.txt b/Projects/AthDerivationExternals/version.txt new file mode 100644 index 0000000000000000000000000000000000000000..b295a689e748195bd03e94e0343e70df461571d9 --- /dev/null +++ b/Projects/AthDerivationExternals/version.txt @@ -0,0 +1 @@ +21.2.0