From 987e3360f96b5cfff0c5fcb91190b414f9c49161 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 10:09:52 +0200 Subject: [PATCH 01/14] [core] rename libRint.so to libROOTRint.so --- .../ROOT/_jupyroot/helpers/cppcompleter.py | 4 ++-- cmake/modules/RootBuildOptions.cmake | 1 + cmake/modules/RootConfiguration.cmake | 2 +- cmake/scripts/ROOTConfig.cmake.in | 2 +- config/root-config.in | 8 ++++---- core/README | 2 +- core/rint/CMakeLists.txt | 18 +++++++++++++++++- core/rint/test/CMakeLists.txt | 4 ++-- main/CMakeLists.txt | 16 ++++++++-------- math/genetic/test/CMakeLists.txt | 2 +- math/mathcore/test/CMakeLists.txt | 2 +- math/mathmore/test/CMakeLists.txt | 2 +- math/minuit2/test/CMakeLists.txt | 2 +- math/smatrix/test/CMakeLists.txt | 2 +- roottest/CMakeLists.txt | 6 +++--- roottest/root/rint/CMakeLists.txt | 2 +- 16 files changed, 46 insertions(+), 29 deletions(-) diff --git a/bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/cppcompleter.py b/bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/cppcompleter.py index bc311f630f634..27fbe9295b373 100644 --- a/bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/cppcompleter.py +++ b/bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/cppcompleter.py @@ -109,10 +109,10 @@ def activate(self): self.active = True if self.firstActivation: if platform.system() == "Windows": - dlOpenRint = 'gInterpreter->LoadFile("libRint.dll");' + dlOpenRint = 'gInterpreter->LoadFile("libROOTRint.dll");' else: utils.declareCppCode('#include "dlfcn.h"') - dlOpenRint = 'dlopen("libRint.so",RTLD_NOW);' + dlOpenRint = 'dlopen("libROOTRint.so",RTLD_NOW);' utils.processCppCode(dlOpenRint) utils.declareCppCode(_TTabComHookCode) self.hook = ROOT._TTabComHook diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 3107e1850f363..437ca2adc6baf 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -163,6 +163,7 @@ ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames for shared librar ROOT_BUILD_OPTION(spectrum ON "Enable support for TSpectrum") ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") ROOT_BUILD_OPTION(ssl ON "Enable support for SSL encryption via OpenSSL") +ROOT_BUILD_OPTION(symlink_libs ON "Build backward compatibility symlinks for historical libnames (Core.so instead of libCore.so).") ROOT_BUILD_OPTION(test_distrdf_dask OFF "Enable distributed RDataFrame tests that use dask") ROOT_BUILD_OPTION(test_distrdf_pyspark OFF "Enable distributed RDataFrame tests that use pyspark") ROOT_BUILD_OPTION(testsupport OFF "Build the ROOT::TestSupport library required to use all features of ROOT_ADD_GTEST and similar macros (requires gtest at build time)") diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index dd73530daa6fd..a69d24d9d82a0 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -721,7 +721,7 @@ else() ${CMAKE_BINARY_DIR}/ginclude/compiledata.h "${CMAKE_CXX_COMPILER}" "${CMAKE_CXX_FLAGS_RELEASE}" "${CMAKE_CXX_FLAGS_DEBUG}" "${CMAKE_CXX_ACLIC_FLAGS}" "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_LINKER_FLAGS}" "so" - "${libdir}" "-lCore" "-lRint" "" "" "${ROOT_ARCHITECTURE}" "${ROOTBUILD}" + "${libdir}" "-lCore" "-lROOTRint" "" "" "${ROOT_ARCHITECTURE}" "${ROOTBUILD}" "${local_ROOT_COMPILEDATA_IGNORE_BUILD_NODE_CHANGES}") endif() diff --git a/cmake/scripts/ROOTConfig.cmake.in b/cmake/scripts/ROOTConfig.cmake.in index 4ae2c2d371afa..39fc0ad0cc3d8 100644 --- a/cmake/scripts/ROOTConfig.cmake.in +++ b/cmake/scripts/ROOTConfig.cmake.in @@ -139,7 +139,7 @@ if(MSVC) set(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll") endif() -foreach(_cpt Core Imt RIO Net Hist Graf Graf3d Gpad ROOTDataFrame Tree TreePlayer Rint Postscript Matrix Physics MathCore Thread MultiProc ROOTVecOps ${ROOT_FIND_COMPONENTS}) +foreach(_cpt Core Imt RIO Net Hist Graf Graf3d Gpad ROOTDataFrame Tree TreePlayer ROOT::Rint Postscript Matrix Physics MathCore Thread MultiProc ROOTVecOps ${ROOT_FIND_COMPONENTS}) find_library(ROOT_${_cpt}_LIBRARY ${_cpt} HINTS ${ROOT_LIBRARY_DIR}) if(ROOT_${_cpt}_LIBRARY) mark_as_advanced(ROOT_${_cpt}_LIBRARY) diff --git a/config/root-config.in b/config/root-config.in index 55a80b22e8f70..5128c5a633087 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -71,7 +71,7 @@ newlib="-lNew" rootglibs="-lGui" rootevelibs="-lEve -lEG -lGeom -lGed -lRGL" rootlibs="-lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer\ - -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lROOTNTuple -lROOTNTupleUtil" + -lROOTRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lROOTNTuple -lROOTNTupleUtil" # MultiProc is not supported on Windows if test "$platform" != "win32"; then @@ -96,7 +96,7 @@ if test "$platform" = "win32"; then -include:_G__cpp_setupG__Tree \ -include:_G__cpp_setupG__TreePlayer \ -include:_G__cpp_setupG__Thread \ - -include:_G__cpp_setupG__Rint \ + -include:_G__cpp_setupG__Rint \ -include:_G__cpp_setupG__PostScript \ -include:_G__cpp_setupG__Matrix \ -include:_G__cpp_setupG__Physics" @@ -116,7 +116,7 @@ elif test "$platform" = "aix5"; then -Wl,-u,.G__cpp_setupG__Tree \ -Wl,-u,.G__cpp_setupG__TreePlayer \ -Wl,-u,.G__cpp_setupG__Thread \ - -Wl,-u,.G__cpp_setupG__Rint \ + -Wl,-u,.G__cpp_setupG__Rint \ -Wl,-u,.G__cpp_setupG__PostScript \ -Wl,-u,.G__cpp_setupG__Matrix \ -Wl,-u,.G__cpp_setupG__Physics" @@ -136,7 +136,7 @@ else -Wl,-u,_G__cpp_setupG__Tree \ -Wl,-u,_G__cpp_setupG__TreePlayer \ -Wl,-u,_G__cpp_setupG__Thread \ - -Wl,-u,_G__cpp_setupG__Rint \ + -Wl,-u,_G__cpp_setupG__Rint \ -Wl,-u,_G__cpp_setupG__PostScript \ -Wl,-u,_G__cpp_setupG__Matrix \ -Wl,-u,_G__cpp_setupG__Physics" diff --git a/core/README b/core/README index 93e56e5df1e3f..a9cb1bf985f65 100644 --- a/core/README +++ b/core/README @@ -44,7 +44,7 @@ libThread depends on libCore and contains: libNew depends on libCore and contains: - newdelete -libRint depends on libCore and contains: +libROOTRint depends on libCore and contains: - rint libMultiProc depends on explicitly on libCore, libNet, libTreePlayer and diff --git a/core/rint/CMakeLists.txt b/core/rint/CMakeLists.txt index 80e9aea0e0fe6..f9099b0152279 100644 --- a/core/rint/CMakeLists.txt +++ b/core/rint/CMakeLists.txt @@ -21,7 +21,23 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Rint DEPENDENCIES Core ) - target_include_directories(Core PRIVATE inc) ROOT_ADD_TEST_SUBDIRECTORY(test) + +set_target_properties(Rint PROPERTIES + OUTPUT_NAME "ROOTRint" + EXPORT_NAME "Rint" +) +if (symlink_libs) + install(CODE " + set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + set(NEW_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}ROOTRint\${CMAKE_SHARED_LIBRARY_SUFFIX}\") + set(OLD_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}Rint\${CMAKE_SHARED_LIBRARY_SUFFIX}\") + message(STATUS \"Creating symlink: \${OLD_NAME} -> \${NEW_NAME}\") + execute_process( + COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} + WORKING_DIRECTORY \${LIB_DIR} + ) + ") +endif() diff --git a/core/rint/test/CMakeLists.txt b/core/rint/test/CMakeLists.txt index 4518dae395996..9257f212957ba 100644 --- a/core/rint/test/CMakeLists.txt +++ b/core/rint/test/CMakeLists.txt @@ -4,6 +4,6 @@ # For the licensing terms see $ROOTSYS/LICENSE. # For the list of contributors see $ROOTSYS/README/CREDITS. -ROOT_ADD_GTEST(TTabComTests TTabComTests.cxx LIBRARIES Rint) -ROOT_ADD_GTEST(TRintTests TRintTests.cxx LIBRARIES Rint) +ROOT_ADD_GTEST(TTabComTests TTabComTests.cxx LIBRARIES ROOT::Rint) +ROOT_ADD_GTEST(TRintTests TRintTests.cxx LIBRARIES ROOT::Rint) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 8df316efca455..4213b2d886bc5 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -10,13 +10,13 @@ ############################################################################ if(NOT WIN32) - ROOT_EXECUTABLE(rootn.exe rmain.cxx LIBRARIES New Core MathCore Rint CMAKENOEXPORT) + ROOT_EXECUTABLE(rootn.exe rmain.cxx LIBRARIES New Core MathCore ROOT::Rint CMAKENOEXPORT) if(CMAKE_SYSTEM_NAME STREQUAL Linux) SET_TARGET_PROPERTIES(rootn.exe PROPERTIES LINK_FLAGS "-Wl,--no-as-needed") endif() ROOT_EXECUTABLE(roots.exe roots.cxx LIBRARIES Core MathCore CMAKENOEXPORT) endif() -ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint) +ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core ROOT::Rint) if(MSVC) set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch \ /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index \ @@ -111,7 +111,7 @@ set_source_files_properties(src/rootcling.cxx PROPERTIES set(rootcling_exe_names rootcling genreflex rootcint) foreach(exe_name IN LISTS rootcling_exe_names) - ROOT_EXECUTABLE(${exe_name} src/rootcling.cxx LIBRARIES RIO Cling Core Rint) + ROOT_EXECUTABLE(${exe_name} src/rootcling.cxx LIBRARIES RIO Cling Core ROOT::Rint) # rootcling includes the ROOT complex header which would build the complex # dictionary with modules. To make sure that rootcling_stage1 builds this @@ -134,19 +134,19 @@ add_dependencies(genreflex rootcling) add_dependencies(rootcint rootcint) if (TARGET Gui) - ROOT_EXECUTABLE(rootbrowse src/rootbrowse.cxx LIBRARIES RIO Core Rint Gui) + ROOT_EXECUTABLE(rootbrowse src/rootbrowse.cxx LIBRARIES RIO Core ROOT::Rint Gui) target_include_directories(rootbrowse PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) endif() -ROOT_EXECUTABLE(rootcp src/rootcp.cxx LIBRARIES RIO Tree Core Rint) +ROOT_EXECUTABLE(rootcp src/rootcp.cxx LIBRARIES RIO Tree Core ROOT::Rint) target_include_directories(rootcp PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootls src/rootls.cxx LIBRARIES RIO Tree Core Rint ROOTNTuple) +ROOT_EXECUTABLE(rootls src/rootls.cxx LIBRARIES RIO Tree Core ROOT::Rint ROOTNTuple) target_include_directories(rootls PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootmkdir src/rootmkdir.cxx LIBRARIES RIO Core Rint) +ROOT_EXECUTABLE(rootmkdir src/rootmkdir.cxx LIBRARIES RIO Core ROOT::Rint) target_include_directories(rootmkdir PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootrm src/rootrm.cxx LIBRARIES RIO Core Rint) +ROOT_EXECUTABLE(rootrm src/rootrm.cxx LIBRARIES RIO Core ROOT::Rint) target_include_directories(rootrm PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) diff --git a/math/genetic/test/CMakeLists.txt b/math/genetic/test/CMakeLists.txt index d37d6b05cf3ba..a0b62ceac8e02 100644 --- a/math/genetic/test/CMakeLists.txt +++ b/math/genetic/test/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT DEFINED ROOT_SOURCE_DIR) endif() set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree - Rint Postscript Matrix Physics MathCore Thread Genetic) + ROOT::Rint Postscript Matrix Physics MathCore Thread Genetic) set(TestGeneticSource testGAMinimizer.cxx diff --git a/math/mathcore/test/CMakeLists.txt b/math/mathcore/test/CMakeLists.txt index 71b71907c94eb..0f2cda5f95f84 100644 --- a/math/mathcore/test/CMakeLists.txt +++ b/math/mathcore/test/CMakeLists.txt @@ -7,7 +7,7 @@ project(mathcore-tests) set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree Minuit2 - Rint Postscript Matrix Physics MathCore Thread) + ROOT::Rint Postscript Matrix Physics MathCore Thread) set(TestSource testMathRandom.cxx diff --git a/math/mathmore/test/CMakeLists.txt b/math/mathmore/test/CMakeLists.txt index 5360074515ab5..fec0ebbb07a9c 100644 --- a/math/mathmore/test/CMakeLists.txt +++ b/math/mathmore/test/CMakeLists.txt @@ -7,7 +7,7 @@ project(mathmore-tests) set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree - Rint Postscript Matrix Physics Thread MathCore MathMore) + ROOT::Rint Postscript Matrix Physics Thread MathCore MathMore) set(TestMathMoreSource testChebyshev.cxx diff --git a/math/minuit2/test/CMakeLists.txt b/math/minuit2/test/CMakeLists.txt index ee808ee4bb5d7..2c162880eb724 100644 --- a/math/minuit2/test/CMakeLists.txt +++ b/math/minuit2/test/CMakeLists.txt @@ -64,7 +64,7 @@ endforeach() #for the global tests using ROOT libs (Minuit2 should be taken via the PluginManager) set(RootLibraries Core RIO Net Hist Graf Graf3d Gpad Tree - Rint Postscript Matrix Physics MathCore Thread) + ROOT::Rint Postscript Matrix Physics MathCore Thread) foreach(file ${TestSource}) get_filename_component(testname ${file} NAME_WE) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index f681ba9dd7f9d..af2ef47d732c0 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -8,7 +8,7 @@ project(smatrix-tests) -set(Libraries Core RIO Tree Rint Matrix MathCore Hist Graf Gpad) +set(Libraries Core RIO Tree ROOT::Rint Matrix MathCore Hist Graf Gpad) set(TestSource testSMatrix.cxx diff --git a/roottest/CMakeLists.txt b/roottest/CMakeLists.txt index 3134f42508411..4da255e4e2ff1 100644 --- a/roottest/CMakeLists.txt +++ b/roottest/CMakeLists.txt @@ -53,9 +53,9 @@ if(MSVC) cmake_path(CONVERT "${ROOT_INCLUDE_DIRS}" TO_CMAKE_PATH_LIST ROOT_INCLUDE_DIRS) cmake_path(CONVERT "${ROOT_LIBRARY_DIR}" TO_CMAKE_PATH_LIST ROOT_LIBRARY_DIR) if(CMAKE_GENERATOR MATCHES Ninja) - set(ROOT_LIBRARIES Core RIO Net Hist Gpad Graf Tree Rint Matrix MathCore) + set(ROOT_LIBRARIES Core RIO Net Hist Gpad Graf Tree ROOT::Rint Matrix MathCore) else() - set(ROOT_LIBRARIES libCore libRIO libNet libHist libGpad libGraf libTree libRint libMatrix libMathCore) + set(ROOT_LIBRARIES libCore libRIO libNet libHist libGpad libGraf libTree libROOTRint libMatrix libMathCore) endif() else() # We can not use CMAKE_SHARED_LIBRARY_SUFFIX as on macos it uses the standard dylib rather than the .so @@ -65,7 +65,7 @@ else() # only for non-Windows platforms set(OptionalMultiProc MultiProc) - set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree Rint Matrix MathCore) + set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree ROOT::Rint Matrix MathCore) endif() set(ref_suffix ".ref") diff --git a/roottest/root/rint/CMakeLists.txt b/roottest/root/rint/CMakeLists.txt index 6d3d442dbe2ec..d7b0449805171 100644 --- a/roottest/root/rint/CMakeLists.txt +++ b/roottest/root/rint/CMakeLists.txt @@ -2,7 +2,7 @@ if (NOT MSVC) # ROOT-5843 ROOTTEST_ADD_TEST(dotLibraries COMMAND $ -b -q -e ".libraries" - PASSREGEX "libRint") + PASSREGEX "libROOTRint") ROOTTEST_ADD_TEST(TabCom COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/driveTabCom.py From 2a483bcbaa7d2416171e98541258e7573540580c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 18:23:44 +0200 Subject: [PATCH 02/14] [nfc] undo whitespace changes --- config/root-config.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/root-config.in b/config/root-config.in index 5128c5a633087..9e9c4848a7569 100755 --- a/config/root-config.in +++ b/config/root-config.in @@ -96,7 +96,7 @@ if test "$platform" = "win32"; then -include:_G__cpp_setupG__Tree \ -include:_G__cpp_setupG__TreePlayer \ -include:_G__cpp_setupG__Thread \ - -include:_G__cpp_setupG__Rint \ + -include:_G__cpp_setupG__Rint \ -include:_G__cpp_setupG__PostScript \ -include:_G__cpp_setupG__Matrix \ -include:_G__cpp_setupG__Physics" @@ -116,7 +116,7 @@ elif test "$platform" = "aix5"; then -Wl,-u,.G__cpp_setupG__Tree \ -Wl,-u,.G__cpp_setupG__TreePlayer \ -Wl,-u,.G__cpp_setupG__Thread \ - -Wl,-u,.G__cpp_setupG__Rint \ + -Wl,-u,.G__cpp_setupG__Rint \ -Wl,-u,.G__cpp_setupG__PostScript \ -Wl,-u,.G__cpp_setupG__Matrix \ -Wl,-u,.G__cpp_setupG__Physics" @@ -136,7 +136,7 @@ else -Wl,-u,_G__cpp_setupG__Tree \ -Wl,-u,_G__cpp_setupG__TreePlayer \ -Wl,-u,_G__cpp_setupG__Thread \ - -Wl,-u,_G__cpp_setupG__Rint \ + -Wl,-u,_G__cpp_setupG__Rint \ -Wl,-u,_G__cpp_setupG__PostScript \ -Wl,-u,_G__cpp_setupG__Matrix \ -Wl,-u,_G__cpp_setupG__Physics" From aca7f4a714c2712972d2ea193b4886bb88ff6191 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 18:32:38 +0200 Subject: [PATCH 03/14] [nfc] fix typo Co-authored-by: Philippe Canal --- cmake/modules/RootBuildOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 437ca2adc6baf..01c6c93416d73 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -163,7 +163,7 @@ ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames for shared librar ROOT_BUILD_OPTION(spectrum ON "Enable support for TSpectrum") ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") ROOT_BUILD_OPTION(ssl ON "Enable support for SSL encryption via OpenSSL") -ROOT_BUILD_OPTION(symlink_libs ON "Build backward compatibility symlinks for historical libnames (Core.so instead of libCore.so).") +ROOT_BUILD_OPTION(symlink_libs ON "Build backward compatibility symlinks for historical libnames (libCore.so instead of libROOTCore.so).") ROOT_BUILD_OPTION(test_distrdf_dask OFF "Enable distributed RDataFrame tests that use dask") ROOT_BUILD_OPTION(test_distrdf_pyspark OFF "Enable distributed RDataFrame tests that use pyspark") ROOT_BUILD_OPTION(testsupport OFF "Build the ROOT::TestSupport library required to use all features of ROOT_ADD_GTEST and similar macros (requires gtest at build time)") From 47a166823c0d99c316f3b770ad779cf394bb9b77 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 18:33:54 +0200 Subject: [PATCH 04/14] [nfc] do not be pedantic with target names --- cmake/scripts/ROOTConfig.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/scripts/ROOTConfig.cmake.in b/cmake/scripts/ROOTConfig.cmake.in index 39fc0ad0cc3d8..4ae2c2d371afa 100644 --- a/cmake/scripts/ROOTConfig.cmake.in +++ b/cmake/scripts/ROOTConfig.cmake.in @@ -139,7 +139,7 @@ if(MSVC) set(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll") endif() -foreach(_cpt Core Imt RIO Net Hist Graf Graf3d Gpad ROOTDataFrame Tree TreePlayer ROOT::Rint Postscript Matrix Physics MathCore Thread MultiProc ROOTVecOps ${ROOT_FIND_COMPONENTS}) +foreach(_cpt Core Imt RIO Net Hist Graf Graf3d Gpad ROOTDataFrame Tree TreePlayer Rint Postscript Matrix Physics MathCore Thread MultiProc ROOTVecOps ${ROOT_FIND_COMPONENTS}) find_library(ROOT_${_cpt}_LIBRARY ${_cpt} HINTS ${ROOT_LIBRARY_DIR}) if(ROOT_${_cpt}_LIBRARY) mark_as_advanced(ROOT_${_cpt}_LIBRARY) From 8db55d5d06e697069d154254aad7d2726ccc2c34 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 18:43:37 +0200 Subject: [PATCH 05/14] [cmake] do not be pedantic with target name as suggested by pcanal --- core/rint/test/CMakeLists.txt | 4 ++-- main/CMakeLists.txt | 16 ++++++++-------- math/genetic/test/CMakeLists.txt | 2 +- math/mathcore/test/CMakeLists.txt | 2 +- math/mathmore/test/CMakeLists.txt | 2 +- math/minuit2/test/CMakeLists.txt | 2 +- math/smatrix/test/CMakeLists.txt | 2 +- roottest/CMakeLists.txt | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/rint/test/CMakeLists.txt b/core/rint/test/CMakeLists.txt index 9257f212957ba..4518dae395996 100644 --- a/core/rint/test/CMakeLists.txt +++ b/core/rint/test/CMakeLists.txt @@ -4,6 +4,6 @@ # For the licensing terms see $ROOTSYS/LICENSE. # For the list of contributors see $ROOTSYS/README/CREDITS. -ROOT_ADD_GTEST(TTabComTests TTabComTests.cxx LIBRARIES ROOT::Rint) -ROOT_ADD_GTEST(TRintTests TRintTests.cxx LIBRARIES ROOT::Rint) +ROOT_ADD_GTEST(TTabComTests TTabComTests.cxx LIBRARIES Rint) +ROOT_ADD_GTEST(TRintTests TRintTests.cxx LIBRARIES Rint) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 4213b2d886bc5..8df316efca455 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -10,13 +10,13 @@ ############################################################################ if(NOT WIN32) - ROOT_EXECUTABLE(rootn.exe rmain.cxx LIBRARIES New Core MathCore ROOT::Rint CMAKENOEXPORT) + ROOT_EXECUTABLE(rootn.exe rmain.cxx LIBRARIES New Core MathCore Rint CMAKENOEXPORT) if(CMAKE_SYSTEM_NAME STREQUAL Linux) SET_TARGET_PROPERTIES(rootn.exe PROPERTIES LINK_FLAGS "-Wl,--no-as-needed") endif() ROOT_EXECUTABLE(roots.exe roots.cxx LIBRARIES Core MathCore CMAKENOEXPORT) endif() -ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core ROOT::Rint) +ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint) if(MSVC) set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch \ /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index \ @@ -111,7 +111,7 @@ set_source_files_properties(src/rootcling.cxx PROPERTIES set(rootcling_exe_names rootcling genreflex rootcint) foreach(exe_name IN LISTS rootcling_exe_names) - ROOT_EXECUTABLE(${exe_name} src/rootcling.cxx LIBRARIES RIO Cling Core ROOT::Rint) + ROOT_EXECUTABLE(${exe_name} src/rootcling.cxx LIBRARIES RIO Cling Core Rint) # rootcling includes the ROOT complex header which would build the complex # dictionary with modules. To make sure that rootcling_stage1 builds this @@ -134,19 +134,19 @@ add_dependencies(genreflex rootcling) add_dependencies(rootcint rootcint) if (TARGET Gui) - ROOT_EXECUTABLE(rootbrowse src/rootbrowse.cxx LIBRARIES RIO Core ROOT::Rint Gui) + ROOT_EXECUTABLE(rootbrowse src/rootbrowse.cxx LIBRARIES RIO Core Rint Gui) target_include_directories(rootbrowse PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) endif() -ROOT_EXECUTABLE(rootcp src/rootcp.cxx LIBRARIES RIO Tree Core ROOT::Rint) +ROOT_EXECUTABLE(rootcp src/rootcp.cxx LIBRARIES RIO Tree Core Rint) target_include_directories(rootcp PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootls src/rootls.cxx LIBRARIES RIO Tree Core ROOT::Rint ROOTNTuple) +ROOT_EXECUTABLE(rootls src/rootls.cxx LIBRARIES RIO Tree Core Rint ROOTNTuple) target_include_directories(rootls PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootmkdir src/rootmkdir.cxx LIBRARIES RIO Core ROOT::Rint) +ROOT_EXECUTABLE(rootmkdir src/rootmkdir.cxx LIBRARIES RIO Core Rint) target_include_directories(rootmkdir PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) -ROOT_EXECUTABLE(rootrm src/rootrm.cxx LIBRARIES RIO Core ROOT::Rint) +ROOT_EXECUTABLE(rootrm src/rootrm.cxx LIBRARIES RIO Core Rint) target_include_directories(rootrm PRIVATE ${CMAKE_SOURCE_DIR}/core/utils/inc) diff --git a/math/genetic/test/CMakeLists.txt b/math/genetic/test/CMakeLists.txt index a0b62ceac8e02..d37d6b05cf3ba 100644 --- a/math/genetic/test/CMakeLists.txt +++ b/math/genetic/test/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT DEFINED ROOT_SOURCE_DIR) endif() set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree - ROOT::Rint Postscript Matrix Physics MathCore Thread Genetic) + Rint Postscript Matrix Physics MathCore Thread Genetic) set(TestGeneticSource testGAMinimizer.cxx diff --git a/math/mathcore/test/CMakeLists.txt b/math/mathcore/test/CMakeLists.txt index 0f2cda5f95f84..71b71907c94eb 100644 --- a/math/mathcore/test/CMakeLists.txt +++ b/math/mathcore/test/CMakeLists.txt @@ -7,7 +7,7 @@ project(mathcore-tests) set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree Minuit2 - ROOT::Rint Postscript Matrix Physics MathCore Thread) + Rint Postscript Matrix Physics MathCore Thread) set(TestSource testMathRandom.cxx diff --git a/math/mathmore/test/CMakeLists.txt b/math/mathmore/test/CMakeLists.txt index fec0ebbb07a9c..5360074515ab5 100644 --- a/math/mathmore/test/CMakeLists.txt +++ b/math/mathmore/test/CMakeLists.txt @@ -7,7 +7,7 @@ project(mathmore-tests) set(Libraries Core RIO Net Hist Graf Graf3d Gpad Tree - ROOT::Rint Postscript Matrix Physics Thread MathCore MathMore) + Rint Postscript Matrix Physics Thread MathCore MathMore) set(TestMathMoreSource testChebyshev.cxx diff --git a/math/minuit2/test/CMakeLists.txt b/math/minuit2/test/CMakeLists.txt index 2c162880eb724..ee808ee4bb5d7 100644 --- a/math/minuit2/test/CMakeLists.txt +++ b/math/minuit2/test/CMakeLists.txt @@ -64,7 +64,7 @@ endforeach() #for the global tests using ROOT libs (Minuit2 should be taken via the PluginManager) set(RootLibraries Core RIO Net Hist Graf Graf3d Gpad Tree - ROOT::Rint Postscript Matrix Physics MathCore Thread) + Rint Postscript Matrix Physics MathCore Thread) foreach(file ${TestSource}) get_filename_component(testname ${file} NAME_WE) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index af2ef47d732c0..f681ba9dd7f9d 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -8,7 +8,7 @@ project(smatrix-tests) -set(Libraries Core RIO Tree ROOT::Rint Matrix MathCore Hist Graf Gpad) +set(Libraries Core RIO Tree Rint Matrix MathCore Hist Graf Gpad) set(TestSource testSMatrix.cxx diff --git a/roottest/CMakeLists.txt b/roottest/CMakeLists.txt index 4da255e4e2ff1..81c3fa04826e8 100644 --- a/roottest/CMakeLists.txt +++ b/roottest/CMakeLists.txt @@ -53,7 +53,7 @@ if(MSVC) cmake_path(CONVERT "${ROOT_INCLUDE_DIRS}" TO_CMAKE_PATH_LIST ROOT_INCLUDE_DIRS) cmake_path(CONVERT "${ROOT_LIBRARY_DIR}" TO_CMAKE_PATH_LIST ROOT_LIBRARY_DIR) if(CMAKE_GENERATOR MATCHES Ninja) - set(ROOT_LIBRARIES Core RIO Net Hist Gpad Graf Tree ROOT::Rint Matrix MathCore) + set(ROOT_LIBRARIES Core RIO Net Hist Gpad Graf Tree Rint Matrix MathCore) else() set(ROOT_LIBRARIES libCore libRIO libNet libHist libGpad libGraf libTree libROOTRint libMatrix libMathCore) endif() @@ -65,7 +65,7 @@ else() # only for non-Windows platforms set(OptionalMultiProc MultiProc) - set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree ROOT::Rint Matrix MathCore) + set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree Rint Matrix MathCore) endif() set(ref_suffix ".ref") From 26fe912eac449fbe35812cfa3619a17e6bfe3f34 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 18:57:41 +0200 Subject: [PATCH 06/14] [cmake] add generic function for setting libname and avoid duplicities --- cmake/modules/RootMacros.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index c24c3b7e9f54a..8cc9116714c9e 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -3704,3 +3704,28 @@ function (ROOT_GET_CLANG_LIBRARIES clang_libraries) endforeach(extra_lib) SET(${clang_libraries} "${found_libraries}" PARENT_SCOPE) endfunction(ROOT_GET_CLANG_LIBRARIES) + +#--------------------------------------------------------------------------------------------------- +# ROOT_SET_LIBRARY_NAME( target libname exportname ) +# +# this function is used to set the output name of a target, for example libROOTCore for the +# ROOT::Core target +#--------------------------------------------------------------------------------------------------- +function (ROOT_SET_LIBRARY_NAME target libname exportname) + set_target_properties(target PROPERTIES + OUTPUT_NAME ${libname} + EXPORT_NAME ${exportname} + ) + if (symlink_libs) + install(CODE " + set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + set(NEW_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}\${libname}\${CMAKE_SHARED_LIBRARY_SUFFIX}\") + set(OLD_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}\${exportname}\${CMAKE_SHARED_LIBRARY_SUFFIX}\") + message(STATUS \"Creating symlink: \${OLD_NAME} -> \${NEW_NAME}\") + execute_process( + COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} + WORKING_DIRECTORY \${LIB_DIR} + ) + ") + endif() +endfunction(ROOT_SET_LIBRARY_NAME) From 89243b3013407fe953916ede9155eb17a7ebb4a5 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 19:02:03 +0200 Subject: [PATCH 07/14] [cmake] use generic function for compactness when extending to other targets --- core/rint/CMakeLists.txt | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/core/rint/CMakeLists.txt b/core/rint/CMakeLists.txt index f9099b0152279..8f1fd4a735503 100644 --- a/core/rint/CMakeLists.txt +++ b/core/rint/CMakeLists.txt @@ -25,19 +25,4 @@ target_include_directories(Core PRIVATE inc) ROOT_ADD_TEST_SUBDIRECTORY(test) -set_target_properties(Rint PROPERTIES - OUTPUT_NAME "ROOTRint" - EXPORT_NAME "Rint" -) -if (symlink_libs) - install(CODE " - set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") - set(NEW_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}ROOTRint\${CMAKE_SHARED_LIBRARY_SUFFIX}\") - set(OLD_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}Rint\${CMAKE_SHARED_LIBRARY_SUFFIX}\") - message(STATUS \"Creating symlink: \${OLD_NAME} -> \${NEW_NAME}\") - execute_process( - COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} - WORKING_DIRECTORY \${LIB_DIR} - ) - ") -endif() +ROOT_SET_LIBRARY_NAME(Rint "ROOTRint" "Rint") From 8e0b2c7f0f5996b3c8fd84535eba1079e6888e37 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 16 Sep 2026 19:13:32 +0200 Subject: [PATCH 08/14] [cmake] macro fixes --- cmake/modules/RootMacros.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 8cc9116714c9e..3e5e7254d11a4 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -3706,13 +3706,18 @@ function (ROOT_GET_CLANG_LIBRARIES clang_libraries) endfunction(ROOT_GET_CLANG_LIBRARIES) #--------------------------------------------------------------------------------------------------- -# ROOT_SET_LIBRARY_NAME( target libname exportname ) +# ROOT_SET_LIBRARY_NAME( tgt libname exportname ) # # this function is used to set the output name of a target, for example libROOTCore for the -# ROOT::Core target +# ROOT::Core target. It also creates a symlink to old historical name, if symlink_libs is enabled, +# for backward compatibility +# tgt the CMake target, for example "Core" +# libname the name of the lib when written do disk (eg "ROOTCore" so that libROOTCore.so is installed) +# exportname the name of the CMake target when downstream projects find_package(ROOT) and want to +# link against it. For example "Core" so that ROOT::Core can be linked against. #--------------------------------------------------------------------------------------------------- -function (ROOT_SET_LIBRARY_NAME target libname exportname) - set_target_properties(target PROPERTIES +function (ROOT_SET_LIBRARY_NAME tgt libname exportname) + set_target_properties(${tgt} PROPERTIES OUTPUT_NAME ${libname} EXPORT_NAME ${exportname} ) From 5913205f5d2e6e0e6915bf3f0148f667fbce51c4 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 09:29:17 +0200 Subject: [PATCH 09/14] more fixes --- config/root-config.bat.in | 2 +- core/base/src/TROOT.cxx | 2 +- core/metacling/src/TCling.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/root-config.bat.in b/config/root-config.bat.in index 94ec19363690c..a5cde64035405 100644 --- a/config/root-config.bat.in +++ b/config/root-config.bat.in @@ -59,7 +59,7 @@ set cxxflags=!cxxflags:-FIsehmap.h=-FI"sehmap.h"! set rootglibs=libGui.lib set rootevelibs=libEve.lib libEG.lib libGeom.lib libGed.lib libRGL.lib -set rootlibs=libCore.lib libImt.lib libRIO.lib libNet.lib libHist.lib libGraf.lib libGraf3d.lib libGpad.lib libROOTVecOps.lib libTree.lib libTreePlayer.lib libRint.lib libPostscript.lib libMatrix.lib libPhysics.lib libMathCore.lib libThread.lib +set rootlibs=libCore.lib libImt.lib libRIO.lib libNet.lib libHist.lib libGraf.lib libGraf3d.lib libGpad.lib libROOTVecOps.lib libTree.lib libTreePlayer.lib libROOTRint.lib libPostscript.lib libMatrix.lib libPhysics.lib libMathCore.lib libThread.lib set out= set err=0 diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index 4603c0bf6979e..552980a0c6323 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -394,7 +394,7 @@ namespace Internal { // // The order of loading for is: // libCore.so - // libRint.so + // libROOTRint.so // ... anything other library hard linked to the executable ... // ... for example libEvent // libCling.so diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index 022cc1ddba473..a28ca58c6658f 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -2005,7 +2005,7 @@ bool TCling::RegisterPrebuiltModulePath(const std::string &FullPath, //////////////////////////////////////////////////////////////////////////////// /// List of dicts that have the PCM information already in the PCH. static const std::unordered_set gIgnoredPCMNames = {"libCore", - "libRint", + "libROOTRint", "libThread", "libRIO", "libImt", From 7531d2db4548a07ff8e20e4e9cacd1245b74f4cd Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 10:16:01 +0200 Subject: [PATCH 10/14] integrate symlink as arg of ROOT_STANDARD_LIBRARY main macro --- cmake/modules/RootBuildOptions.cmake | 2 +- cmake/modules/RootMacros.cmake | 47 +++++++++++++++++----------- core/rint/CMakeLists.txt | 6 ++-- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 01c6c93416d73..ad39de05b55f5 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -163,7 +163,7 @@ ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames for shared librar ROOT_BUILD_OPTION(spectrum ON "Enable support for TSpectrum") ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") ROOT_BUILD_OPTION(ssl ON "Enable support for SSL encryption via OpenSSL") -ROOT_BUILD_OPTION(symlink_libs ON "Build backward compatibility symlinks for historical libnames (libCore.so instead of libROOTCore.so).") +ROOT_BUILD_OPTION(symlink_libs ON "Build backward compatibility symlinks for historical libnames (eg. point libCore.so to libROOTCore.so).") ROOT_BUILD_OPTION(test_distrdf_dask OFF "Enable distributed RDataFrame tests that use dask") ROOT_BUILD_OPTION(test_distrdf_pyspark OFF "Enable distributed RDataFrame tests that use pyspark") ROOT_BUILD_OPTION(testsupport OFF "Build the ROOT::TestSupport library required to use all features of ROOT_ADD_GTEST and similar macros (requires gtest at build time)") diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 3e5e7254d11a4..7b456d78c8bc7 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -1339,7 +1339,7 @@ macro(ROOT_CREATE_HEADER_COPY_TARGETS) endmacro() #--------------------------------------------------------------------------------------------------- -#---ROOT_STANDARD_LIBRARY_PACKAGE(libname +#---ROOT_STANDARD_LIBRARY_PACKAGE(libname : the name of the CMake target. If OUTPUT_NAME not specified, will be also name on disk eg lib${libname}.so. # [NO_INSTALL_HEADERS] : don't install headers for this package # [NO_GLOB_HEADERS] : don't glob for headers, only install listed ones # [STAGE1] : use rootcling_stage1 for generating @@ -1351,6 +1351,9 @@ endmacro() # [OBJECT_LIBRARY] : use ROOT_OBJECT_LIBRARY to generate object files # and then use those for linking. # LIBRARIES lib1 lib2 : private arguments for target_link_library() +# OUTPUT_NAME outname : if specified, outname is the name of the lib when written do disk (eg "ROOTCore" so that libROOTCore.so is installed). If not set, libname will be used. +# EXPORT_NAME exportname : if specified, exportname is the name of the CMake target when downstream projects find_package(ROOT) and want to +# link against it. For example "Core" so that ROOT::Core can be linked against. If not set, libname will be used. # DEPENDENCIES lib1 lib2 : PUBLIC arguments for target_link_library() such as Core, MathCore # BUILTINS builtin1 builtin2 : builtins like xxhash # LINKDEF LinkDef.h : linkdef file, default value is "LinkDef.h" @@ -1361,7 +1364,7 @@ endmacro() #--------------------------------------------------------------------------------------------------- function(ROOT_STANDARD_LIBRARY_PACKAGE libname) set(options NO_INSTALL_HEADERS NO_GLOB_HEADERS STAGE1 NO_HEADERS NO_SOURCES OBJECT_LIBRARY NO_CXXMODULE) - set(oneValueArgs LINKDEF) + set(oneValueArgs LINKDEF OUTPUT_NAME EXPORT_NAME) set(multiValueArgs DEPENDENCIES HEADERS NODEPHEADERS SOURCES BUILTINS LIBRARIES DICTIONARY_OPTIONS INSTALL_OPTIONS) CMAKE_PARSE_ARGUMENTS(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -1472,6 +1475,16 @@ function(ROOT_STANDARD_LIBRARY_PACKAGE libname) ROOT_INSTALL_HEADERS(${ARG_INSTALL_OPTIONS}) endif() endif() + + if (ARG_OUTPUT_NAME) + set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${ARG_OUTPUT_NAME}) + if (NOT ARG_OUTPUT_NAME STREQUAL "${libname}") + ROOT_SYMLINK_LIBRARY_NAME(${libname} ${ARG_OUTPUT_NAME} ${libname}) # historicalname matches libname + endif() + endif() + if (ARG_EXPORT_NAME) + set_target_properties(${libname} PROPERTIES EXPORT_NAME ${ARG_EXPORT_NAME}) + endif() endfunction() #--------------------------------------------------------------------------------------------------- @@ -3706,31 +3719,27 @@ function (ROOT_GET_CLANG_LIBRARIES clang_libraries) endfunction(ROOT_GET_CLANG_LIBRARIES) #--------------------------------------------------------------------------------------------------- -# ROOT_SET_LIBRARY_NAME( tgt libname exportname ) +# ROOT_SYMLINK_LIBRARY_NAME( tgt outputname historicalname ) # -# this function is used to set the output name of a target, for example libROOTCore for the -# ROOT::Core target. It also creates a symlink to old historical name, if symlink_libs is enabled, -# for backward compatibility -# tgt the CMake target, for example "Core" -# libname the name of the lib when written do disk (eg "ROOTCore" so that libROOTCore.so is installed) -# exportname the name of the CMake target when downstream projects find_package(ROOT) and want to -# link against it. For example "Core" so that ROOT::Core can be linked against. +# This function is used when the output name of a target, for example libROOTCore for the +# ROOT::Core target does not match the CMake target name: for backward compatibility, +# it creates a symlink to old historical name, if ROOT built with -Dsymlink_libs=ON (default) +# tgt: the CMake target, for example "Core" +# outputname: the name of the lib when written do disk (eg "ROOTCore" so that libROOTCore.so is installed) +# historicalname: the output-name of the lib being written to disk in CMake target historically. +# Usually, this name was just the name of the CMake target since no separate outputname was set. #--------------------------------------------------------------------------------------------------- -function (ROOT_SET_LIBRARY_NAME tgt libname exportname) - set_target_properties(${tgt} PROPERTIES - OUTPUT_NAME ${libname} - EXPORT_NAME ${exportname} - ) +function (ROOT_SYMLINK_LIBRARY_NAME tgt outputname historicalname) if (symlink_libs) install(CODE " set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") - set(NEW_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}\${libname}\${CMAKE_SHARED_LIBRARY_SUFFIX}\") - set(OLD_NAME \"\${CMAKE_SHARED_LIBRARY_PREFIX}\${exportname}\${CMAKE_SHARED_LIBRARY_SUFFIX}\") - message(STATUS \"Creating symlink: \${OLD_NAME} -> \${NEW_NAME}\") + set(NEW_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${outputname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") + set(OLD_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${historicalname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") + message(STATUS \"Creating symlink for target ${tgt}: \${OLD_NAME} -> \${NEW_NAME}\") execute_process( COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} WORKING_DIRECTORY \${LIB_DIR} ) ") endif() -endfunction(ROOT_SET_LIBRARY_NAME) +endfunction(ROOT_SYMLINK_LIBRARY_NAME) diff --git a/core/rint/CMakeLists.txt b/core/rint/CMakeLists.txt index 8f1fd4a735503..fbf98dfb84ac1 100644 --- a/core/rint/CMakeLists.txt +++ b/core/rint/CMakeLists.txt @@ -16,6 +16,10 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Rint SOURCES src/TRint.cxx src/TTabCom.cxx + OUTPUT_NAME + ROOTRint + EXPORT_NAME + Rint DICTIONARY_OPTIONS -writeEmptyRootPCM DEPENDENCIES @@ -24,5 +28,3 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Rint target_include_directories(Core PRIVATE inc) ROOT_ADD_TEST_SUBDIRECTORY(test) - -ROOT_SET_LIBRARY_NAME(Rint "ROOTRint" "Rint") From 30805f3b9d341c969f5bf67fd282eae40f4919d1 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 11:00:01 +0200 Subject: [PATCH 11/14] mv before dictgen --- cmake/modules/RootMacros.cmake | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 7b456d78c8bc7..aa60031246128 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -1448,6 +1448,18 @@ function(ROOT_STANDARD_LIBRARY_PACKAGE libname) "dictionary will be empty. Consider using ROOT_LINKER_LIBRARY instead.") endif() + + if (ARG_OUTPUT_NAME) + # this must go before ROOT_GENERATE_DICTIONARY since that function depends on OUTPUT_NAME target property + set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${ARG_OUTPUT_NAME}) + if (NOT ARG_OUTPUT_NAME STREQUAL "${libname}") + ROOT_SYMLINK_LIBRARY_NAME(${libname} ${ARG_OUTPUT_NAME} ${libname}) # historicalname matches libname + endif() + endif() + if (ARG_EXPORT_NAME) + set_target_properties(${libname} PROPERTIES EXPORT_NAME ${ARG_EXPORT_NAME}) + endif() + ROOT_GENERATE_DICTIONARY(G__${libname} ${ARG_HEADERS} ${NO_CXXMODULE_FLAG} ${STAGE1_FLAG} @@ -1476,15 +1488,6 @@ function(ROOT_STANDARD_LIBRARY_PACKAGE libname) endif() endif() - if (ARG_OUTPUT_NAME) - set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${ARG_OUTPUT_NAME}) - if (NOT ARG_OUTPUT_NAME STREQUAL "${libname}") - ROOT_SYMLINK_LIBRARY_NAME(${libname} ${ARG_OUTPUT_NAME} ${libname}) # historicalname matches libname - endif() - endif() - if (ARG_EXPORT_NAME) - set_target_properties(${libname} PROPERTIES EXPORT_NAME ${ARG_EXPORT_NAME}) - endif() endfunction() #--------------------------------------------------------------------------------------------------- From 4db886833101ddc9ac193455971368c42bad2d88 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 11:50:13 +0200 Subject: [PATCH 12/14] [cmake] fix dictionary outputname Otherwise, since Rint.pcm does not match ROOTRint.so, one gets: rootcling_stage1: /github/home/ROOT-CI/src/interpreter/llvm-project/clang/lib/Sema/SemaModule.cpp:778: void clang::Sema::BuildModuleInclude(clang::SourceLocation, clang::Module*): Assertion `(getLangOpts().getCompilingModule() == LangOptionsBase::CMK_ModuleInterface || ThisModule) --- cmake/modules/RootMacros.cmake | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index aa60031246128..a0f3267c4a5c6 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -628,9 +628,20 @@ function(ROOT_GENERATE_DICTIONARY dictionary) # dependency below are independent of configuration order and expand to # nothing for a dictionary-less library. set(dep_has_dict "$") - set(dependent_pcm ${libprefix}${dep}_rdict.pcm) + + # Determine the true output library name if the target defines an OUTPUT_NAME property + if(TARGET ${dep}) + get_target_property(dep_out_name ${dep} OUTPUT_NAME) + if(NOT dep_out_name) + set(dep_out_name ${dep}) + endif() + else() + set(dep_out_name ${dep}) + endif() + + set(dependent_pcm ${libprefix}${dep_out_name}_rdict.pcm) if (runtime_cxxmodules AND NOT dep IN_LIST local_no_cxxmodules) - set(dependent_pcm ${dep}.pcm) + set(dependent_pcm ${dep_out_name}.pcm) list(APPEND pcm_dependencies "$<${dep_has_dict}:$>") endif() set(newargs ${newargs} "$<${dep_has_dict}:-m>" "$<${dep_has_dict}:${dependent_pcm}>") From 75cd6d6bcb6fb20fe0e061e1b7d36c3f9f37f074 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 18:15:59 +0200 Subject: [PATCH 13/14] f --- cmake/modules/RootMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index a0f3267c4a5c6..6a14cf3f3aeff 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -580,7 +580,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) set(pcm_name ${library_output_dir}/${libprefix}${library_output_name}_${dictionary}_rdict.pcm) set(rootmap_name ${library_output_dir}/${libprefix}${library_output_name}32.rootmap) else() - set(cpp_module ${library_target_name}) + set(cpp_module ${library_output_name}) endif(ARG_MULTIDICT) if(runtime_cxxmodules) @@ -607,7 +607,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) unset(cpp_module) unset(cpp_module_file) else() - list(APPEND local_modules_idx_deps ${cpp_module}) + list(APPEND local_modules_idx_deps ${library_target_name}) set_property(GLOBAL PROPERTY modules_idx_deps_property "${local_modules_idx_deps}") endif(ARG_NO_CXXMODULE) From 9004ad0900c6cbff7fb4e092acbf63f4dc68b522 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 28 Sep 2026 18:30:01 +0200 Subject: [PATCH 14/14] backup link in build dir --- .../root-ci-config/buildconfig/alma10.txt | 1 + cmake/modules/RootMacros.cmake | 26 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10.txt b/.github/workflows/root-ci-config/buildconfig/alma10.txt index d754dc5054ca3..33571ade4c16b 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10.txt @@ -1,3 +1,4 @@ builtin_civetweb=ON builtin_vdt=ON pythia8=ON +symlink_libs=OFF diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 6a14cf3f3aeff..466c53b7651c4 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -3745,15 +3745,23 @@ endfunction(ROOT_GET_CLANG_LIBRARIES) #--------------------------------------------------------------------------------------------------- function (ROOT_SYMLINK_LIBRARY_NAME tgt outputname historicalname) if (symlink_libs) - install(CODE " - set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") - set(NEW_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${outputname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") - set(OLD_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${historicalname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") - message(STATUS \"Creating symlink for target ${tgt}: \${OLD_NAME} -> \${NEW_NAME}\") - execute_process( - COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} - WORKING_DIRECTORY \${LIB_DIR} + get_target_property(target_type ${tgt} TYPE) + if(NOT target_type STREQUAL "INTERFACE_LIBRARY") + add_custom_command(TARGET ${tgt} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink $ ${LIB_PREFIX}${historicalname}${LIB_SUFFIX} + WORKING_DIRECTORY $ + COMMENT "Creating bw-compatibility symlink for target ${tgt}: ${LIB_PREFIX}${historicalname}${LIB_SUFFIX} -> $" ) - ") + install(CODE " + set(LIB_DIR \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + set(NEW_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${outputname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") + set(OLD_NAME \"${CMAKE_SHARED_LIBRARY_PREFIX}${historicalname}${CMAKE_SHARED_LIBRARY_SUFFIX}\") + message(STATUS \"Creating symlink for target ${tgt}: \${OLD_NAME} -> \${NEW_NAME}\") + execute_process( + COMMAND \${CMAKE_COMMAND} -E create_symlink \${NEW_NAME} \${OLD_NAME} + WORKING_DIRECTORY \${LIB_DIR} + ) + ") + endif() endif() endfunction(ROOT_SYMLINK_LIBRARY_NAME)