diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8a2880adfd4a9ef104e60e1aebe553c1f18e72e..501f20cbfeb3d1d0208d4618953f57067a9fea02 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ build:gcc9:opt:python3: variables: BINARY_TAG: x86_64-centos7-gcc9-opt BUILDDIR: build-opt-python3 - HEPTOOLS_VERSION: 96bpython3 + HEPTOOLS_VERSION: 97python3 script: - ci-utils/build artifacts: diff --git a/GaudiExamples/CMakeLists.txt b/GaudiExamples/CMakeLists.txt index ef6f9fcfff44ec83b81628d672b99d53ca031b81..0875470d2c83ec2e26de7306edef583f922b1398 100644 --- a/GaudiExamples/CMakeLists.txt +++ b/GaudiExamples/CMakeLists.txt @@ -14,7 +14,12 @@ gaudi_depends_on_subdirs(GaudiKernel GaudiUtils GaudiAlg RootCnv) find_package(AIDA) find_package(HepPDT) -find_package(ROOT COMPONENTS Tree RIO Hist Net REQUIRED) +find_package(ROOT COMPONENTS Core REQUIRED) +if(${ROOT_VERSION_MAJOR}.${ROOT_VERSION_MINOR} VERSION_LESS 6.20) + find_package(ROOT COMPONENTS Tree RIO Hist Net REQUIRED) +else() + find_package(ROOT COMPONENTS Tree RIO Hist Net ROOTHist REQUIRED) +endif() find_package(Boost COMPONENTS python${boost_python_version} REQUIRED) find_package(CLHEP) find_package(PythonLibs REQUIRED) diff --git a/GaudiExamples/options/CustomAppFromOptions.py b/GaudiExamples/options/CustomAppFromOptions.py index 056534404da806d1fbf0d4fc3e0c12daa6f7e9a6..a52a50b63f567e2bb5593d06bbbec107b81bdd73 100644 --- a/GaudiExamples/options/CustomAppFromOptions.py +++ b/GaudiExamples/options/CustomAppFromOptions.py @@ -12,7 +12,11 @@ # # The custom application class is implemented in C++ via ROOT interpreter -import cppyy +# Workaround for ROOT-10769 +import warnings +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + import cppyy # - we have to load GaudiKernel get the base class cppyy.gbl.gSystem.Load("libGaudiKernel.so") diff --git a/GaudiExamples/scripts/ArrayProperties.py b/GaudiExamples/scripts/ArrayProperties.py index 26f3c9439605f0b85397e6f01d0111c229da2e58..27fabf45158658f4d3dba0921ef91224ceef345a 100755 --- a/GaudiExamples/scripts/ArrayProperties.py +++ b/GaudiExamples/scripts/ArrayProperties.py @@ -47,7 +47,11 @@ if '__main__' == __name__: print(__doc__, __author__) # make sure cling can generate all required methods in Gaudi::Property - import cppyy + # Workaround for ROOT-10769 + import warnings + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + import cppyy cppyy.gbl.gInterpreter.Declare('#define NO_C_ARRAY_AS_PROPERTY_WARNING') cppyy.gbl.gInterpreter.Declare('#include "GaudiKernel/CArrayAsProperty.h"') diff --git a/GaudiExamples/scripts/ExtendedProperties2.py b/GaudiExamples/scripts/ExtendedProperties2.py index 17a8468cd3f86c171015f18afe3310097c985f22..ec595fa4fa743a56a4b73316626021279f503ee3 100755 --- a/GaudiExamples/scripts/ExtendedProperties2.py +++ b/GaudiExamples/scripts/ExtendedProperties2.py @@ -49,7 +49,11 @@ if '__main__' == __name__: print(__doc__, __author__) # make sure cling can generate all required methods in Gaudi::Property - import cppyy + # Workaround for ROOT-10769 + import warnings + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + import cppyy for h in ("GaudiKernel/SVectorAsProperty.h", "GaudiKernel/VectorsAsProperty.h"): cppyy.gbl.gInterpreter.Declare('#include "%s"' % h) diff --git a/GaudiPython/python/GaudiPython/Bindings.py b/GaudiPython/python/GaudiPython/Bindings.py index cd0034133ec614c9294cab8d7a867127c6c1508a..4f597e53dfae6d1e892f63f9d08ddcb946422be6 100644 --- a/GaudiPython/python/GaudiPython/Bindings.py +++ b/GaudiPython/python/GaudiPython/Bindings.py @@ -32,12 +32,11 @@ import sys import string import warnings import re -try: + +# Workaround for ROOT-10769 +with warnings.catch_warnings(): + warnings.simplefilter("ignore") import cppyy -except ImportError: - # FIXME: backward compatibility - print("# WARNING: using PyCintex as cppyy implementation") - import PyCintex as cppyy if sys.version_info >= (3, ): # Python 2 compatibility @@ -70,7 +69,13 @@ GaudiHandleArrayProperty = gbl.GaudiHandleArrayProperty DataObject = gbl.DataObject SUCCESS = gbl.StatusCode(gbl.StatusCode.SUCCESS, True) FAILURE = gbl.StatusCode(gbl.StatusCode.FAILURE, True) -nullptr = gbl.nullptr +# Workaround for ROOT-10770 +if hasattr(cppyy, 'nullptr'): + nullptr = cppyy.nullptr +elif hasattr(gbl, 'nullptr'): + nullptr = gbl.nullptr +else: + nullptr = None # Helper to create a StringProperty cppyy.gbl.gInterpreter.Declare(''' namespace GaudiPython { namespace Helpers { @@ -82,7 +87,7 @@ namespace GaudiPython { namespace Helpers { # toIntArray, toShortArray, etc. for l in [l for l in dir(Helper) if re.match("^to.*Array$", l)]: - exec ("%s = Helper.%s" % (l, l)) + exec("%s = Helper.%s" % (l, l)) __all__.append(l) # FIXME: (MCl) Hack to handle ROOT 5.18 and ROOT >= 5.20 @@ -98,9 +103,13 @@ else: # ----Convenient accessors to PyROOT functionality ---------------------------- -ROOT = cppyy.libPyROOT -makeNullPointer = cppyy.libPyROOT.MakeNullPointer -setOwnership = cppyy.libPyROOT.SetOwnership +# See https://sft.its.cern.ch/jira/browse/ROOT-10771 +if hasattr(cppyy, 'libPyROOT'): + ROOT = cppyy.libPyROOT +else: + import ROOT +makeNullPointer = ROOT.MakeNullPointer +setOwnership = ROOT.SetOwnership def deprecation(message): diff --git a/GaudiPython/tests/scripts/test_helpers_import.py b/GaudiPython/tests/scripts/test_helpers_import.py index 9d68007d3b9260b7e82710cbbee1b83ad0c88601..afb33f8ff5e6a7931a984e720f4d85c2ef632bb5 100644 --- a/GaudiPython/tests/scripts/test_helpers_import.py +++ b/GaudiPython/tests/scripts/test_helpers_import.py @@ -9,6 +9,10 @@ # or submit itself to any jurisdiction. # ##################################################################################### """Load the GaudiPython::Helper struct to check for Cling warnings.""" -import cppyy +# Workaround for ROOT-10769 +import warnings +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + import cppyy cppyy.gbl.GaudiPython.Helper diff --git a/RootCnv/src/RootPerfMonSvc.cpp b/RootCnv/src/RootPerfMonSvc.cpp index 99d0ac3d28aa6446314890d9f98acc8aa28175e1..66de61aa2cc4fb2d756c96050e95f4705aa25bca 100644 --- a/RootCnv/src/RootPerfMonSvc.cpp +++ b/RootCnv/src/RootPerfMonSvc.cpp @@ -30,6 +30,7 @@ #include "TBranch.h" #include "TDirectory.h" #include "TMap.h" +#include "TObjString.h" #include "TSystem.h" using namespace std;