diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 698cc8105f4bafa9f7855516003046e88ba43ab8..0d23b74502e92a4200fc6a4875c70d28352fdbd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ ##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # +# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # # # This software is distributed under the terms of the Apache version 2 licence, # # copied verbatim in the file "LICENSE". # @@ -85,9 +85,8 @@ build:gcc9:opt:python3: tags: - cvmfs variables: - BINARY_TAG: x86_64-centos7-gcc9-opt + BINARY_TAG: x86_64-centos7-gcc9+py3-opt BUILDDIR: build-opt-python3 - HEPTOOLS_VERSION: 97apython3 script: - ci-utils/build artifacts: @@ -203,7 +202,7 @@ test:gcc9:opt:python3: tags: - cvmfs variables: - BINARY_TAG: x86_64-centos7-gcc9-opt + BINARY_TAG: x86_64-centos7-gcc9+py3-opt BUILDDIR: build-opt-python3 script: - ci-utils/test diff --git a/ci-utils/build b/ci-utils/build index 571912be6232824f244b34b81c3597330b6561b7..136a740c7bfce040b21c0ae1674683e5a3457045 100755 --- a/ci-utils/build +++ b/ci-utils/build @@ -1,6 +1,6 @@ #!/bin/bash -e ##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # +# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # # # This software is distributed under the terms of the Apache version 2 licence, # # copied verbatim in the file "LICENSE". # @@ -12,7 +12,7 @@ . $(dirname $0)/env_setup.sh -${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -z -F 2000 +${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG/+py3/}/bin/ccache -z -F 2000 echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake @@ -22,4 +22,4 @@ echo 'set(CMAKE_USE_CCACHE ON CACHE BOOL "")' >> cache_preload.cmake make BUILDDIR=${BUILDDIR} " -${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG}/bin/ccache -s +${LCG_release_area}/ccache/${CCACHE_VERSION}/${BINARY_TAG/+py3/}/bin/ccache -s diff --git a/cmake/BinaryTagUtils.cmake b/cmake/BinaryTagUtils.cmake index 251fa36be8d62173d4af83a67073b4fedc0d9ec7..c1142f4612dfe732dcf5fa480d8e83ecbe9e827c 100644 --- a/cmake/BinaryTagUtils.cmake +++ b/cmake/BinaryTagUtils.cmake @@ -1,5 +1,5 @@ ##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # +# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # # # This software is distributed under the terms of the Apache version 2 licence, # # copied verbatim in the file "LICENSE". # @@ -114,6 +114,11 @@ macro(parse_binary_tag) set(${_variable}_MICROARCH) endif() + if(${_variable}_COMP MATCHES "\\+") + string(REGEX MATCHALL "[^+]+" ${_variable}_COMP_SUBTYPE "${${_variable}_COMP}") + list(GET ${_variable}_COMP_SUBTYPE 0 ${_variable}_COMP) + list(REMOVE_AT ${_variable}_COMP_SUBTYPE 0) + endif() if(${_variable}_COMP MATCHES "([^0-9.]+)([0-9.]+)") set(${_variable}_COMP_NAME ${CMAKE_MATCH_1}) set(${_variable}_COMP_VERSION ${CMAKE_MATCH_2}) @@ -277,6 +282,17 @@ function(compatible_binary_tags variable) # - finally reverse the list list(REVERSE archs) + # prepare the list of compiler sub-types (if needed) + set(comps ${BINARY_TAG_COMP}) + if(BINARY_TAG_COMP_SUBTYPE) + set(subtype ${BINARY_TAG_COMP}) + foreach(st ${BINARY_TAG_COMP_SUBTYPE}) + set(subtype "${subtype}+${st}") + list(APPEND comps "${subtype}") + endforeach() + list(REVERSE comps) + endif() + # prepare the list of build sub-types (if needed) set(subtypes) if(BINARY_TAG_SUBTYPE) @@ -291,11 +307,13 @@ function(compatible_binary_tags variable) set(out) foreach(a ${archs}) foreach(t ${types}) - foreach(st ${subtypes}) - list(APPEND out "${a}-${BINARY_TAG_OS}-${BINARY_TAG_COMP}-${t}${st}") + foreach(c ${comps}) + foreach(st ${subtypes}) + list(APPEND out "${a}-${BINARY_TAG_OS}-${c}-${t}${st}") + endforeach() + # the list of subtypes might be empty, so we explicitly add the simple tag + list(APPEND out "${a}-${BINARY_TAG_OS}-${c}-${t}") endforeach() - # the list of subtypes might be empty, so we explicitly add the simple tag - list(APPEND out "${a}-${BINARY_TAG_OS}-${BINARY_TAG_COMP}-${t}") endforeach() endforeach() diff --git a/cmake/UseHEPTools.cmake b/cmake/UseHEPTools.cmake index 786eba45b2595be06f82e9294ee578a23aaa1c78..ea4b0a227284e46a06a87f7b619c887609a7d88b 100644 --- a/cmake/UseHEPTools.cmake +++ b/cmake/UseHEPTools.cmake @@ -1,5 +1,5 @@ ##################################################################################### -# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # +# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # # # This software is distributed under the terms of the Apache version 2 licence, # # copied verbatim in the file "LICENSE". # @@ -37,18 +37,24 @@ macro(use_heptools heptools_version) LCG_externals_${LCG_SYSTEM}-opt.txt) endif() + if("${BINARY_TAG_COMP_SUBTYPE}" MATCHES "py3") + set(_lcg_py3 python3) + else() + set(_lcg_py3) + endif() + # Find the toolchain description find_file(LCG_TOOLCHAIN_INFO NAMES ${_info_names} HINTS ENV CMTPROJECTPATH - PATH_SUFFIXES LCG_${heptools_version}) + PATH_SUFFIXES LCG_${heptools_version}${_lcg_py3}) if(LCG_TOOLCHAIN_INFO) message(STATUS "Using heptools ${heptools_version} from ${LCG_TOOLCHAIN_INFO}") get_filename_component(LCG_releases ${LCG_TOOLCHAIN_INFO} PATH CACHE) set(LCG_external ${LCG_releases}) - if(LCG_releases MATCHES "LCG_${heptools_version}\$") + if(LCG_releases MATCHES "LCG_${heptools_version}${_lcg_py3}\$") get_filename_component(LCG_releases_base ${LCG_releases} PATH) else() set(LCG_releases_base ${LCG_releases}) @@ -93,7 +99,7 @@ macro(use_heptools heptools_version) # CACHE FILEPATH "The CMake toolchain file" FORCE) else() - message(FATAL_ERROR "Cannot find heptools ${heptools_version}.") + message(FATAL_ERROR "Cannot find heptools ${heptools_version} (using suffix LCG_${heptools_version}${_lcg_py3}).") endif() endmacro()