diff --git a/Projects/AthAnalysis/CMakeLists.txt b/Projects/AthAnalysis/CMakeLists.txt index 5d718f73e713ea03cd4ced24669ec7a82c839d25..458279ef9a631b85316de4a6cdc029f4a195cf03 100644 --- a/Projects/AthAnalysis/CMakeLists.txt +++ b/Projects/AthAnalysis/CMakeLists.txt @@ -29,6 +29,12 @@ find_package( requests ) # Need to ensure AIDA is in the ROOT_INCLUDE_PATH for python dictionaries find_package( AIDA ) +# Set up the runtime environment for NumPy. +set( NumPyEnvironment_DIR "${CMAKE_SOURCE_DIR}" + CACHE PATH "Directory holding NumPyEnvironmentConfig.cmake" ) +mark_as_advanced( NumPyEnvironment_DIR ) +find_package( NumPyEnvironment ) + # Conditional compile flags: add_definitions( -DXAOD_ANALYSIS ) add_definitions( -DROOTCORE_RELEASE_SERIES=25 ) @@ -37,8 +43,6 @@ add_definitions( -DROOTCORE_RELEASE_SERIES=25 ) set( XAOD_ANALYSIS TRUE CACHE BOOL "Flag specifying that this is an analysis release" ) - - # Load all the files from the externals/ subdirectory: file( GLOB _externals "${CMAKE_CURRENT_SOURCE_DIR}/externals/*.cmake" ) foreach( _external ${_externals} ) diff --git a/Projects/AthAnalysis/NumPyEnvironmentConfig.cmake b/Projects/AthAnalysis/NumPyEnvironmentConfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ee66e186583fe405043d59de63f7be1cad93f1db --- /dev/null +++ b/Projects/AthAnalysis/NumPyEnvironmentConfig.cmake @@ -0,0 +1,21 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# +# Module for setting up the runtime environment for numpy from an LCG release. +# + +# Find the lapack installation that's part of LCG. Note that this call finds the +# CMake configuration included in the LAPACK installation, it does *not* use +# CMake's FindLAPACK.cmake module. +find_package( lapack ) + +# Extract the path of the library pointed to by the "lapack" imported library. +if( lapack_FOUND ) + get_target_property( _configs lapack IMPORTED_CONFIGURATIONS ) + list( GET _configs 0 _config ) + get_target_property( _libPath lapack IMPORTED_LOCATION_${_config} ) + get_filename_component( NumPyEnvironment_LIBRARY_DIRS ${_libPath} + DIRECTORY ) + unset( _configs ) + unset( _config ) + unset( _libPath ) +endif()