From e431c02535f5740f249a2af7899102be30278d51 Mon Sep 17 00:00:00 2001 From: Guytri KASTANE Date: Fri, 22 Mar 2024 15:32:09 +0100 Subject: [PATCH] spns #38031: compilation of root and URANIE on DB12 --- applications/SALOME-master-native.pyconf | 2 +- .../patches/root-6.22-numeric_limits.patch | 13 +++ products/patches/root-6.22-python-11.patch | 82 +++++++++++++++++++ products/patches/root-include_limits.patch | 11 +++ products/root.pyconf | 8 +- 5 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 products/patches/root-6.22-numeric_limits.patch create mode 100644 products/patches/root-6.22-python-11.patch create mode 100644 products/patches/root-include_limits.patch diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 8dc8cc9..1d0f5c3 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -261,10 +261,10 @@ __overwrite__ : { __condition__ : "VARS.dist in ['DB12']" 'APPLICATION.products.CONFIGURATION' : 'master' - 'APPLICATION.rm_products' : ['root', 'URANIE'] 'APPLICATION.products.cmake' : 'native' # TTK requires cmake > 3.21 'APPLICATION.products.opencv' : {tag: '3.2.0', base: 'no', section: 'version_3_2_0_DB12'} 'APPLICATION.products.cminpack' : 'native' + 'APPLICATION.products.root' : {tag: '6.22.02', base: 'no', section: 'version_6_22_02_DB12'} 'APPLICATION.products.swig' : '4.0.2' 'APPLICATION.products.tbb' : '2021.9.0' 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_DB12' } diff --git a/products/patches/root-6.22-numeric_limits.patch b/products/patches/root-6.22-numeric_limits.patch new file mode 100644 index 0000000..b40911f --- /dev/null +++ b/products/patches/root-6.22-numeric_limits.patch @@ -0,0 +1,13 @@ + +diff -Naur root/core/foundation/inc/ROOT/libcpp_string_view.h root_dev/core/foundation/inc/ROOT/libcpp_string_view.h +--- root/core/foundation/inc/ROOT/libcpp_string_view.h 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/core/foundation/inc/ROOT/libcpp_string_view.h 2024-03-22 11:00:07.359412709 +0100 +@@ -8,6 +8,8 @@ + // + //===----------------------------------------------------------------------===// + ++#include ++ + #ifndef _LIBCPP_LFTS_STRING_VIEW + #define _LIBCPP_LFTS_STRING_VIEW + diff --git a/products/patches/root-6.22-python-11.patch b/products/patches/root-6.22-python-11.patch new file mode 100644 index 0000000..2cf6516 --- /dev/null +++ b/products/patches/root-6.22-python-11.patch @@ -0,0 +1,82 @@ +diff -Naur root/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx +--- root/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPConstructor.cxx 2024-03-22 12:43:13.311091738 +0100 +@@ -11,6 +11,12 @@ + // Standard + #include + ++// https://bugzilla.redhat.com/show_bug.cgi?id=2021796 ++#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE) ++static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) ++{ ob->ob_type = type; } ++#define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject*)(ob), type) ++#endif + + //- protected members -------------------------------------------------------- + bool CPyCppyy::CPPConstructor::InitExecutor_(Executor*& executor, CallContext*) +@@ -123,7 +129,7 @@ + if (pyclass) { + self->SetSmart((PyObject*)Py_TYPE(self)); + Py_DECREF((PyObject*)Py_TYPE(self)); +- Py_TYPE(self) = (PyTypeObject*)pyclass; ++ Py_SET_TYPE(self,(PyTypeObject*)pyclass); + } + } + +diff -Naur root/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx +--- root/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx 2024-03-22 13:35:13.353430656 +0100 +@@ -764,7 +764,6 @@ + 0, // tp_as_buffer + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | + Py_TPFLAGS_CHECKTYPES, // tp_flags + (char*)"cppyy object proxy (internal)", // tp_doc + 0, // tp_traverse +diff -Naur root/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx +--- root/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx 2024-03-22 11:20:59.002747612 +0100 +@@ -1,7 +1,7 @@ + // Bindings + #include "CPyCppyy.h" + #include "structmember.h" // from Python +-#if PY_VERSION_HEX >= 0x02050000 ++#if PY_VERSION_HEX >= 0x02050000 && PY_VERSION_HEX < 0x030B0000 + #include "code.h" // from Python + #else + #include "compile.h" // from Python +diff -Naur root/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx +--- root/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx 2024-03-22 13:36:53.326012656 +0100 +@@ -78,8 +78,7 @@ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (ternaryfunc)tpc_call, // tp_call + 0, 0, 0, 0, +- Py_TPFLAGS_DEFAULT | +- Py_TPFLAGS_HAVE_GC, // tp_flags ++ Py_TPFLAGS_DEFAULT, // tp_flags + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + #if PY_VERSION_HEX >= 0x02030000 + , 0 // tp_del +diff -Naur root/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx root_dev/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx +--- root/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx 2020-08-17 14:41:56.000000000 +0200 ++++ root_dev/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx 2024-03-22 13:42:08.271843845 +0100 +@@ -45,7 +45,7 @@ + ((PyVarObject&)CPyCppyy_NoneType).ob_size = 0; + + CPyCppyy_NoneType.tp_name = const_cast("CPyCppyy_NoneType"); +- CPyCppyy_NoneType.tp_flags = Py_TPFLAGS_HAVE_RICHCOMPARE | Py_TPFLAGS_HAVE_GC; ++ CPyCppyy_NoneType.tp_flags = Py_TPFLAGS_HAVE_RICHCOMPARE; + + CPyCppyy_NoneType.tp_traverse = (traverseproc)0; + CPyCppyy_NoneType.tp_clear = (inquiry)0; +@@ -135,6 +135,7 @@ + CPyCppyy_NoneType.tp_traverse = Py_TYPE(pyobj)->tp_traverse; + CPyCppyy_NoneType.tp_clear = Py_TYPE(pyobj)->tp_clear; + CPyCppyy_NoneType.tp_free = Py_TYPE(pyobj)->tp_free; ++ CPyCppyy_NoneType.tp_flags = Py_TYPE(pyobj)->tp_flags; + } else if (CPyCppyy_NoneType.tp_traverse != Py_TYPE(pyobj)->tp_traverse) { + // TODO: SystemError? + std::cerr << "in CPyCppyy::MemoryRegulater, unexpected object of type: " + diff --git a/products/patches/root-include_limits.patch b/products/patches/root-include_limits.patch new file mode 100644 index 0000000..3c0c86d --- /dev/null +++ b/products/patches/root-include_limits.patch @@ -0,0 +1,11 @@ +--- root.ref/core/foundation/inc/ROOT/libcpp_string_view.h 2020-08-17 14:41:56.000000000 +0200 ++++ root.dev/core/foundation/inc/ROOT/libcpp_string_view.h 2023-10-13 14:49:56.207768679 +0200 +@@ -186,7 +186,7 @@ + #include + #include + #include +- ++#include + //#include <__debug> + + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) && !defined(_MSC_VER) diff --git a/products/root.pyconf b/products/root.pyconf index 649e344..7cdb7b5 100644 --- a/products/root.pyconf +++ b/products/root.pyconf @@ -66,10 +66,16 @@ version_6_22_02: patches : ['root-6.22.02.patch'] } +version_6_22_02_DB12: +{ + get_source : "archive" + patches : ['root-6.22.02.patch', 'root-6.22-python-11.patch', 'root-include_limits.patch'] +} + version_6_22_02_CO9: { get_source : "archive" - patches : ['root-6.22.02.patch', 'root-include_limits_CO9.patch'] + patches : ['root-6.22.02.patch', 'root-include_limits.patch'] } version_6_22_02_UB22_04: -- 2.39.2