diff --git a/root-boolean-numpy-array.patch b/root-boolean-numpy-array.patch new file mode 100644 index 0000000..e5d6482 --- /dev/null +++ b/root-boolean-numpy-array.patch @@ -0,0 +1,45 @@ +From 2b3dd4f1bfecea5b1b936d5507f8b0c664322a19 Mon Sep 17 00:00:00 2001 +From: Jonas Rembser +Date: Wed, 6 Sep 2023 02:16:33 +0200 +Subject: [PATCH] [RF][PyROOT] Avoid boolean operators on numpy arrays in unit + test + +The `n_in_range` reference value in the unit test +`roodataset_numpy.TestRooDataSetNumpy.test_ignoring_out_of_range` +apparently doesn't get computed right on some 32 platforms. + +I can't reproduce the problem, but I'm sure it will be fixed by avoiding +the use of the operators `&` and `|` with numpy arrays. Just doing a +manual loop in Python should be more platform independent. + +Closes #12162. +--- + .../pythonizations/test/roofit/roodataset_numpy.py | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/bindings/pyroot/pythonizations/test/roofit/roodataset_numpy.py b/bindings/pyroot/pythonizations/test/roofit/roodataset_numpy.py +index 79259af321..5587677c45 100644 +--- a/bindings/pyroot/pythonizations/test/roofit/roodataset_numpy.py ++++ b/bindings/pyroot/pythonizations/test/roofit/roodataset_numpy.py +@@ -135,9 +135,15 @@ class TestRooDataSetNumpy(unittest.TestCase): + cat.defineType("minus", -1) + cat.defineType("plus", +1) + +- in_x_range = (data["x"] <= x.getMax()) & (data["x"] >= x.getMin()) +- in_cat_range = (data["cat"] == -1) | (data["cat"] == +1) +- n_in_range = np.sum(in_x_range & in_cat_range) ++ # Use manual loop because we had some problems with numpys boolean ++ # comparisions in the past (see GitHub issue #12162). ++ n_in_range = 0 ++ for i in range(n_events): ++ in_x_range = data["x"][i] <= x.getMax() and data["x"][i] >= x.getMin() ++ in_cat_range = (data["cat"][i] == -1) or (data["cat"][i] == +1) ++ is_in_range = in_x_range and in_cat_range ++ if is_in_range: ++ n_in_range = n_in_range + 1 + + dataset_numpy = ROOT.RooDataSet.from_numpy(data, {x, cat}, name="dataSetNumpy") + +-- +2.41.0 + diff --git a/root-pcre2-6.28.patch b/root-pcre2-6.28.patch new file mode 100644 index 0000000..db907b5 --- /dev/null +++ b/root-pcre2-6.28.patch @@ -0,0 +1,52 @@ +diff -ur root-6.28.06.orig/core/base/CMakeLists.txt root-6.28.06/core/base/CMakeLists.txt +--- root-6.28.06.orig/core/base/CMakeLists.txt 2023-08-28 13:26:43.000000000 +0200 ++++ root-6.28.06/core/base/CMakeLists.txt 2023-10-02 01:53:35.956143717 +0200 +@@ -212,9 +212,15 @@ + + ROOT_OBJECT_LIBRARY(Base ${BASE_SOURCES}) + ++if (PCRE2_FOUND) ++ set(PCRE_INCDIR ${PCRE2_INCLUDE_DIR}) ++else() ++ set(PCRE_INCDIR ${PCRE_INCLUDE_DIR}) ++endif() ++ + target_include_directories(Base PRIVATE + ${BASE_V7_INC} +- ${PCRE_INCLUDE_DIR} ++ ${PCRE_INCDIR} + res + ${CMAKE_SOURCE_DIR}/core/foundation/res + ${CMAKE_SOURCE_DIR}/core/clib/inc +@@ -237,6 +243,11 @@ + ${CMAKE_BINARY_DIR}/ginclude/TApplicationCommandLineOptionsHelp.h + ) + ++if(PCRE2_FOUND) ++ set_source_files_properties(src/TPRegexp.cxx ++ PROPERTIES COMPILE_DEFINITIONS USE_PCRE2) ++endif() ++ + ROOT_INSTALL_HEADERS(${BASE_HEADER_DIRS}) + + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/man) +diff -ur root-6.28.06.orig/core/CMakeLists.txt root-6.28.06/core/CMakeLists.txt +--- root-6.28.06.orig/core/CMakeLists.txt 2023-08-28 13:26:43.000000000 +0200 ++++ root-6.28.06/core/CMakeLists.txt 2023-10-02 01:47:00.134174041 +0200 +@@ -261,9 +261,15 @@ + + target_include_directories(G__Core PRIVATE ${CMAKE_SOURCE_DIR}/core/clingutils/inc) + ++if (PCRE2_FOUND) ++ set (PCRE_TGT PCRE2::PCRE2) ++else() ++ set (PCRE_TGT PCRE::PCRE) ++endif() ++ + target_link_libraries(Core + PRIVATE +- PCRE::PCRE ++ ${PCRE_TGT} + ${LIBLZMA_LIBRARIES} + xxHash::xxHash + LZ4::LZ4 diff --git a/root-pcre2.patch b/root-pcre2.patch new file mode 100644 index 0000000..8d1adee --- /dev/null +++ b/root-pcre2.patch @@ -0,0 +1,436 @@ +From f89fc640f9ca1b2cccf0dc496b0b7ea434b53fad Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Mon, 2 Oct 2023 09:25:13 +0200 +Subject: [PATCH] Support PCRE2 + +--- + .../pythonizations/test/import_load_libs.py | 1 + + cmake/modules/FindPCRE2.cmake | 106 ++++++++++++++++++ + cmake/modules/SearchInstalledSoftware.cmake | 17 +-- + core/base/CMakeLists.txt | 9 +- + core/base/src/TPRegexp.cxx | 99 +++++++++++++++- + tutorials/legacy/regexp/regexp.C | 6 +- + 6 files changed, 223 insertions(+), 15 deletions(-) + create mode 100644 cmake/modules/FindPCRE2.cmake + +diff --git a/bindings/pyroot/pythonizations/test/import_load_libs.py b/bindings/pyroot/pythonizations/test/import_load_libs.py +index 087db7da5c..179c76f6fd 100644 +--- a/bindings/pyroot/pythonizations/test/import_load_libs.py ++++ b/bindings/pyroot/pythonizations/test/import_load_libs.py +@@ -23,6 +23,7 @@ class ImportLoadLibs(unittest.TestCase): + 'libc', + 'libdl', + 'libpcre', ++ 'libpcre2-8', + # libCling and dependencies + 'libCling.*', + 'librt', +diff --git a/cmake/modules/FindPCRE2.cmake b/cmake/modules/FindPCRE2.cmake +new file mode 100644 +index 0000000000..2417453e8b +--- /dev/null ++++ b/cmake/modules/FindPCRE2.cmake +@@ -0,0 +1,106 @@ ++# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. ++# All rights reserved. ++# ++# For the licensing terms see $ROOTSYS/LICENSE. ++# For the list of contributors see $ROOTSYS/README/CREDITS. ++ ++#.rst: ++# FindPCRE2 ++# -------- ++# ++# Find PCRE2 library ++# ++# Imported Targets ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines :prop_tgt:`IMPORTED` target: ++# ++# ``PCRE2::PCRE2`` ++# The pcre2 library, if found. ++# ++# Result Variables ++# ^^^^^^^^^^^^^^^^ ++# This module will set the following variables in your project: ++# ++# ``PCRE2_FOUND`` ++# True if PCRE2 has been found. ++# ``PCRE2_INCLUDE_DIRS`` ++# Where to find pcre2.h ++# ``PCRE2_LIBRARIES`` ++# The libraries to link against to use PCRE2. ++# ``PCRE2_VERSION`` ++# The version of the PCRE2 found (e.g. 10.42) ++# ++# Obsolete variables ++# ^^^^^^^^^^^^^^^^^^ ++# ++# The following variables may also be set, for backwards compatibility: ++# ++# ``PCRE2_PCRE2_LIBRARY`` ++# where to find the PCRE2_PCRE2 library. ++# ``PCRE2_INCLUDE_DIR`` ++# where to find the pcre2.h header (same as PCRE2_INCLUDE_DIRS) ++# ++ ++foreach(var PCRE2_FOUND PCRE2_INCLUDE_DIR PCRE2_PCRE2_LIBRARY PCRE2_LIBRARIES) ++ unset(${var} CACHE) ++endforeach() ++ ++find_path(PCRE2_INCLUDE_DIR NAMES pcre2.h PATH_SUFFIXES include) ++mark_as_advanced(PCRE2_INCLUDE_DIR) ++ ++if (PCRE2_INCLUDE_DIR AND EXISTS "${PCRE2_INCLUDE_DIR}/pcre2.h") ++ file(STRINGS "${PCRE2_INCLUDE_DIR}/pcre2.h" PCRE2_H REGEX "^#define PCRE2_(MAJOR|MINOR).*$") ++ string(REGEX REPLACE "^.*PCRE2_MAJOR[ ]+([0-9]+).*$" "\\1" PCRE2_VERSION_MAJOR "${PCRE2_H}") ++ string(REGEX REPLACE "^.*PCRE2_MINOR[ ]+([0-9]+).*$" "\\1" PCRE2_VERSION_MINOR "${PCRE2_H}") ++ set(PCRE2_VERSION "${PCRE2_VERSION_MAJOR}.${PCRE2_VERSION_MINOR}") ++endif() ++ ++if(NOT PCRE2_PCRE2_LIBRARY) ++ find_library(PCRE2_PCRE2_LIBRARY_RELEASE NAMES pcre2-8) ++ find_library(PCRE2_PCRE2_LIBRARY_DEBUG NAMES pcre2-8${CMAKE_DEBUG_POSTFIX} pcre2-8d) ++ include(SelectLibraryConfigurations) ++ select_library_configurations(PCRE2_PCRE2) ++endif() ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(PCRE2 ++ REQUIRED_VARS ++ PCRE2_INCLUDE_DIR ++ PCRE2_PCRE2_LIBRARY ++ VERSION_VAR ++ PCRE2_VERSION ++) ++ ++if(PCRE2_FOUND) ++ set(PCRE2_INCLUDE_DIRS "${PCRE2_INCLUDE_DIR}") ++ ++ if (NOT PCRE2_LIBRARIES) ++ set(PCRE2_LIBRARIES "${PCRE2_PCRE2_LIBRARY}") ++ endif() ++ ++ if(NOT TARGET PCRE2::PCRE2) ++ add_library(PCRE2::PCRE2 UNKNOWN IMPORTED) ++ set_target_properties(PCRE2::PCRE2 PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIRS}") ++ ++ if(PCRE2_PCRE2_LIBRARY_DEBUG) ++ set_property(TARGET PCRE2::PCRE2 APPEND PROPERTY ++ IMPORTED_CONFIGURATIONS DEBUG) ++ set_target_properties(PCRE2::PCRE2 PROPERTIES ++ IMPORTED_LOCATION_DEBUG "${PCRE2_PCRE2_LIBRARY_DEBUG}") ++ endif() ++ ++ if(PCRE2_PCRE2_LIBRARY_RELEASE) ++ set_property(TARGET PCRE2::PCRE2 APPEND PROPERTY ++ IMPORTED_CONFIGURATIONS RELEASE) ++ set_target_properties(PCRE2::PCRE2 PROPERTIES ++ IMPORTED_LOCATION_RELEASE "${PCRE2_PCRE2_LIBRARY_RELEASE}") ++ endif() ++ ++ if(NOT PCRE2_PCRE2_LIBRARY_DEBUG AND NOT PCRE2_PCRE2_LIBRARY_RELEASE) ++ set_property(TARGET PCRE2::PCRE2 APPEND PROPERTY ++ IMPORTED_LOCATION "${PCRE2_PCRE2_LIBRARY}") ++ endif() ++ endif() ++endif() +diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake +index 464155fd50..252aa56737 100644 +--- a/cmake/modules/SearchInstalledSoftware.cmake ++++ b/cmake/modules/SearchInstalledSoftware.cmake +@@ -204,13 +204,16 @@ if(NOT builtin_pcre) + foreach(suffix FOUND INCLUDE_DIR PCRE_LIBRARY) + unset(PCRE_${suffix} CACHE) + endforeach() +- if(fail-on-missing) +- find_package(PCRE REQUIRED) +- else() +- find_package(PCRE) +- if(NOT PCRE_FOUND) +- message(STATUS "PCRE not found. Switching on builtin_pcre option") +- set(builtin_pcre ON CACHE BOOL "Enabled because PCRE not found (${builtin_pcre_description})" FORCE) ++ find_package(PCRE2) ++ if(NOT PCRE2_FOUND) ++ if(fail-on-missing) ++ find_package(PCRE REQUIRED) ++ else() ++ find_package(PCRE) ++ if(NOT PCRE_FOUND) ++ message(STATUS "PCRE not found. Switching on builtin_pcre option") ++ set(builtin_pcre ON CACHE BOOL "Enabled because PCRE not found (${builtin_pcre_description})" FORCE) ++ endif() + endif() + endif() + endif() +diff --git a/core/base/src/TPRegexp.cxx b/core/base/src/TPRegexp.cxx +index 949b8cc8e9..d70f3e5b8b 100644 +--- a/core/base/src/TPRegexp.cxx ++++ b/core/base/src/TPRegexp.cxx +@@ -25,19 +25,36 @@ found at : http://perldoc.perl.org/perlre.html + #include "TObjString.h" + #include "TError.h" + ++#ifdef USE_PCRE2 ++#ifdef R__WIN32 ++#define PCRE2_STATIC ++#endif ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include ++#define PCRE_CASELESS PCRE2_CASELESS ++#define PCRE_MULTILINE PCRE2_MULTILINE ++#define PCRE_DOTALL PCRE2_DOTALL ++#define PCRE_EXTENDED PCRE2_EXTENDED ++#define PCRE_ERROR_NOMATCH PCRE2_ERROR_NOMATCH ++#else + #ifdef R__WIN32 + #define PCRE_STATIC + #endif + #include ++#endif + + #include + #include + + struct PCREPriv_t { ++#ifdef USE_PCRE2 ++ pcre2_code *fPCRE; ++ PCREPriv_t() { fPCRE = nullptr; } ++#else + pcre *fPCRE; + pcre_extra *fPCREExtra; +- + PCREPriv_t() { fPCRE = nullptr; fPCREExtra = nullptr; } ++#endif + }; + + +@@ -79,10 +96,15 @@ TPRegexp::TPRegexp(const TPRegexp &p) + + TPRegexp::~TPRegexp() + { ++#ifdef USE_PCRE2 ++ if (fPriv->fPCRE) ++ pcre2_code_free(fPriv->fPCRE); ++#else + if (fPriv->fPCRE) + pcre_free(fPriv->fPCRE); + if (fPriv->fPCREExtra) + pcre_free(fPriv->fPCREExtra); ++#endif + delete fPriv; + } + +@@ -93,12 +115,18 @@ TPRegexp &TPRegexp::operator=(const TPRegexp &p) + { + if (this != &p) { + fPattern = p.fPattern; ++#ifdef USE_PCRE2 ++ if (fPriv->fPCRE) ++ pcre2_code_free(fPriv->fPCRE); ++ fPriv->fPCRE = nullptr; ++#else + if (fPriv->fPCRE) + pcre_free(fPriv->fPCRE); + fPriv->fPCRE = nullptr; + if (fPriv->fPCREExtra) + pcre_free(fPriv->fPCREExtra); + fPriv->fPCREExtra = nullptr; ++#endif + fPCREOpts = p.fPCREOpts; + } + return *this; +@@ -197,31 +225,50 @@ TString TPRegexp::GetModifiers() const + + void TPRegexp::Compile() + { ++#ifdef USE_PCRE2 ++ if (fPriv->fPCRE) ++ pcre2_code_free(fPriv->fPCRE); ++#else + if (fPriv->fPCRE) + pcre_free(fPriv->fPCRE); ++#endif + + if (fPCREOpts & kPCRE_DEBUG_MSGS) + Info("Compile", "PREGEX compiling %s", fPattern.Data()); + ++#ifdef USE_PCRE2 ++ int errcode; ++ PCRE2_SIZE patIndex; ++ fPriv->fPCRE = pcre2_compile((PCRE2_SPTR)fPattern.Data(), fPattern.Length(), ++ fPCREOpts & kPCRE_INTMASK, ++ &errcode, &patIndex, nullptr); ++#else + const char *errstr; + Int_t patIndex; + fPriv->fPCRE = pcre_compile(fPattern.Data(), fPCREOpts & kPCRE_INTMASK, + &errstr, &patIndex, nullptr); ++#endif + + if (!fPriv->fPCRE) { ++#ifdef USE_PCRE2 ++ PCRE2_UCHAR errstr[256]; ++ pcre2_get_error_message(errcode, errstr, 256); ++#endif + if (fgThrowAtCompileError) { + throw std::runtime_error + (TString::Format("TPRegexp::Compile() compilation of TPRegexp(%s) failed at: %d because %s", +- fPattern.Data(), patIndex, errstr).Data()); ++ fPattern.Data(), (int)patIndex, errstr).Data()); + } else { + Error("Compile", "compilation of TPRegexp(%s) failed at: %d because %s", +- fPattern.Data(), patIndex, errstr); ++ fPattern.Data(), (int)patIndex, errstr); + return; + } + } + ++#ifndef USE_PCRE2 + if (fPriv->fPCREExtra || (fPCREOpts & kPCRE_OPTIMIZE)) + Optimize(); ++#endif + } + + //////////////////////////////////////////////////////////////////////////////// +@@ -229,6 +276,7 @@ void TPRegexp::Compile() + + void TPRegexp::Optimize() + { ++#ifndef USE_PCRE2 + if (fPriv->fPCREExtra) + pcre_free(fPriv->fPCREExtra); + +@@ -243,6 +291,7 @@ void TPRegexp::Optimize() + Error("Optimize", "Optimization of TPRegexp(%s) failed: %s", + fPattern.Data(), errstr); + } ++#endif + } + + //////////////////////////////////////////////////////////////////////////////// +@@ -308,21 +357,43 @@ Int_t TPRegexp::MatchInternal(const TString &s, Int_t start, + Int_t nMaxMatch, TArrayI *pos) const + { + Int_t *offVec = new Int_t[3*nMaxMatch]; ++ ++#ifdef USE_PCRE2 ++ pcre2_match_data *match_data; ++ match_data = pcre2_match_data_create_from_pattern(fPriv->fPCRE, nullptr); ++ Int_t nrMatch = pcre2_match(fPriv->fPCRE, (PCRE2_SPTR8)s.Data(), ++ s.Length(), start, 0, ++ match_data, nullptr); ++#else + // pcre_exec allows less options - see pcre_internal.h PUBLIC_EXEC_OPTIONS. + Int_t nrMatch = pcre_exec(fPriv->fPCRE, fPriv->fPCREExtra, s.Data(), + s.Length(), start, 0, + offVec, 3*nMaxMatch); ++#endif + + if (nrMatch == PCRE_ERROR_NOMATCH) + nrMatch = 0; + else if (nrMatch <= 0) { + Error("Match","pcre_exec error = %d", nrMatch); ++#ifdef USE_PCRE2 ++ pcre2_match_data_free(match_data); ++#endif + delete [] offVec; + return 0; + } + +- if (pos) ++ if (pos) { ++#ifdef USE_PCRE2 ++ PCRE2_SIZE *oVec = pcre2_get_ovector_pointer(match_data); ++ for (int i = 0; i < 2 * nrMatch; ++i) ++ offVec[i] = oVec[i]; ++#endif + pos->Set(2*nrMatch, offVec); ++ } ++ ++#ifdef USE_PCRE2 ++ pcre2_match_data_free(match_data); ++#endif + delete [] offVec; + + return nrMatch; +@@ -404,13 +475,24 @@ Int_t TPRegexp::SubstituteInternal(TString &s, const TString &replacePattern, + Int_t offset = start; + Int_t last = 0; + ++#ifdef USE_PCRE2 ++ pcre2_match_data *match_data; ++ match_data = pcre2_match_data_create_from_pattern(fPriv->fPCRE, nullptr); ++#endif ++ + while (kTRUE) { + + // find next matching subs + // pcre_exec allows less options - see pcre_internal.h PUBLIC_EXEC_OPTIONS. ++#ifdef USE_PCRE2 ++ Int_t nrMatch = pcre2_match(fPriv->fPCRE, (PCRE2_SPTR)s.Data(), ++ s.Length(), offset, 0, ++ match_data, nullptr); ++#else + Int_t nrMatch = pcre_exec(fPriv->fPCRE, fPriv->fPCREExtra, s.Data(), + s.Length(), offset, 0, + offVec, 3*nMaxMatch); ++#endif + + if (nrMatch == PCRE_ERROR_NOMATCH) { + break; +@@ -419,6 +501,12 @@ Int_t TPRegexp::SubstituteInternal(TString &s, const TString &replacePattern, + break; + } + ++#ifdef USE_PCRE2 ++ PCRE2_SIZE *oVec = pcre2_get_ovector_pointer(match_data); ++ for (int i = 0; i < 2 * nrMatch; ++i) ++ offVec[i] = oVec[i]; ++#endif ++ + // append anything previously unmatched, but not substituted + if (last <= offVec[0]) { + fin += s(last,offVec[0]-last); +@@ -446,6 +534,9 @@ Int_t TPRegexp::SubstituteInternal(TString &s, const TString &replacePattern, + } + } + ++#ifdef USE_PCRE2 ++ pcre2_match_data_free(match_data); ++#endif + delete [] offVec; + + fin += s(last,s.Length()-last); +diff --git a/tutorials/legacy/regexp/regexp.C b/tutorials/legacy/regexp/regexp.C +index 995b823bce..f38ed6799e 100644 +--- a/tutorials/legacy/regexp/regexp.C ++++ b/tutorials/legacy/regexp/regexp.C +@@ -94,11 +94,11 @@ void regexp() + // criteria: + // 1) It should be of the form string1@string2 . The "^" and "$" ensure that we compare the complete + // email string +- // 2) ([\\w-\\.]+) : ++ // 2) ([\\w\\-\\.]+) : + // string1 is only allowed to be composed out of the alphanumeric characters, "-" and "." . + // The "+" ensures that string1 can not be empty . + // 3) string2 is matched against three different parts : +- // a. ((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+)) : ++ // a. ((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w\\-]+\\.)+)) : + // This regular expression ensures that EITHER the string starts with "[" followed by three groups + // of numbers, separated by "." , where each group has 1 to 3 numbers, OR alphanumeric strings, + // possibly containing "-" characters, separated by "." . +@@ -108,7 +108,7 @@ void regexp() + // At most one "]" character . + + TString s5("fons.rademakers@cern.ch"); +- TPRegexp r5("^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"); ++ TPRegexp r5("^([\\w\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"); + cout << "Check if the email address \"" << s5 << "\" is valid: " << (r5.MatchB(s5) ? "TRUE" : "FALSE") << endl; + + // Substitute Example with pattern modifier : +-- +2.41.0 + diff --git a/root-tmva-rbdt.patch b/root-tmva-rbdt.patch new file mode 100644 index 0000000..b7afb2d --- /dev/null +++ b/root-tmva-rbdt.patch @@ -0,0 +1,40 @@ +From c3eb92abb450aee2e3a798218ca2d309524dab11 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Sat, 14 Oct 2023 15:51:16 +0200 +Subject: [PATCH] src/RBDT.cxx is a source file of libTMVAUtils and should not + also be a source file of libTMVA. Remove it. Adjust test using symbols + defined in this source file to link to libTMVAUtils instead of libTMVA. + +--- + tmva/tmva/CMakeLists.txt | 1 - + tmva/tmva/test/CMakeLists.txt | 2 +- + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tmva/tmva/CMakeLists.txt b/tmva/tmva/CMakeLists.txt +index 84efce9d59..109f4c1021 100644 +--- a/tmva/tmva/CMakeLists.txt ++++ b/tmva/tmva/CMakeLists.txt +@@ -334,7 +334,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(TMVA + src/PDEFoamVect.cxx + src/PDF.cxx + src/QuickMVAProbEstimator.cxx +- src/RBDT.cxx + src/Ranking.cxx + src/Reader.cxx + src/RegressionVariance.cxx +diff --git a/tmva/tmva/test/CMakeLists.txt b/tmva/tmva/test/CMakeLists.txt +index ebe1be187b..5dcf5175f2 100644 +--- a/tmva/tmva/test/CMakeLists.txt ++++ b/tmva/tmva/test/CMakeLists.txt +@@ -29,7 +29,7 @@ if(dataframe) + # Tree inference system and user interface + if(NOT MSVC OR ${LLVM_VERSION} VERSION_LESS 13.0.0 OR llvm13_broken_tests) + ROOT_ADD_GTEST(branchlessForest branchlessForest.cxx LIBRARIES TMVA) +- ROOT_ADD_GTEST(rbdt rbdt.cxx LIBRARIES ROOTVecOps TMVA) ++ ROOT_ADD_GTEST(rbdt rbdt.cxx LIBRARIES ROOTVecOps TMVAUtils) + endif() + endif() + +-- +2.41.0 + diff --git a/root.spec b/root.spec index aa32b3c..b880090 100644 --- a/root.spec +++ b/root.spec @@ -53,7 +53,7 @@ %global __provides_exclude_from ^%{python3_sitearch}/lib.*\\.so$ Name: root -Version: 6.28.06 +Version: 6.28.08 %global libversion %(cut -d. -f 1-2 <<< %{version}) Release: 1%{?dist} Summary: Numerical data analysis framework @@ -102,7 +102,7 @@ Patch7: %{name}-big-endian-byte-swap.patch # https://github.com/root-project/root/pull/12375 Patch8: %{name}-use-consistent-wording-in-tmva-test-comments.patch # https://github.com/root-project/root/pull/12390 -Patch9: %{name}-stressvector-test-fails-on-ix86.patch +Patch9: %{name}-stressvector-test-fails-on-ix86.patch # https://github.com/root-project/root/pull/12423 Patch10: %{name}-dont-install-roofit-files-fix.patch # https://github.com/root-project/root/issues/12427 @@ -110,6 +110,18 @@ Patch10: %{name}-dont-install-roofit-files-fix.patch Patch11: %{name}-fixes-for-32bit-builds.patch # https://github.com/root-project/root/pull/12476 Patch12: %{name}-do-not-remove-Wp-before-D-and-U.patch +# Avoid boolean operators on numpy arrays in unit test +# https://github.com/root-project/root/issues/12162 +# https://github.com/root-project/root/pull/13612 +Patch13: root-boolean-numpy-array.patch +# Port to pcre2 +# https://github.com/root-project/root/issues/11395 +# https://github.com/root-project/root/pull/13771 +Patch14: root-pcre2.patch +Patch15: root-pcre2-6.28.patch +# src/RBDT.cxx is a source file of both libTMVA and libTMVAUtils +# https://github.com/root-project/root/pull/13863 +Patch16: root-tmva-rbdt.patch BuildRequires: gcc-c++ BuildRequires: gcc-gfortran @@ -125,7 +137,7 @@ BuildRequires: fcgi-devel BuildRequires: ftgl-devel BuildRequires: gl2ps-devel BuildRequires: glew-devel -BuildRequires: pcre-devel +BuildRequires: pcre2-devel BuildRequires: zlib-devel BuildRequires: xz-devel BuildRequires: lz4-devel @@ -169,8 +181,6 @@ BuildRequires: R-RInside-devel BuildRequires: readline-devel BuildRequires: tbb-devel >= 2018 BuildRequires: libuuid-devel -BuildRequires: emacs -BuildRequires: emacs-el BuildRequires: graphviz-devel BuildRequires: expat-devel BuildRequires: pythia8-devel >= 8.1.80 @@ -222,9 +232,6 @@ Requires: %{name}-net%{?_isa} = %{version}-%{release} Requires: %{name}-tree%{?_isa} = %{version}-%{release} Requires: %{name}-tree-player%{?_isa} = %{version}-%{release} Requires: hicolor-icon-theme -Requires: emacs-filesystem >= %{_emacs_version} -Provides: emacs-%{name} = %{version}-%{release} -Provides: emacs-%{name}-el = %{version}-%{release} Obsoletes: emacs-%{name} < 5.34.28 Obsoletes: emacs-%{name}-el < 5.34.28 @@ -1577,6 +1584,8 @@ Requires: %{name}-multiproc%{?_isa} = %{version}-%{release} Requires: %{name}-net%{?_isa} = %{version}-%{release} Requires: %{name}-tree%{?_isa} = %{version}-%{release} Requires: %{name}-tree-player%{?_isa} = %{version}-%{release} +# Library split (tmva-utils from tmva) +Obsoletes: %{name}-tmva < 6.28.08 %description tmva The Toolkit for Multivariate Analysis (TMVA) provides a @@ -1598,6 +1607,19 @@ evaluation). In addition all these methods can be tested in parallel, and hence their performance on a particular data set may easily be compared. +%if %{dataframe} +%package tmva-utils +Summary: Toolkit for multivariate data analysis (dataframe utilities) +License: BSD-3-Clause +Requires: %{name}-core%{?_isa} = %{version}-%{release} +Requires: %{name}-io%{?_isa} = %{version}-%{release} +# Library split (tmva-utils from tmva) +Obsoletes: %{name}-tmva < 6.28.08 + +%description tmva-utils +TMVA utilities using dataframe. +%endif + %package tmva-python Summary: Toolkit for multivariate data analysis (Python) License: BSD-3-Clause @@ -1757,7 +1779,7 @@ written in python. Summary: Static files for the Jupyter ROOT Notebook BuildArch: noarch Requires: %{name}-core = %{version}-%{release} -Requires: js-jsroot >= 6 +Requires: js-jsroot >= 7 %if %{?fedora}%{!?fedora:0} # jupyter-notebook not available in RHEL/EPEL # some functionality missing @@ -1994,6 +2016,10 @@ This package contains extra tools for RooFit projects. %patch -P 10 -p1 %patch -P 11 -p1 %patch -P 12 -p1 +%patch -P 13 -p1 +%patch -P 14 -p1 +%patch -P 15 -p1 +%patch -P 16 -p1 # Remove bundled sources in order to be sure they are not used # * afterimage @@ -2068,7 +2094,6 @@ LDFLAGS="-Wl,--as-needed %{?__global_ldflags}" -DCMAKE_INSTALL_PYTHONDIR:PATH=%{python3_sitearch} \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_datadir}/%{name} \ -DCMAKE_INSTALL_DOCDIR:PATH=%{_pkgdocdir} \ - -DCMAKE_INSTALL_ELISPDIR:PATH=%{_emacs_sitelispdir}/%{name} \ -Dgnuinstall:BOOL=ON \ -Dbuiltin_afterimage:BOOL=OFF \ -Dbuiltin_cfitsio:BOOL=OFF \ @@ -2229,10 +2254,6 @@ LDFLAGS="-Wl,--as-needed %{?__global_ldflags}" # Let rpm redo the python byte compilation find %{buildroot}%{python3_sitearch} -depth -type d -name __pycache__ -exec rm -r {} ';' -# Do emacs byte compilation -emacs -batch -no-site-file -f batch-byte-compile \ - %{buildroot}%{_emacs_sitelispdir}/%{name}/*.el - # Install desktop entry and icon mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps @@ -2590,16 +2611,6 @@ tutorial-dataframe-df026_AsNumpyArrays-py|\ tutorial-roofit-rf409_NumPyPandasToRooFit-py" %endif -%if %{?fedora}%{!?fedora:0} == 37 || %{?fedora}%{!?fedora:0} == 38 -%ifarch %{ix86} -# - pyunittests-pyroot-roofit-roodataset-numpy -# Failures with Fedora 37/38 i686 (after numpy 1.24 update) -# https://github.com/root-project/root/issues/12162 -excluded="${excluded}|\ -pyunittests-pyroot-roofit-roodataset-numpy" -%endif -%endif - %ifarch %{power64} # PPC64LE specific failures # - test-stresshistofit-interpreted @@ -2893,6 +2904,9 @@ fi %ldconfig_scriptlets sql-sqlite %ldconfig_scriptlets sql-pgsql %ldconfig_scriptlets tmva +%if %{dataframe} +%ldconfig_scriptlets tmva-utils +%endif %ldconfig_scriptlets tmva-python %ldconfig_scriptlets tmva-r %ldconfig_scriptlets tmva-sofie @@ -2952,9 +2966,6 @@ fi %{_datadir}/icons/hicolor/48x48/apps/root.png %{_datadir}/icons/hicolor/48x48/mimetypes/application-x-root.png %{_datadir}/mime/packages/root.xml -%dir %{_emacs_sitelispdir}/%{name} -%{_emacs_sitelispdir}/%{name}/*.elc -%{_emacs_sitelispdir}/%{name}/*.el %files icons %{_datadir}/%{name}/icons @@ -2997,6 +3008,8 @@ fi %{_mandir}/man1/system.rootdaemonrc.1* %dir %{_datadir}/%{name}/cmake %{_datadir}/%{name}/cmake/*.cmake +%dir %{_datadir}/%{name}/cmake/modules +%{_datadir}/%{name}/cmake/modules/*.cmake %dir %{_datadir}/%{name}/macros %{_datadir}/%{name}/macros/Dialogs.C %dir %{_datadir}/%{name}/plugins @@ -3572,6 +3585,34 @@ fi %dir %{_includedir}/%{name}/TMVA/DNN/Architectures/Cpu %dir %{_includedir}/%{name}/TMVA/DNN/Architectures/Reference %license tmva/doc/LICENSE +%exclude %{_includedir}/%{name}/TMVA/RBDT.hxx +%exclude %{_includedir}/%{name}/TMVA/RInferenceUtils.hxx +%exclude %{_includedir}/%{name}/TMVA/RReader.hxx +%exclude %{_includedir}/%{name}/TMVA/RSofieReader.hxx +%exclude %{_includedir}/%{name}/TMVA/RStandardScaler.hxx +%exclude %{_includedir}/%{name}/TMVA/RTensorUtils.hxx +%exclude %{_includedir}/%{name}/TMVA/TreeInference/BranchlessTree.hxx +%exclude %{_includedir}/%{name}/TMVA/TreeInference/Forest.hxx +%exclude %{_includedir}/%{name}/TMVA/TreeInference/Objectives.hxx +%exclude %{_includedir}/%{name}/TMVA/TreeInference/PythonHelpers.hxx + +%if %{dataframe} +%files tmva-utils +%{_libdir}/%{name}/libTMVAUtils.* +%{_libdir}/%{name}/libTMVAUtils_rdict.pcm +%dir %{_includedir}/%{name}/TMVA +%dir %{_includedir}/%{name}/TMVA/TreeInference +%{_includedir}/%{name}/TMVA/RBDT.hxx +%{_includedir}/%{name}/TMVA/RInferenceUtils.hxx +%{_includedir}/%{name}/TMVA/RReader.hxx +%{_includedir}/%{name}/TMVA/RSofieReader.hxx +%{_includedir}/%{name}/TMVA/RStandardScaler.hxx +%{_includedir}/%{name}/TMVA/RTensorUtils.hxx +%{_includedir}/%{name}/TMVA/TreeInference/BranchlessTree.hxx +%{_includedir}/%{name}/TMVA/TreeInference/Forest.hxx +%{_includedir}/%{name}/TMVA/TreeInference/Objectives.hxx +%{_includedir}/%{name}/TMVA/TreeInference/PythonHelpers.hxx +%endif %files tmva-python -f includelist-tmva-pymva %{_libdir}/%{name}/libPyMVA.* @@ -3738,6 +3779,11 @@ fi %endif %changelog +* Sat Oct 14 2023 Mattias Ellert - 6.28.08-1 +- Update to 6.28.08 +- New subpackage root-tmva-utils (split off from root-tmva) +- Port to pcre2 + * Tue Sep 05 2023 Mattias Ellert - 6.28.06-1 - Update to 6.28.06 - Drop patches root-testRooAbsL-test-compares-two-doubles-and-fails.patch and diff --git a/sources b/sources index e30a52f..abdf4dd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (root-6.28.06.tar.xz) = 1a7252950517b480e036cf6e12d7eb675068e1d23df1f91822494d5f0ca769545a40a37b3478cc3cf3517a20e2b48a46a7b8ff2cd4601a7c23574de989195901 +SHA512 (root-6.28.08.tar.xz) = 868d770a05372677da84e4456023c1b2b575ff1eac8b6b841ed45dd1e0fd0c6c7aede533271b986404f2a55c91ea196ac2d8c81b3b4d1edfae159c0b665c415e SHA512 (root-testfiles.tar.xz) = 945aef1a0cf5af672d4ab84b0ac00b76118e93008ff72447658ee82d9e955a1540af3ff7126e701418872f1d91b92ee96d4985840a519036c42732023a13f00f