From f5125f6ca654ca65d2e854d56e68d7cce9ccb034 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 10:47:21 +0200 Subject: [PATCH 01/21] [cmake] Do not auto force-enable or force-disable user CMake build options Messing up with the cache is dangerous, and users often complain about not having the control since the build system changes what they just passed as flag to the command line. Instead, convert these automatism into a helpful error message that the user can use as a hotfix to modify their build flags. This prevents surprises, annoying behind-the-scene changes, as well as bugs. Follows up on the phillosophy of https://github.com/root-project/root/pull/23020 Fixes https://its.cern.ch/jira/browse/ROOT-10743 --- README/ReleaseNotes/v642/index.md | 1 + cmake/modules/CheckCompiler.cmake | 2 + cmake/modules/RootBuildOptions.cmake | 2 +- cmake/modules/SearchInstalledSoftware.cmake | 332 +++++++++++++------- gui/qt6webdisplay/CMakeLists.txt | 6 - 5 files changed, 218 insertions(+), 125 deletions(-) diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index c811c5bf17381..d89b2b5c13148 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -46,6 +46,7 @@ The following people have contributed to this new version: Note that `all=ON` enables several of these options, so building with `-Dall=ON` now requires all of their dependencies to be installed, or the unwanted ones to be disabled explicitly. Build options that are enabled by default, such as `pyroot`, `opengl`, `xml`, `sqlite`, `davix`, `curl`, `tmva-cpu` or `tpython` are not affected: they are still disabled automatically when their dependencies are missing. * The option `fail-on-missing=OFF` will no longer be honored for CMake ROOT build options that have easy-to-install dependencies (e.g. via homebrew or apt-get), such as those required by options `cfitsio`, `civetweb`, `fftw3`, `imt`, `mathmore`, `nlohmann_json`, `tmva-cpu`, `unuran`, `vdt` or `xrootd`. Before, associated `builtin_option` was automatically turned ON (or the opt-in feature turned to OFF), now, user has to install system package or manually set `builtin_option` to `ON` or opt-in feature to `OFF`. +* Irrespective of the value of `fail-on-missing`, all ROOT build options that are contradictory or are missing a dependency will now raise an error rather than letting the build system to automatically turn features OFF or ON. A helpful error message will be printed stating what packages need to be installed or what build flags need to be changed. * The use of `CINT`-like implicit declarations such as `i = 0` is deprecated since [ROOT 6.32](https://root.cern/doc/v632/release-notes.html#deprecation-and-removal) and emits warnings `declaration without the 'auto' keyword is deprecated`. ROOT 6.44 will be the last release to support this syntax, after ROOT 6.44, the warning will turn into an error. Update those declarations by explicitly using the `auto` keyword: `auto i = 0`. * The legacy evaluation backend of RooFit and the related `RooFit::BatchMode()` command argument are deprecated and will be removed in ROOT 6.44. See the RooFit section below for details. * The method `RooRealVar::removeRange()` and the corresponding method in `RooErrorVar` that were deprecated in ROOT 6.40 are now removed. diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index c09183ffed443..4aacde172ab4d 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -51,6 +51,8 @@ if(fortran) endif() if(NOT CMAKE_Fortran_COMPILER) message(SEND_ERROR "No Fortran compiler found. Please make sure it's installed, or disable ROOT's Fortran features with '-Dfortran=OFF'") + list(APPEND MISSING_PACKAGES 'gfortran') + list(APPEND HOTFIX_BUILD_FLAGS '-Dfortran=OFF') endif() else() set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 0d0325ac4fc6e..5350a76bf8bba 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -158,7 +158,7 @@ ROOT_BUILD_OPTION(roofit ON "Build the advanced fitting package RooFit, and RooS ROOT_BUILD_OPTION(root7 ON "Build ROOT 7 experimental components of ROOT") ROOT_BUILD_OPTION(runtime_cxxmodules ON "Enable runtime support for C++ modules") ROOT_BUILD_OPTION(shadowpw OFF "Enable support for shadow passwords") -ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible") +ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible (OFF not supported on Windows)") ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames for shared libraries. Not recommended, as the pcm and rootmap files do not (yet) support versioning and always point to the non-versioned shared libraries.") ROOT_BUILD_OPTION(spectrum ON "Enable support for TSpectrum") ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 47da69db16896..5dc6027f8bea6 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -7,8 +7,6 @@ #---------------------------------------------------------------------------- # macro ROOT_CHECK_CONNECTION(option) # Try to download a file to check internet connection. -# If fail-on-missing=ON is set, a failed connection check will cause a fatal -# configuration error. # Input variables: # option: # A hint to the user on which option to set to avoid the part of the @@ -44,10 +42,7 @@ macro(ROOT_CHECK_CONNECTION option) set(NO_CONNECTION FALSE) else() # Error - if(fail-on-missing) - message(FATAL_ERROR "No internet connection. Please check your connection, set '-D${option}' or disable 'fail-on-missing' to automatically disable options requiring internet access. You can also bypass the connection check with -Dcheck_connection=OFF.") - endif() - message(STATUS "Checking internet connectivity - failed: will not automatically download external dependencies. You can bypass the connection check with -Dcheck_connection=OFF.") + message(WARNING "No internet connection. Please check your connection, set '-D${option}' or disable 'fail-on-missing' to automatically disable options requiring internet access. You can also bypass the connection check with -Dcheck_connection=OFF.") set(NO_CONNECTION TRUE) endif() endif() @@ -69,7 +64,12 @@ endmacro() # Building Clad requires an internet connection, if we're not side-loading the source directory if(clad AND NOT DEFINED CLAD_SOURCE_DIR) - ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("clad") + ROOT_CHECK_CONNECTION("clad") + if(NO_CONNECTION) + message(SEND_ERROR "No internet connection, check it or disable the 'clad' option") + list(APPEND MISSING_PACKAGES 'clad') + list(APPEND HOTFIX_BUILD_FLAGS '-Dclad=OFF') + endif() endif() #---Check for installed packages depending on the build options/components enabled -- @@ -273,7 +273,12 @@ if(NOT builtin_pcre) endif() if(mathmore OR (tmva-cpu AND use_gsl_cblas)) if(builtin_gsl) - ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("builtin_gsl") + ROOT_CHECK_CONNECTION("builtin_gsl") + if(NO_CONNECTION) + message(SEND_ERROR "No internet connection, check it or disable the 'builtin_gsl' option") + list(APPEND MISSING_PACKAGES 'GSL') + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_gsl=OFF') + endif() endif() message(STATUS "Looking for GSL") ROOT_FIND_REQUIRED_DEP(GSL builtin_gsl 1.10) @@ -303,6 +308,11 @@ if(NOT "${HOTFIX_BUILD_FLAGS}" STREQUAL "") message(FATAL_ERROR "${HOTFIX_BUILD_FLAGS_MESSAGE}") endif() +# Now that builtins have passed this synchronization point, let's collect in a second pass +# additional error messages that can appear when using contradictory flags +unset(MISSING_PACKAGES) +unset(HOTFIX_BUILD_FLAGS_MESSAGE) + #---On MacOSX, try to find frameworks after standard libraries or headers------------ set(CMAKE_FIND_FRAMEWORK LAST) @@ -310,6 +320,7 @@ set(CMAKE_FIND_FRAMEWORK LAST) if(NOT shared) if(WINDOWS) message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") + list(APPEND HOTFIX_BUILD_FLAGS '-Dshared=ON') else() message("Preferring static libraries.") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;${CMAKE_FIND_LIBRARY_SUFFIXES}") @@ -372,10 +383,13 @@ endif() # library is needed for builds on Apple with Cocoa graphics if(cocoa) if(APPLE) - set(x11 OFF CACHE BOOL "Disabled because cocoa requested (${x11_description})" FORCE) + if (x11) + message(SEND_ERROR "x11 (${x11_description}) and cocoa cannot be enabled simultaneously. Set -Dx11=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dx11=OFF') + endif() else() - message(STATUS "Cocoa option can only be enabled on MacOSX platform") - set(cocoa OFF CACHE BOOL "Disabled because only available on MacOSX (${cocoa_description})" FORCE) + message(SEND_ERROR "Cocoa option can only be enabled on MacOSX platform. Set -Dcocoa=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dcocoa=OFF') endif() endif() @@ -427,8 +441,8 @@ endif() #---Check for all kind of graphics includes needed by libAfterImage-------------------- if(asimage) if(NOT x11 AND NOT cocoa AND NOT WIN32) - message(STATUS "Switching off 'asimage' because neither 'x11' nor 'cocoa' are enabled") - set(asimage OFF CACHE BOOL "Disabled because neither x11 nor cocoa are enabled (${asimage_description})" FORCE) + message(SEND_ERROR "'asimage' needs either 'x11' or 'cocoa' enabled. Set -Dasimage=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dasimage=OFF') endif() endif() if(asimage) @@ -523,13 +537,12 @@ if(opengl OR cocoa) find_package(OpenGL) endif() if(NOT OPENGL_FOUND OR NOT OPENGL_GLU_FOUND) - if(fail-on-missing) - message(SEND_ERROR "OpenGL package (with GLU) not found and opengl option required") - elseif(cocoa) - message(FATAL_ERROR "OpenGL package (with GLU) not found and opengl option required for \"cocoa=ON\"") + if(cocoa AND NOT opengl) + message(SEND_ERROR "OpenGL package (with GLU) not found and opengl option required for \"cocoa=ON\". Set -Dcocoa=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dcocoa=OFF') else() - message(STATUS "OpenGL (with GLU) not found. Switching off opengl option") - set(opengl OFF CACHE BOOL "Disabled because OpenGL (with GLU) not found (${opengl_description})" FORCE) + message(SEND_ERROR "OpenGL package (with GLU) not found and opengl option required. Set -Dopengl=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dopengl=OFF') endif() endif() endif() @@ -537,8 +550,8 @@ endif() # in case when -Dall=ON -Dx11=OFF, we will just disable opengl. if(NOT WIN32 AND NOT APPLE) if(opengl AND NOT x11) - message(STATUS "OpenGL was disabled, since it is requires x11 on Linux") - set(opengl OFF CACHE BOOL "OpenGL requires x11" FORCE) + message(SEND_ERROR "OpenGL requires x11 on Linux, either disable opengl or set -Dx11=ON") + list(APPEND HOTFIX_BUILD_FLAGS '-Dx11=ON') endif() endif() # The opengl flag enables the graf3d features that depend on OpenGL, and these @@ -546,6 +559,7 @@ endif() # asimage is off. See also: https://github.com/root-project/root/issues/16250 if(opengl AND NOT asimage) message(SEND_ERROR "OpenGL features enabled with \"opengl=ON\" require \"asimage=ON\"") + list(APPEND HOTFIX_BUILD_FLAGS '-Dasimage=ON') endif() #---Check for gl2ps ------------------------------------------------------------------ @@ -563,7 +577,9 @@ if(gviz) message(STATUS "Looking for Graphviz") find_package(Graphviz) if(NOT GRAPHVIZ_FOUND) - message(SEND_ERROR "Graphviz libraries not found while -Dgviz=On.") + message(SEND_ERROR "Graphviz libraries not found while -Dgviz=ON. Install them on the system or set -Dgviz=OFF") + list(APPEND MISSING_PACKAGES 'Graphviz') + list(APPEND HOTFIX_BUILD_FLAGS '-Dgviz=OFF') endif() endif() @@ -572,12 +588,9 @@ if(xml) message(STATUS "Looking for LibXml2") find_package(LibXml2) if(NOT LIBXML2_FOUND) - if(fail-on-missing) - message(SEND_ERROR "LibXml2 libraries not while -Dxml=ON") - else() - message(STATUS "LibXml2 not found. Switching off xml option") - set(xml OFF CACHE BOOL "Disabled because LibXml2 not found (${xml_description})" FORCE) - endif() + message(SEND_ERROR "LibXml2 libraries not while -Dxml=ON. Install them on the system or set -Dxml=OFF") + list(APPEND MISSING_PACKAGES 'LibXml2') + list(APPEND HOTFIX_BUILD_FLAGS '-Dxml=OFF') endif() endif() @@ -591,7 +604,9 @@ if(fcgi) message(STATUS "Looking for FastCGI") find_package(FastCGI) if(NOT FASTCGI_FOUND) - message(SEND_ERROR "FastCGI library not found while -Dfcgi=On") + message(SEND_ERROR "FastCGI library not found while -Dfcgi=ON. Install it on the system or set -Dfcgi=OFF") + list(APPEND MISSING_PACKAGES 'FastCGI') + list(APPEND HOTFIX_BUILD_FLAGS '-Dfcgi=OFF') endif() endif() @@ -613,14 +628,16 @@ if(http AND NOT builtin_civetweb) if(COMPILE_RESULT) message(STATUS "Detected civetweb feature mask: ${CIVETWEB_FEATURES}") else() - message(FATAL_ERROR "Could not run civetweb features: ${BUILD_LOG}") + message(SEND_ERROR "Could not run civetweb features: ${BUILD_LOG}. Try fixing the install or use builtin_civetweb=ON or switch `-Dhttp=OFF`") + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') endif() math(EXPR CIVETWEB_HAS_WEBSOCKET "(${CIVETWEB_FEATURES} >> 4) & 0x1") math(EXPR CIVETWEB_HAS_ZLIB "(${CIVETWEB_FEATURES} >> 9) & 0x1") math(EXPR CIVETWEB_HAS_X_DOM_SOCKET "(${CIVETWEB_FEATURES} >> 11) & 0x1") message(STATUS "civetweb websocket ; zlib ; xdomsocket support: ${CIVETWEB_HAS_WEBSOCKET} ; ${CIVETWEB_HAS_ZLIB} ; ${CIVETWEB_HAS_X_DOM_SOCKET}") else() - message(FATAL_ERROR "Could not check for civetweb features: ${CIVETWEB_FEATURE_API_LOG}") + message(SEND_ERROR "Could not check for civetweb features: ${CIVETWEB_FEATURE_API_LOG}. Try fixing the install or use builtin_civetweb=ON") + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') endif() if(NOT "${CIVETWEB_HAS_WEBSOCKET}" STREQUAL "1" OR NOT "${CIVETWEB_HAS_ZLIB}" STREQUAL "1" OR NOT "${CIVETWEB_HAS_X_DOM_SOCKET}" STREQUAL "1") @@ -630,6 +647,7 @@ if(http AND NOT builtin_civetweb) unset(${var} CACHE) endforeach() message(SEND_ERROR "System-wide civetweb found but does not include websocket or zlib or xdomsocket components (-DCIVETWEB_ENABLE_WEBSOCKETS=ON -DCIVETWEB_ENABLE_ZLIB=ON -DCIVETWEB_ENABLE_X_DOM_SOCKET=ON). Set `-Dbuiltin_civetweb=ON` as workaround or switch `-Dhttp=OFF`.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') endif() endif() endif() @@ -642,12 +660,9 @@ if(sqlite) message(STATUS "Looking for SQLite") find_package(Sqlite) if(NOT SQLITE_FOUND) - if(fail-on-missing) - message(SEND_ERROR "SQLite libraries not found while -Dsqlite=ON") - else() - message(STATUS "SQLite not found. Switching off sqlite option") - set(sqlite OFF CACHE BOOL "Disabled because SQLite not found (${sqlite_description})" FORCE) - endif() + message(SEND_ERROR "SQLite libraries not found while -Dsqlite=ON. Install them on the system or set -Dsqlite=OFF") + list(APPEND MISSING_PACKAGES 'SQLite') + list(APPEND HOTFIX_BUILD_FLAGS '-Dsqlite=OFF') endif() endif() @@ -656,29 +671,45 @@ if(pythia8) message(STATUS "Looking for Pythia8") find_package(Pythia8) if(NOT PYTHIA8_FOUND) - message(SEND_ERROR "Pythia8 libraries not found while -Dpythia8=ON") + message(SEND_ERROR "Pythia8 libraries not found while -Dpythia8=ON. Install them on the system or set -Dpythia8=OFF") + list(APPEND MISSING_PACKAGES 'Pythia8') + list(APPEND HOTFIX_BUILD_FLAGS '-Dpythia8=OFF') endif() endif() #---Check for FFTW3------------------------------------------------------------------- if(builtin_fftw3) - ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("builtin_fftw3") + ROOT_CHECK_CONNECTION("builtin_fftw3") + if(NO_CONNECTION) + message(SEND_ERROR "No internet connection, check it or disable the 'builtin_fftw3' option") + list(APPEND MISSING_PACKAGES 'fftw3') + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_fftw3=OFF') + endif() endif() if(builtin_fftw3) add_subdirectory(builtins/fftw3) - set(fftw3 ON CACHE BOOL "Enabled because builtin_fftw3 requested (${fftw3_description})" FORCE) + if (NOT fftw3) + message(SEND_ERROR "builtin_fftw3=ON is incompatible with fftw3=OFF. Set -Dfftw3=ON") + list(APPEND HOTFIX_BUILD_FLAGS '-Dfftw3=ON') + endif() endif() #---Check for fitsio------------------------------------------------------------------- if(fitsio OR builtin_cfitsio) if(builtin_cfitsio) - ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("builtin_cfitsio") + ROOT_CHECK_CONNECTION("builtin_cfitsio") + if(NO_CONNECTION) + message(SEND_ERROR "No internet connection, check it or disable the 'builtin_cfitsio' option") + list(APPEND MISSING_PACKAGES 'CFITSIO') + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_cfitsio=OFF') + endif() endif() if(builtin_cfitsio) add_library(CFITSIO::CFITSIO STATIC IMPORTED GLOBAL) add_subdirectory(builtins/cfitsio) if(NOT fitsio) - set(fitsio ON CACHE BOOL "Enabled because builtin_cfitsio requested (${fitsio_description})" FORCE) + message(SEND_ERROR "builtin_cfitsio=ON is incompatible with fitsio=OFF. Set -Dfitsio=ON") + list(APPEND HOTFIX_BUILD_FLAGS '-Dfitsio=ON') endif() endif() endif() @@ -687,8 +718,8 @@ endif() if(shadowpw) if(NOT EXISTS /etc/shadow) #---TODO--The test always succeeds because the actual file is protected if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) - message(STATUS "Support Shadow password not found. Switching off shadowpw option") - set(shadowpw OFF CACHE BOOL "Disabled because /etc/shadow not found (${shadowpw_description})" FORCE) + message(SEND_ERROR "Support Shadow password not found. Switch off shadowpw option -Dshadowpw=OFF") + list(APPEND HOTFIX_BUILD_FLAGS '-Dshadowpw=OFF') endif() endif() endif() @@ -711,10 +742,14 @@ if(builtin_xrootd) ROOT_CHECK_CONNECTION("builtin_xrootd=OFF") if(NO_CONNECTION) message(SEND_ERROR "No internet connection. Please check your connection, or disable the 'builtin_xrootd'" - " option") + " option and 'xrootd' options.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=OFF -Dbuiltin_xrootd=OFF') endif() add_subdirectory(builtins/xrootd) - set(xrootd ON CACHE BOOL "Enabled because builtin_xrootd requested (${xrootd_description})" FORCE) + if (NOT xrootd) + message(SEND_ERROR "builtin_xrootd=ON is incompatible with xrootd=OFF (${xrootd_description}). Set xrootd=ON") + list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=ON') + endif() endif() # Backward compatibility for XRootD (e.g. \"/usr/local/mpich\"). Or disable option 'mpi'") + list(APPEND MISSING_PACKAGES 'MPI') + list(APPEND HOTFIX_BUILD_FLAGS '-Dmpi=OFF') endif() endif() @@ -1078,10 +1137,8 @@ if (testing OR testsupport) if (builtin_gtest) ROOT_CHECK_CONNECTION("testing=OFF") if(NO_CONNECTION) - message(STATUS "No internet connection, disabling the 'testing', 'testsupport' and 'builtin_gtest' options") - set(testing OFF CACHE BOOL "Disabled because there is no internet connection" FORCE) - set(testsupport OFF CACHE BOOL "Disabled because there is no internet connection" FORCE) - set(builtin_gtest OFF CACHE BOOL "Disabled because there is no internet connection" FORCE) + message(STATUS "No internet connection, check connection or disable the 'testing', 'testsupport' and 'builtin_gtest' options") + list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=OFF -Dtestsupport=OFF -Dbuiltin_gtest=OFF') else() add_subdirectory(builtins/gtest) endif() @@ -1092,7 +1149,9 @@ if (testing OR testsupport) # Verify that all GTest subcomponents are installed foreach(LIBNAME gtest_main gmock_main gtest gmock) if(NOT TARGET GTest::${LIBNAME} AND NOT TARGET ${LIBNAME}) - message(SEND_ERROR "Missing installation of GTest subcomponent ${LIBNAME}") + message(SEND_ERROR "Missing installation of GTest subcomponent ${LIBNAME}. Install it or disable testing and testsupport.") + list(APPEND MISSING_PACKAGES '${LIBNAME}') + list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=OFF -Dtestsupport=OFF -Dbuiltin_gtest=OFF') endif() endforeach() # Starting from cmake 3.23, the GTest targets will have stable names. @@ -1258,12 +1317,49 @@ endif() # Needed to run tests of the distributed RDataFrame module that use pyspark. # The functionality has been tested with pyspark 2.4 and above. if(test_distrdf_pyspark) - find_package(PySpark 2.4 REQUIRED) + find_package(PySpark 2.4) + if (NOT PySpark_FOUND) + message(SEND_ERROR "PySpark not found. Install it or disable option 'test_distrdf_pyspark'") + list(APPEND MISSING_PACKAGES 'PySpark') + list(APPEND HOTFIX_BUILD_FLAGS '-Dtest_distrdf_pyspark=OFF') + endif() endif() #------------------------------------------------------------------------------------ # Check if the dask package is installed on the system. # Needed to run tests of the distributed RDataFrame module that use dask. if(test_distrdf_dask) - find_package(Dask 2022.08.1 REQUIRED) + find_package(Dask 2022.08.1) + if (NOT Dask_FOUND) + message(SEND_ERROR "Dask not found. Install it or disable option 'test_distrdf_pyspark'") + list(APPEND MISSING_PACKAGES 'Dask') + list(APPEND HOTFIX_BUILD_FLAGS '-Dtest_distrdf_dask=OFF') + endif() +endif() + +if(webgui AND qt6web) + find_package(Qt6 COMPONENTS Core WebEngineCore WebEngineWidgets CONFIG) + if(NOT Qt6_FOUND) + message(SEND_ERROR "Could NOT find Qt6 (WebEngineCore, WebEngineWidgets), install missing packages on the system or disable option 'qt6web'") + list(APPEND MISSING_PACKAGES 'Qt6 WebEngineCore WebEngineWidgets') + list(APPEND HOTFIX_BUILD_FLAGS '-Dqt6web=OFF') + endif() +endif() + +if(NOT "${MISSING_PACKAGES}" STREQUAL "") + list(REMOVE_DUPLICATES MISSING_PACKAGES) + message(SEND_ERROR "The following packages need to be installed system-wide to build ROOT: ${MISSING_PACKAGES}") +endif() +if(NOT "${HOTFIX_BUILD_FLAGS}" STREQUAL "") + list(REMOVE_DUPLICATES HOTFIX_BUILD_FLAGS) + set(HOTFIX_BUILD_FLAGS_MESSAGE "Alternatively, a hotfix would be to add these flags to your CMake call:\n") + + foreach(_item IN LISTS HOTFIX_BUILD_FLAGS) + string(APPEND HOTFIX_BUILD_FLAGS_MESSAGE " ${_item} \\\n") + endforeach() + + # Remove final trailing backslash and newline + string(REGEX REPLACE "\\\\\n$" "" HOTFIX_BUILD_FLAGS_MESSAGE "${HOTFIX_BUILD_FLAGS_MESSAGE}") + + message(FATAL_ERROR "${HOTFIX_BUILD_FLAGS_MESSAGE}") endif() diff --git a/gui/qt6webdisplay/CMakeLists.txt b/gui/qt6webdisplay/CMakeLists.txt index c70ac93bb61cf..340240c399364 100644 --- a/gui/qt6webdisplay/CMakeLists.txt +++ b/gui/qt6webdisplay/CMakeLists.txt @@ -8,12 +8,6 @@ # CMakeLists.txt file for building ROOT gui/qt6webdisplay package ############################################################################ -find_package(Qt6 COMPONENTS Core WebEngineCore WebEngineWidgets CONFIG) - -if(NOT Qt6_FOUND) - message(SEND_ERROR "Could NOT find Qt6 (WebEngineCore, WebEngineWidgets), install missing packages on the system or disable option 'qt6web'") -endif() - set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) From f3b8f27581dc2b6369a70f85f0b72f326935dd0c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 11:33:35 +0200 Subject: [PATCH 02/21] [CMake] Produce an error when cuda=On and no CUDA compiler can be found. When cuda=On, but no viable compiler can be found, CMake produces the hard-to-understand error: Cannot determine link language of RooBatchCompute_CUDA. by hageboeck, cherrypicked from https://github.com/root-project/root/pull/23091/commits --- cmake/modules/SearchInstalledSoftware.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 5dc6027f8bea6..64820e179c345 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -970,6 +970,13 @@ if(experimental_adaptivecpp) endif() endif() +#---ensure that the cuda option is sound +if(cuda AND NOT CMAKE_CUDA_COMPILER) + message(SEND_ERROR "-Dcuda=ON can't be built because CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'! Install compiler or disable cuda option") + list(APPEND MISSING_PACKAGES 'CUDA') + list(APPEND HOTFIX_BUILD_FLAGS '-Dcuda=OFF') +endif() + #---Check for optional TMVA-SOFIE testing dependency (BLAS)------------------------------- # SOFIE itself has no external dependencies: ONNX models are read with a small # self-contained protobuf wire-format decoder (tmva/sofie_parsers/src/onnx.hxx). From 61b250e08153bf98345c4ae1249c9bcad0db0009 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 11:53:09 +0200 Subject: [PATCH 03/21] [cmake] explicitly enable daos_mock since testing is used in global --- .github/workflows/root-ci-config/buildconfig/global.txt | 1 + .github/workflows/root-docs-ci.yml | 2 +- cmake/modules/RootBuildOptions.cmake | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/root-ci-config/buildconfig/global.txt b/.github/workflows/root-ci-config/buildconfig/global.txt index 374966374cbb9..5090980793360 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -39,6 +39,7 @@ coverage=OFF cuda=OFF curl=ON daos=OFF +daos_mock=ON dataframe=ON davix=ON dcache=OFF diff --git a/.github/workflows/root-docs-ci.yml b/.github/workflows/root-docs-ci.yml index 1cd64060689c3..02421e4445a11 100644 --- a/.github/workflows/root-docs-ci.yml +++ b/.github/workflows/root-docs-ci.yml @@ -98,7 +98,7 @@ jobs: - name: Apply option overrides env: - OVERRIDES: "testing=Off roottest=Off" + OVERRIDES: "testing=Off roottest=Off daos_mock=Off" CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/alma9.txt' shell: bash run: | diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 5350a76bf8bba..adee34af1be24 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -123,6 +123,7 @@ ROOT_BUILD_OPTION(coverage OFF "Enable compile flags for coverage testing") ROOT_BUILD_OPTION(cuda OFF "Enable support for CUDA (requires CUDA toolkit >= 7.5)") ROOT_BUILD_OPTION(curl ON "Enable support for HTTP(S) through libcurl") ROOT_BUILD_OPTION(daos OFF "Enable RNTuple support for Intel DAOS") +ROOT_BUILD_OPTION(daos_mock OFF "Use libdaos_mock for RNTuple, use only for testing. Mutually exclusive with daos") ROOT_BUILD_OPTION(dataframe ON "Enable ROOT RDataFrame") ROOT_BUILD_OPTION(davix ON "Enable support for Davix (HTTP/WebDAV access)") ROOT_BUILD_OPTION(dcache OFF "Enable support for dCache (requires libdcap from DESY)") From 049a974d48571c10905ad19026332b45fcbc5c31 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 12:20:34 +0200 Subject: [PATCH 04/21] [ci] explicit build options to avoid contradictions --- .github/workflows/root-ci-config/buildconfig/alma10-minimal.txt | 1 + .github/workflows/root-ci-config/buildconfig/windows10.txt | 1 + .github/workflows/root-ci.yml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt index 972e8b6d27e27..eebec3b02395e 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt @@ -1,6 +1,7 @@ ccache=ON builtin_civetweb=ON builtin_vdt=ON +daos_mock=ON fail-on-missing=ON minimal=ON roottest=ON diff --git a/.github/workflows/root-ci-config/buildconfig/windows10.txt b/.github/workflows/root-ci-config/buildconfig/windows10.txt index eb33f67625d12..04127bcd889e0 100644 --- a/.github/workflows/root-ci-config/buildconfig/windows10.txt +++ b/.github/workflows/root-ci-config/buildconfig/windows10.txt @@ -19,6 +19,7 @@ builtin_xxhash=ON builtin_zlib=ON builtin_zstd=ON ccache=OFF +daos_mock=OFF davix=OFF fortran=OFF llvm13_broken_tests=OFF diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index c3dbb65dfac62..8bc5bcfa4182a 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -402,7 +402,7 @@ jobs: - image: alma10 - image: ubuntu22 python_venv: "/py-venv-3.12/ROOT-CI" - overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"] + overrides: ["imt=Off", "tmva-cpu=OFF", "CMAKE_BUILD_TYPE=Debug"] - image: ubuntu2404 overrides: ["CMAKE_BUILD_TYPE=Debug"] - image: ubuntu2604 From 9dbafc5c1f791d802727c946cf4a00abdf0bfdab Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 16:40:17 +0200 Subject: [PATCH 05/21] [cmake] also prevent touching cache within RootBuildOptions --- cmake/modules/RootBuildOptions.cmake | 41 +++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index adee34af1be24..bb2464cc65634 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -335,45 +335,54 @@ endif() #---Define at moment the options with the selected default values------------------------------ ROOT_APPLY_OPTIONS() -#---roottest option implies testing +#---roottest/rootbench options require testing and testsupport if(roottest OR rootbench) - set(testing ON CACHE BOOL "" FORCE) + if (NOT testing OR NOT testsupport) + message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON -Dtestsupport=ON)") + list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=ON') + list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') + endif() endif() -#---testing implies testsupport +#---testing requires testsupport if(testing) - set(testsupport ON CACHE BOOL "" FORCE) -endif() - -#---ensure that the cuda option is sound -if(cuda AND NOT CMAKE_CUDA_COMPILER) - message(FATAL_ERROR "Option cuda=On, but CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'") + message(SEND_ERROR "-Dtesting=ON requires -Dtestsupport=ON)") + list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') endif() #---running HS3 test suite requires both testing and pyroot, but testing globally disables tests if(testing AND test_roofit_hs3testsuite AND NOT pyroot) - message(FATAL_ERROR "-Dtest_roofit_hs3testsuite=ON requires both -Dtesting=ON and -Dpyroot=ON)") + message(SEND_ERROR "-Dtest_roofit_hs3testsuite=ON requires both -Dtesting=ON and -Dpyroot=ON)") + list(APPEND HOTFIX_BUILD_FLAGS '-Dpyroot=ON') endif() if(unfold AND NOT xml) - message(STATUS "Cannot enable unfold without enabling xml: unfold is disabled.") - set(unfold OFF) + message(SEND_ERROR "Cannot enable unfold without enabling -Dxml=ON.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dxml=ON') endif() if (NOT builtin_cling) if (builtin_clang OR builtin_llvm) message(WARNING "No need to build internal llvm or clang. Consider turning builtin_clang=Off and builtin_llvm=Off") + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_clang=OFF') + list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_llvm=OFF') endif() endif(NOT builtin_cling) if(NOT http AND webgui) - message(WARNING "Cannot build WebGui components without HTTP: webgui is disabled.") - set(webgui OFF) + message(SEND_ERROR "Cannot build WebGui components without HTTP: enable -Dhttp=ON or set -Dwebgui=OFF.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dwebgui=OFF') endif() if(NOT webgui) - set(qt6web OFF CACHE BOOL "Disabled because webgui not build" FORCE) - set(cefweb OFF CACHE BOOL "Disabled because webgui not build" FORCE) + if(qt6web) + message(SEND_ERROR "Cannot build qt6web without webgui and http: enable -Dwebgui=ON -Dhttp=ON or set -Dqt6web=OFF.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dqt6web=OFF') + endif() + if(qt6web) + message(SEND_ERROR "Cannot build cefweb without webgui and http: enable -Dwebgui=ON -Dhttp=ON or set -Dcefweb=OFF.") + list(APPEND HOTFIX_BUILD_FLAGS '-Dcefweb=OFF') + endif() endif() #---Removed options------------------------------------------------------------ From 8dcc10bc5f998818d848b14b8abcbd3340a26de5 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 17:36:26 +0200 Subject: [PATCH 06/21] [ci] explicitly enable testsupport and fix typo and ifcheck --- .../workflows/root-ci-config/buildconfig/alma10-minimal.txt | 1 + .github/workflows/root-ci-config/buildconfig/global.txt | 1 + .github/workflows/root-docs-ci.yml | 2 +- cmake/modules/RootBuildOptions.cmake | 6 ++++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt index eebec3b02395e..d0349c9dddb80 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt @@ -6,3 +6,4 @@ fail-on-missing=ON minimal=ON roottest=ON testing=ON +testsupport=ON diff --git a/.github/workflows/root-ci-config/buildconfig/global.txt b/.github/workflows/root-ci-config/buildconfig/global.txt index 5090980793360..244e0535ead61 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -85,6 +85,7 @@ test_distrdf_pyspark=ON test_roofit_hs3testsuite=ON test_tmva_sofie=ON testing=ON +testsupport=ON tmva-cpu=ON tmva-gpu=OFF tmva-cudnn=OFF diff --git a/.github/workflows/root-docs-ci.yml b/.github/workflows/root-docs-ci.yml index 02421e4445a11..c0529c344d50c 100644 --- a/.github/workflows/root-docs-ci.yml +++ b/.github/workflows/root-docs-ci.yml @@ -98,7 +98,7 @@ jobs: - name: Apply option overrides env: - OVERRIDES: "testing=Off roottest=Off daos_mock=Off" + OVERRIDES: "testing=Off testsupport=OFF roottest=Off daos_mock=Off" CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/alma9.txt' shell: bash run: | diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index bb2464cc65634..68c49e3d43c9e 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -338,7 +338,7 @@ ROOT_APPLY_OPTIONS() #---roottest/rootbench options require testing and testsupport if(roottest OR rootbench) if (NOT testing OR NOT testsupport) - message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON -Dtestsupport=ON)") + message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON -Dtestsupport=ON") list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=ON') list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') endif() @@ -346,8 +346,10 @@ endif() #---testing requires testsupport if(testing) - message(SEND_ERROR "-Dtesting=ON requires -Dtestsupport=ON)") + if (NOT testsupport) + message(SEND_ERROR "-Dtesting=ON requires -Dtestsupport=ON") list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') + endif() endif() #---running HS3 test suite requires both testing and pyroot, but testing globally disables tests From b80800ae21b5513cc3d1f3e341f207389c4ab78c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 09:08:21 +0200 Subject: [PATCH 07/21] [cmake] rm superfluous single quotes in copy-pastable error message and split multioptions and fix conflicting ssl=OFF vs builtin_openssl=ON on macos hotfix help message --- cmake/modules/CheckCompiler.cmake | 2 +- cmake/modules/RootBuildOptions.cmake | 20 +-- cmake/modules/SearchInstalledSoftware.cmake | 154 +++++++++++--------- 3 files changed, 93 insertions(+), 83 deletions(-) diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index 4aacde172ab4d..2590fba0da006 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -52,7 +52,7 @@ if(fortran) if(NOT CMAKE_Fortran_COMPILER) message(SEND_ERROR "No Fortran compiler found. Please make sure it's installed, or disable ROOT's Fortran features with '-Dfortran=OFF'") list(APPEND MISSING_PACKAGES 'gfortran') - list(APPEND HOTFIX_BUILD_FLAGS '-Dfortran=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dfortran=OFF) endif() else() set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 68c49e3d43c9e..10bf50d12748e 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -339,8 +339,8 @@ ROOT_APPLY_OPTIONS() if(roottest OR rootbench) if (NOT testing OR NOT testsupport) message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON -Dtestsupport=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=ON') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=ON) + list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=ON) endif() endif() @@ -348,42 +348,42 @@ endif() if(testing) if (NOT testsupport) message(SEND_ERROR "-Dtesting=ON requires -Dtestsupport=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtestsupport=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=ON) endif() endif() #---running HS3 test suite requires both testing and pyroot, but testing globally disables tests if(testing AND test_roofit_hs3testsuite AND NOT pyroot) message(SEND_ERROR "-Dtest_roofit_hs3testsuite=ON requires both -Dtesting=ON and -Dpyroot=ON)") - list(APPEND HOTFIX_BUILD_FLAGS '-Dpyroot=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dpyroot=ON) endif() if(unfold AND NOT xml) message(SEND_ERROR "Cannot enable unfold without enabling -Dxml=ON.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dxml=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dxml=ON) endif() if (NOT builtin_cling) if (builtin_clang OR builtin_llvm) message(WARNING "No need to build internal llvm or clang. Consider turning builtin_clang=Off and builtin_llvm=Off") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_clang=OFF') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_llvm=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_clang=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_llvm=OFF) endif() endif(NOT builtin_cling) if(NOT http AND webgui) message(SEND_ERROR "Cannot build WebGui components without HTTP: enable -Dhttp=ON or set -Dwebgui=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dwebgui=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dwebgui=OFF) endif() if(NOT webgui) if(qt6web) message(SEND_ERROR "Cannot build qt6web without webgui and http: enable -Dwebgui=ON -Dhttp=ON or set -Dqt6web=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dqt6web=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dqt6web=OFF) endif() if(qt6web) message(SEND_ERROR "Cannot build cefweb without webgui and http: enable -Dwebgui=ON -Dhttp=ON or set -Dcefweb=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dcefweb=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dcefweb=OFF) endif() endif() diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 64820e179c345..c2cedd4680610 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -68,7 +68,7 @@ if(clad AND NOT DEFINED CLAD_SOURCE_DIR) if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check it or disable the 'clad' option") list(APPEND MISSING_PACKAGES 'clad') - list(APPEND HOTFIX_BUILD_FLAGS '-Dclad=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dclad=OFF) endif() endif() @@ -143,7 +143,7 @@ if(opengl) ROOT_FIND_REQUIRED_DEP(FTGL builtin_ftgl) elseif(builtin_ftgl) message(SEND_ERROR "FTGL features enabled with \"builtin_ftgl=ON\" require \"opengl=ON\"") - list(APPEND HOTFIX_BUILD_FLAGS '-Dopengl=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=ON) endif() if(webgui AND root7 AND geom) ROOT_FIND_REQUIRED_DEP(OpenGL builtin_glu) @@ -164,15 +164,15 @@ if(ssl) if(NOT OPENSSL_FOUND) message(SEND_ERROR "OpenSSL found but missing required component SSL. Install it on the system (preferred), or explicitly request the builtin version. Or turn off ssl option.") list(APPEND MISSING_PACKAGES 'OpenSSL') - list(APPEND HOTFIX_BUILD_FLAGS '-Dssl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openssl=ON) endif() else() ROOT_CHECK_CONNECTION("builtin_openssl=OFF") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, disable the 'ssl' and 'builtin_openssl' options") list(APPEND MISSING_PACKAGES 'OpenSSL') - list(APPEND HOTFIX_BUILD_FLAGS '-Dssl=OFF') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_openssl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dssl=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openssl=OFF) endif() endif() else() @@ -180,7 +180,7 @@ if(ssl) if(NOT OPENSSL_FOUND) message(SEND_ERROR "OpenSSL found but missing required component SSL. Install it on the system (preferred), or explicitly request the builtin version. Or turn off ssl option.") list(APPEND MISSING_PACKAGES 'OpenSSL') - list(APPEND HOTFIX_BUILD_FLAGS '-Dssl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dssl=OFF) endif() endif() endif() @@ -211,7 +211,7 @@ if(xrootd) # Must go after SSL if("${XROOTD_${component}_LIBRARIES}" STREQUAL "XROOTD_${component}_LIBRARIES-NOTFOUND") message(SEND_ERROR "XROOTD found but missing component ${component}. Install missing package on your system (preferred). " "Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally; or turn off xrootd.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=OFF) endif() endforeach() endif() @@ -220,12 +220,12 @@ endif() if(builtin_xrootd) if(NOT ssl AND NOT builtin_openssl) message(SEND_ERROR "Building XRootD ('builtin_xrootd'=On) requires ssl support.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dssl=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dssl=ON) endif() endif() if(xrootd AND NOT builtin_xrootd AND builtin_openssl) message(SEND_ERROR "Non-builtin XROOTD must not be used with builtin OpenSSL. If you want to use non-builtin XROOTD, please use the system OpenSSL") - list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=OFF) endif() if(imt) ROOT_FIND_REQUIRED_DEP(TBB builtin_tbb 2020) @@ -242,12 +242,12 @@ if(imt) int main() { return 0; }" tbb_exception_result) if(NOT tbb_exception_result) message(SEND_ERROR "Found TBB uses tbb::captured_exception, not suitable for ROOT!, enable 'builtin_tbb' option or turn off 'imt'") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_tbb=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_tbb=ON) endif() endif() elseif(builtin_tbb) message(SEND_ERROR "TBB features enabled with \"builtin_tbb=ON\" require \"imt=ON\"") - list(APPEND HOTFIX_BUILD_FLAGS '-Dimt=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dimt=ON) endif() # Double package name call, needs special manual treatment, cannot call ROOT_FIND_REQUIRED_DEP: @@ -267,7 +267,7 @@ if(NOT builtin_pcre) "Please install it in the system (preferred), set the corresponding CMake search variable, " "or opt in to downloading and auto-build it from externally provided source tarball using '-Dbuiltin_pcre=ON'.") list(APPEND MISSING_PACKAGES PCRE2) - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_pcre=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_pcre=ON) endif() endif() endif() @@ -277,7 +277,7 @@ if(mathmore OR (tmva-cpu AND use_gsl_cblas)) if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check it or disable the 'builtin_gsl' option") list(APPEND MISSING_PACKAGES 'GSL') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_gsl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gsl=OFF) endif() endif() message(STATUS "Looking for GSL") @@ -320,7 +320,7 @@ set(CMAKE_FIND_FRAMEWORK LAST) if(NOT shared) if(WINDOWS) message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") - list(APPEND HOTFIX_BUILD_FLAGS '-Dshared=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dshared=ON) else() message("Preferring static libraries.") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;${CMAKE_FIND_LIBRARY_SUFFIXES}") @@ -385,11 +385,11 @@ if(cocoa) if(APPLE) if (x11) message(SEND_ERROR "x11 (${x11_description}) and cocoa cannot be enabled simultaneously. Set -Dx11=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dx11=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dx11=OFF) endif() else() message(SEND_ERROR "Cocoa option can only be enabled on MacOSX platform. Set -Dcocoa=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dcocoa=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dcocoa=OFF) endif() endif() @@ -442,7 +442,7 @@ endif() if(asimage) if(NOT x11 AND NOT cocoa AND NOT WIN32) message(SEND_ERROR "'asimage' needs either 'x11' or 'cocoa' enabled. Set -Dasimage=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dasimage=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dasimage=OFF) endif() endif() if(asimage) @@ -539,10 +539,10 @@ if(opengl OR cocoa) if(NOT OPENGL_FOUND OR NOT OPENGL_GLU_FOUND) if(cocoa AND NOT opengl) message(SEND_ERROR "OpenGL package (with GLU) not found and opengl option required for \"cocoa=ON\". Set -Dcocoa=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dcocoa=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dcocoa=OFF) else() message(SEND_ERROR "OpenGL package (with GLU) not found and opengl option required. Set -Dopengl=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dopengl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=OFF) endif() endif() endif() @@ -551,7 +551,7 @@ endif() if(NOT WIN32 AND NOT APPLE) if(opengl AND NOT x11) message(SEND_ERROR "OpenGL requires x11 on Linux, either disable opengl or set -Dx11=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dx11=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dx11=ON) endif() endif() # The opengl flag enables the graf3d features that depend on OpenGL, and these @@ -559,7 +559,7 @@ endif() # asimage is off. See also: https://github.com/root-project/root/issues/16250 if(opengl AND NOT asimage) message(SEND_ERROR "OpenGL features enabled with \"opengl=ON\" require \"asimage=ON\"") - list(APPEND HOTFIX_BUILD_FLAGS '-Dasimage=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dasimage=ON) endif() #---Check for gl2ps ------------------------------------------------------------------ @@ -579,7 +579,7 @@ if(gviz) if(NOT GRAPHVIZ_FOUND) message(SEND_ERROR "Graphviz libraries not found while -Dgviz=ON. Install them on the system or set -Dgviz=OFF") list(APPEND MISSING_PACKAGES 'Graphviz') - list(APPEND HOTFIX_BUILD_FLAGS '-Dgviz=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dgviz=OFF) endif() endif() @@ -590,7 +590,7 @@ if(xml) if(NOT LIBXML2_FOUND) message(SEND_ERROR "LibXml2 libraries not while -Dxml=ON. Install them on the system or set -Dxml=OFF") list(APPEND MISSING_PACKAGES 'LibXml2') - list(APPEND HOTFIX_BUILD_FLAGS '-Dxml=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dxml=OFF) endif() endif() @@ -606,7 +606,7 @@ if(fcgi) if(NOT FASTCGI_FOUND) message(SEND_ERROR "FastCGI library not found while -Dfcgi=ON. Install it on the system or set -Dfcgi=OFF") list(APPEND MISSING_PACKAGES 'FastCGI') - list(APPEND HOTFIX_BUILD_FLAGS '-Dfcgi=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dfcgi=OFF) endif() endif() @@ -629,7 +629,7 @@ if(http AND NOT builtin_civetweb) message(STATUS "Detected civetweb feature mask: ${CIVETWEB_FEATURES}") else() message(SEND_ERROR "Could not run civetweb features: ${BUILD_LOG}. Try fixing the install or use builtin_civetweb=ON or switch `-Dhttp=OFF`") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_civetweb=ON) endif() math(EXPR CIVETWEB_HAS_WEBSOCKET "(${CIVETWEB_FEATURES} >> 4) & 0x1") math(EXPR CIVETWEB_HAS_ZLIB "(${CIVETWEB_FEATURES} >> 9) & 0x1") @@ -637,7 +637,7 @@ if(http AND NOT builtin_civetweb) message(STATUS "civetweb websocket ; zlib ; xdomsocket support: ${CIVETWEB_HAS_WEBSOCKET} ; ${CIVETWEB_HAS_ZLIB} ; ${CIVETWEB_HAS_X_DOM_SOCKET}") else() message(SEND_ERROR "Could not check for civetweb features: ${CIVETWEB_FEATURE_API_LOG}. Try fixing the install or use builtin_civetweb=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_civetweb=ON) endif() if(NOT "${CIVETWEB_HAS_WEBSOCKET}" STREQUAL "1" OR NOT "${CIVETWEB_HAS_ZLIB}" STREQUAL "1" OR NOT "${CIVETWEB_HAS_X_DOM_SOCKET}" STREQUAL "1") @@ -647,7 +647,7 @@ if(http AND NOT builtin_civetweb) unset(${var} CACHE) endforeach() message(SEND_ERROR "System-wide civetweb found but does not include websocket or zlib or xdomsocket components (-DCIVETWEB_ENABLE_WEBSOCKETS=ON -DCIVETWEB_ENABLE_ZLIB=ON -DCIVETWEB_ENABLE_X_DOM_SOCKET=ON). Set `-Dbuiltin_civetweb=ON` as workaround or switch `-Dhttp=OFF`.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_civetweb=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_civetweb=ON) endif() endif() endif() @@ -662,7 +662,7 @@ if(sqlite) if(NOT SQLITE_FOUND) message(SEND_ERROR "SQLite libraries not found while -Dsqlite=ON. Install them on the system or set -Dsqlite=OFF") list(APPEND MISSING_PACKAGES 'SQLite') - list(APPEND HOTFIX_BUILD_FLAGS '-Dsqlite=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dsqlite=OFF) endif() endif() @@ -673,7 +673,7 @@ if(pythia8) if(NOT PYTHIA8_FOUND) message(SEND_ERROR "Pythia8 libraries not found while -Dpythia8=ON. Install them on the system or set -Dpythia8=OFF") list(APPEND MISSING_PACKAGES 'Pythia8') - list(APPEND HOTFIX_BUILD_FLAGS '-Dpythia8=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dpythia8=OFF) endif() endif() @@ -683,14 +683,14 @@ if(builtin_fftw3) if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check it or disable the 'builtin_fftw3' option") list(APPEND MISSING_PACKAGES 'fftw3') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_fftw3=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_fftw3=OFF) endif() endif() if(builtin_fftw3) add_subdirectory(builtins/fftw3) if (NOT fftw3) message(SEND_ERROR "builtin_fftw3=ON is incompatible with fftw3=OFF. Set -Dfftw3=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dfftw3=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dfftw3=ON) endif() endif() @@ -701,7 +701,7 @@ if(fitsio OR builtin_cfitsio) if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check it or disable the 'builtin_cfitsio' option") list(APPEND MISSING_PACKAGES 'CFITSIO') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_cfitsio=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_cfitsio=OFF) endif() endif() if(builtin_cfitsio) @@ -709,7 +709,7 @@ if(fitsio OR builtin_cfitsio) add_subdirectory(builtins/cfitsio) if(NOT fitsio) message(SEND_ERROR "builtin_cfitsio=ON is incompatible with fitsio=OFF. Set -Dfitsio=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dfitsio=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dfitsio=ON) endif() endif() endif() @@ -719,7 +719,7 @@ if(shadowpw) if(NOT EXISTS /etc/shadow) #---TODO--The test always succeeds because the actual file is protected if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) message(SEND_ERROR "Support Shadow password not found. Switch off shadowpw option -Dshadowpw=OFF") - list(APPEND HOTFIX_BUILD_FLAGS '-Dshadowpw=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dshadowpw=OFF) endif() endif() endif() @@ -743,12 +743,13 @@ if(builtin_xrootd) if(NO_CONNECTION) message(SEND_ERROR "No internet connection. Please check your connection, or disable the 'builtin_xrootd'" " option and 'xrootd' options.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=OFF -Dbuiltin_xrootd=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_xrootd=OFF) endif() add_subdirectory(builtins/xrootd) if (NOT xrootd) message(SEND_ERROR "builtin_xrootd=ON is incompatible with xrootd=OFF (${xrootd_description}). Set xrootd=ON") - list(APPEND HOTFIX_BUILD_FLAGS '-Dxrootd=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=ON) endif() endif() @@ -774,7 +775,7 @@ if(arrow) if(NOT ARROW_FOUND) message(SEND_ERROR "Apache Arrow not found but is required. Please set ARROW_ROOT to point to your Arrow installation, " "or include the installation of Arrow in the CMAKE_PREFIX_PATH. Or disable option 'arrow'.") - list(APPEND HOTFIX_BUILD_FLAGS '-Darrow=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Darrow=OFF) endif() endif() @@ -784,7 +785,7 @@ if(dcache) if(NOT DCAP_FOUND) message(SEND_ERROR "dCap library not found while -Ddcache=ON" " Set variable DCAP_ROOT to point to your dCache installation. Or disable option 'dcache'.") - list(APPEND HOTFIX_BUILD_FLAGS '-Ddcache=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Ddcache=OFF) endif() endif() @@ -815,7 +816,7 @@ if(davix) else() message(SEND_ERROR "Davix libraries (${davix_description}) not found while -Ddavix=ON. Install them on the system or set -Ddavix=OFF") list(APPEND MISSING_PACKAGES 'Davix') - list(APPEND HOTFIX_BUILD_FLAGS '-Ddavix=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Ddavix=OFF) endif() endif() @@ -838,7 +839,7 @@ if(curl) if(NOT CURL_FOUND) message(SEND_ERROR "libcurl not found (${curl_description}) and -Dcurl=ON option required. Install on the system or set -Dcurl=OFF.") list(APPEND MISSING_PACKAGES 'libcurl') - list(APPEND HOTFIX_BUILD_FLAGS '-Dcurl=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dcurl=OFF) endif() endif() @@ -846,24 +847,24 @@ endif() if (uring) if(NOT CMAKE_SYSTEM_NAME MATCHES Linux) message(SEND_ERROR "liburing only available on Linux but -During=ON option required. Set -During=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-During=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -During=OFF) else() message(STATUS "Looking for liburing") find_package(liburing) message(SEND_ERROR "liburing not found and -During=ON option required. Install on the system or set -During=OFF.") list(APPEND MISSING_PACKAGES 'liburing') - list(APPEND HOTFIX_BUILD_FLAGS '-During=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -During=OFF) endif() endif() #---Check for DAOS---------------------------------------------------------------- if (daos AND daos_mock) message(SEND_ERROR "Options `daos` and `daos_mock` are mutually exclusive; only one of them should be specified.") - list(APPEND HOTFIX_BUILD_FLAGS '-Ddaos=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Ddaos=OFF) endif() if (testing AND NOT daos AND NOT WIN32 AND NOT daos_mock) message(SEND_ERROR "`-Dtesting=ON` requires either `daos` or `daos_mock`.") - list(APPEND HOTFIX_BUILD_FLAGS '-Ddaos_mock=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Ddaos_mock=ON) endif() if (daos OR daos_mock) @@ -871,7 +872,8 @@ if (daos OR daos_mock) if(NOT libuuid_FOUND) message(SEND_ERROR "libuuid not found and it is required (daos or daos_mock option enabled). Install it on the system, or disable options 'daos' and 'daos_mock'") list(APPEND MISSING_PACKAGES 'libuuid') - list(APPEND HOTFIX_BUILD_FLAGS '-Ddaos=OFF -Ddaos_mock=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Ddaos=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Ddaos_mock=OFF) endif() endif() if (daos) @@ -879,7 +881,7 @@ if (daos) if(NOT DAOS_FOUND) message(SEND_ERROR "libdaos not found while -Ddaos=ON. Install it on the system, or disable option 'daos'") list(APPEND MISSING_PACKAGES 'DAOS') - list(APPEND HOTFIX_BUILD_FLAGS '-Ddaos=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Ddaos=OFF) endif() endif() @@ -896,7 +898,8 @@ if(builtin_tbb) ROOT_CHECK_CONNECTION("builtin_tbb=OFF") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check your connection or disable 'builtin_tbb' and 'imt' options") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_tbb=OFF -Dimt=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_tbb=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dimt=OFF) endif() endif() @@ -908,7 +911,8 @@ if(builtin_vdt) ROOT_CHECK_CONNECTION("builtin_vdt=OFF") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check your connection or disable 'builtin_vdt' and 'vdt' options") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_vdt=OFF -Dvdt=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_vdt=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dvdt=OFF) endif() endif() @@ -925,7 +929,7 @@ if (vecgeom) find_package(VecGeom 1.2 CONFIG) if(NOT VecGeom_FOUND) message(SEND_ERROR "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH, or disable 'vecgeom'") - list(APPEND HOTFIX_BUILD_FLAGS '-Dvecgeom=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dvecgeom=OFF) else() message(STATUS " Found VecGeom " ${VecGeom_VERSION}) endif() @@ -937,7 +941,7 @@ if(experimental_adaptivecpp) ROOT_CHECK_CONNECTION("experimental_adaptivecpp") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check your connection or disable 'experimental_adaptivecpp' option") - list(APPEND HOTFIX_BUILD_FLAGS '-Dexperimental_adaptivecpp=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dexperimental_adaptivecpp=OFF) endif() endif() include(SetupAdaptiveCpp) @@ -966,7 +970,7 @@ if(experimental_adaptivecpp) else() message(SEND_ERROR "AdaptiveCpp library not found, install it or disable 'experimental_adaptivecpp'") list(APPEND MISSING_PACKAGES 'AdaptiveCpp') - list(APPEND HOTFIX_BUILD_FLAGS '-Dexperimental_adaptivecpp=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dexperimental_adaptivecpp=OFF) endif() endif() @@ -974,7 +978,7 @@ endif() if(cuda AND NOT CMAKE_CUDA_COMPILER) message(SEND_ERROR "-Dcuda=ON can't be built because CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'! Install compiler or disable cuda option") list(APPEND MISSING_PACKAGES 'CUDA') - list(APPEND HOTFIX_BUILD_FLAGS '-Dcuda=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dcuda=OFF) endif() #---Check for optional TMVA-SOFIE testing dependency (BLAS)------------------------------- @@ -987,7 +991,7 @@ if(tmva AND testing AND test_tmva_sofie) if(NOT BLAS_FOUND) message(SEND_ERROR "BLAS not found, but it's required for TMVA-SOFIE testing. Please install BLAS or configure with test_tmva_sofie=OFF") list(APPEND MISSING_PACKAGES 'BLAS') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtest_tmva_sofie=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtest_tmva_sofie=OFF) endif() endif() @@ -995,10 +999,10 @@ endif() if(tmva-cpu) if (NOT tmva) message(SEND_ERROR "-Dtmva-cpu=ON is incompatible with -Dtmva=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-cpu=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cpu=OFF) elseif(NOT imt) message(SEND_ERROR "-Dtmva-cpu=ON is incompatible with -Dimt=OFF.") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-cpu=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cpu=OFF) endif() endif() if(tmva-cpu) @@ -1009,7 +1013,7 @@ if(tmva-cpu) # use the GSL CBLAS. message(SEND_ERROR "Option tmva-cpu requires a BLAS library, but none could be found on the system. Either install a BLAS library like OpenBLAS (preferred), or set use_gsl_cblas=ON (possibly also builtin_gsl=ON if GSL not installed on the system). Or disable tmva-cpu.") list(APPEND MISSING_PACKAGES 'BLAS') - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_gsl=ON') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gsl=ON) endif() endif() endif() @@ -1020,7 +1024,9 @@ if(mathmore OR builtin_gsl OR (tmva-cpu AND use_gsl_cblas)) ROOT_CHECK_CONNECTION("builtin_gsl") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check your connection or disable 'builtin_gsl', 'tmva-cpu' and 'use_gsl_cblas' options") - list(APPEND HOTFIX_BUILD_FLAGS '-Dbuiltin_gsl=OFF -Dtmva-cpu=OFF -Duse_gsl_cblas=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gsl=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cpu=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Duse_gsl_cblas=OFF) endif() endif() if(builtin_gsl) @@ -1046,14 +1052,14 @@ if(tmva-cpu) else() message(SEND_ERROR "tmva-cpu can't be built because BLAS was not found (${tmva-cpu_description})! Install it or disable tmva-cpu") list(APPEND MISSING_PACKAGES 'BLAS') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-cpu=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cpu=OFF) endif() endif() if(tmva) if(tmva-gpu AND NOT CMAKE_CUDA_COMPILER) message(SEND_ERROR "tmva-gpu can't be built because CUDA was not found! Install it or disable tmva-gpu") list(APPEND MISSING_PACKAGES 'CUDA') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-gpu=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-gpu=OFF) elseif(tmva-gpu) # So far, TMVA is the only package that uses the CUDA toolkit. RooFit is # just compiling libraries with the NVidia compiler itself. If more ROOT @@ -1072,7 +1078,7 @@ if(tmva) else() message(SEND_ERROR "cudnn not found while -Dtmva-cudnn=ON. Install it on the system, or disable option 'tmva-cudnn'") list(APPEND MISSING_PACKAGES 'CUDNN') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-cudnn=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cudnn=OFF) endif() endif() else() @@ -1083,21 +1089,21 @@ if(tmva) message(SEND_ERROR "TMVA: numpy python package or Python development package not found and tmva-pymva component required" " (python executable: ${Python3_EXECUTABLE}). Install them or disable tmva-pymva.") list(APPEND MISSING_PACKAGES 'numpy') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-pymva=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-pymva=OFF) endif() endif() else() if (tmva-gpu) message(SEND_ERROR "'-Dtmva-gpu=ON' is incompatible with '-Dtmva=OFF' (${tmva-gpu_description})") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-gpu=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-gpu=OFF) endif() if (tmva-cudnn) message(SEND_ERROR "'-Dtmva-cudnn=ON' is incompatible with '-Dtmva=OFF' (${tmva-cudnn_description})") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-cudnn=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-cudnn=OFF) endif() if (tmva-pymva) message(SEND_ERROR "'-Dtmva-pymva=ON' is incompatible with '-Dtmva=OFF' (${tmva-pymva_description})") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtmva-pymva=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtmva-pymva=OFF) endif() endif(tmva) @@ -1110,7 +1116,7 @@ if(pyroot) message(SEND_ERROR "PyROOT: Python development package not found and pyroot component required" " (python executable: ${Python3_EXECUTABLE}). Install it or disable pyroot option.") list(APPEND MISSING_PACKAGES 'Python3_Development.Module') - list(APPEND HOTFIX_BUILD_FLAGS '-Dpyroot=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dpyroot=OFF) endif() endif() @@ -1122,7 +1128,7 @@ if(tpython) message(SEND_ERROR "TPython: Python development package not found and tpython component required" " (python executable: ${Python3_EXECUTABLE}). Install it or disable tpython option.") list(APPEND MISSING_PACKAGES 'Python3_Development') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtpython=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtpython=OFF) endif() endif() @@ -1135,7 +1141,7 @@ if (mpi) message(SEND_ERROR "MPI not found. Ensure that the installation of MPI is in the CMAKE_PREFIX_PATH." " Example: CMAKE_PREFIX_PATH= (e.g. \"/usr/local/mpich\"). Or disable option 'mpi'") list(APPEND MISSING_PACKAGES 'MPI') - list(APPEND HOTFIX_BUILD_FLAGS '-Dmpi=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dmpi=OFF) endif() endif() @@ -1145,7 +1151,9 @@ if (testing OR testsupport) ROOT_CHECK_CONNECTION("testing=OFF") if(NO_CONNECTION) message(STATUS "No internet connection, check connection or disable the 'testing', 'testsupport' and 'builtin_gtest' options") - list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=OFF -Dtestsupport=OFF -Dbuiltin_gtest=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gtest=OFF) else() add_subdirectory(builtins/gtest) endif() @@ -1158,7 +1166,9 @@ if (testing OR testsupport) if(NOT TARGET GTest::${LIBNAME} AND NOT TARGET ${LIBNAME}) message(SEND_ERROR "Missing installation of GTest subcomponent ${LIBNAME}. Install it or disable testing and testsupport.") list(APPEND MISSING_PACKAGES '${LIBNAME}') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtesting=OFF -Dtestsupport=OFF -Dbuiltin_gtest=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=OFF) + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gtest=OFF) endif() endforeach() # Starting from cmake 3.23, the GTest targets will have stable names. @@ -1328,7 +1338,7 @@ if(test_distrdf_pyspark) if (NOT PySpark_FOUND) message(SEND_ERROR "PySpark not found. Install it or disable option 'test_distrdf_pyspark'") list(APPEND MISSING_PACKAGES 'PySpark') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtest_distrdf_pyspark=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtest_distrdf_pyspark=OFF) endif() endif() @@ -1340,7 +1350,7 @@ if(test_distrdf_dask) if (NOT Dask_FOUND) message(SEND_ERROR "Dask not found. Install it or disable option 'test_distrdf_pyspark'") list(APPEND MISSING_PACKAGES 'Dask') - list(APPEND HOTFIX_BUILD_FLAGS '-Dtest_distrdf_dask=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dtest_distrdf_dask=OFF) endif() endif() @@ -1349,7 +1359,7 @@ if(webgui AND qt6web) if(NOT Qt6_FOUND) message(SEND_ERROR "Could NOT find Qt6 (WebEngineCore, WebEngineWidgets), install missing packages on the system or disable option 'qt6web'") list(APPEND MISSING_PACKAGES 'Qt6 WebEngineCore WebEngineWidgets') - list(APPEND HOTFIX_BUILD_FLAGS '-Dqt6web=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Dqt6web=OFF) endif() endif() From 2067dffa4022edc7a30b611acec7138c715b183e Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 11:50:37 +0200 Subject: [PATCH 08/21] [cmake] make testing independent of (parallel to) testsupport Before, there was a subordinate hierarchical dependency, testing required testsupport. Now they have a logical OR relationship, GTest will be a dependency if one or the other is enabled. --- cmake/modules/RootBuildOptions.cmake | 17 ++++------------- core/testsupport/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 10bf50d12748e..a5fd3eb779d22 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -166,7 +166,7 @@ ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") ROOT_BUILD_OPTION(ssl ON "Enable support for SSL encryption via OpenSSL") 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)") +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). If OFF, this library is still built if testing=ON") ROOT_BUILD_OPTION(thisroot_scripts ON "Build scripts like thisroot.{sh, fish, etc.} that set environment paths for using ROOT. Usually not needed when building ROOT for the distribution with a package manager.") ROOT_BUILD_OPTION(tmva ON "Build TMVA multi variate analysis library") ROOT_BUILD_OPTION(tmva-cpu ON "Build TMVA with CPU support for deep learning (requires BLAS)") @@ -335,20 +335,11 @@ endif() #---Define at moment the options with the selected default values------------------------------ ROOT_APPLY_OPTIONS() -#---roottest/rootbench options require testing and testsupport +#---roottest/rootbench options require testing if(roottest OR rootbench) - if (NOT testing OR NOT testsupport) - message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON -Dtestsupport=ON") + if (NOT testing) + message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON") list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=ON) - list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=ON) - endif() -endif() - -#---testing requires testsupport -if(testing) - if (NOT testsupport) - message(SEND_ERROR "-Dtesting=ON requires -Dtestsupport=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=ON) endif() endif() diff --git a/core/testsupport/CMakeLists.txt b/core/testsupport/CMakeLists.txt index eaa1b032e0451..b001897a0986f 100644 --- a/core/testsupport/CMakeLists.txt +++ b/core/testsupport/CMakeLists.txt @@ -4,7 +4,7 @@ # higher than kInfo are issued by tests. # Stephan Hageboeck, CERN, 2022 -if(NOT testsupport) +if(NOT testsupport AND NOT testing) return() endif() From d49eb237ec8923a6998895b11fc3f8dc6eaebbfc Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 12:19:57 +0200 Subject: [PATCH 09/21] [ci] setting ON testsupport no longer needed --- .../root-ci-config/buildconfig/alma10-minimal.txt | 1 - .github/workflows/root-ci-config/buildconfig/global.txt | 2 +- .github/workflows/root-docs-ci.yml | 2 +- cmake/modules/RootBuildOptions.cmake | 8 ++++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt index d0349c9dddb80..eebec3b02395e 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt @@ -6,4 +6,3 @@ fail-on-missing=ON minimal=ON roottest=ON testing=ON -testsupport=ON diff --git a/.github/workflows/root-ci-config/buildconfig/global.txt b/.github/workflows/root-ci-config/buildconfig/global.txt index 244e0535ead61..c63f142bb0755 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -85,7 +85,7 @@ test_distrdf_pyspark=ON test_roofit_hs3testsuite=ON test_tmva_sofie=ON testing=ON -testsupport=ON +testsupport=OFF tmva-cpu=ON tmva-gpu=OFF tmva-cudnn=OFF diff --git a/.github/workflows/root-docs-ci.yml b/.github/workflows/root-docs-ci.yml index c0529c344d50c..fa3f3864cf8bd 100644 --- a/.github/workflows/root-docs-ci.yml +++ b/.github/workflows/root-docs-ci.yml @@ -98,7 +98,7 @@ jobs: - name: Apply option overrides env: - OVERRIDES: "testing=Off testsupport=OFF roottest=Off daos_mock=Off" + OVERRIDES: "testing=Off", "roottest=Off", "daos_mock=Off" CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/alma9.txt' shell: bash run: | diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index a5fd3eb779d22..6ef25613bdfa8 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -166,7 +166,7 @@ ROOT_BUILD_OPTION(sqlite ON "Enable support for SQLite") ROOT_BUILD_OPTION(ssl ON "Enable support for SSL encryption via OpenSSL") 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). If OFF, this library is still built if testing=ON") +ROOT_BUILD_OPTION(testsupport OFF "Build the ROOT::TestSupport library required to use ROOT_ADD_GTEST and similar macros by downstream users (requires gtest at build time). Even if OFF, this library is still built if testing=ON") ROOT_BUILD_OPTION(thisroot_scripts ON "Build scripts like thisroot.{sh, fish, etc.} that set environment paths for using ROOT. Usually not needed when building ROOT for the distribution with a package manager.") ROOT_BUILD_OPTION(tmva ON "Build TMVA multi variate analysis library") ROOT_BUILD_OPTION(tmva-cpu ON "Build TMVA with CPU support for deep learning (requires BLAS)") @@ -192,11 +192,11 @@ option(clingtest "Enable cling tests (Note: that this makes llvm/clang symbols v option(fail-on-missing "Fail at configure time if a required package cannot be found" OFF) option(gminimal "Enable only required options by default, but include X11/Cocoa" OFF) option(minimal "Enable only required options by default" OFF) -option(rootbench "Build rootbench if rootbench exists in root or if it is a sibling directory (implies testing=ON)" OFF) -option(roottest "Build roottest (implies testing=ON)" OFF) +option(rootbench "Build rootbench if rootbench exists in root or if it is a sibling directory (requires testing=ON)" OFF) +option(roottest "Build roottest (requires testing=ON)" OFF) option(test_roofit_hs3testsuite "Setup and use the HS3 conformance test suite (requires network)" OFF) option(test_tmva_sofie "Enable SOFIE tests (requires BLAS library that can be found with CMake's FindBLAS)" ON) -option(testing "Enable testing with CTest" OFF) +option(testing "Enable testing with CTest and GTest" OFF) option(asan "Build ROOT with address sanitizer instrumentation (see core/sanitizer for details)" OFF) option(_wheel_build "ROOT is being packaged as a wheel, do not install .dist-info metadata" OFF) From 1427fc1e93623ba45171ab9f1604760279ab13c6 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 17:08:23 +0200 Subject: [PATCH 10/21] [cmake] clarify error message for each option as suggested by pcanal --- cmake/modules/RootBuildOptions.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 6ef25613bdfa8..a3f01e9327b6f 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -336,11 +336,13 @@ endif() ROOT_APPLY_OPTIONS() #---roottest/rootbench options require testing -if(roottest OR rootbench) - if (NOT testing) - message(SEND_ERROR "-Droottest=ON or -Drootbench=ON requires -Dtesting=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=ON) - endif() +if (roottest AND NOT testing) + message(SEND_ERROR "-Droottest=ON requires -Dtesting=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=ON) +endif() +if (rootbench AND NOT testing) + message(SEND_ERROR "-Drootbench=ON requires -Dtesting=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dtesting=ON) endif() #---running HS3 test suite requires both testing and pyroot, but testing globally disables tests From c7210c57f43f6e6ddb2650f5e6b53b61377a1074 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 12:24:14 +0200 Subject: [PATCH 11/21] [cmake] Centralize connectivity call within ROOT_FIND_REQUIRED_DEP --- .../buildconfig/alma10-minimal.txt | 1 + cmake/modules/RootBuildOptions.cmake | 46 ++++++ cmake/modules/SearchInstalledSoftware.cmake | 147 ++++-------------- math/vecops/CMakeLists.txt | 2 +- roofit/batchcompute/CMakeLists.txt | 2 +- 5 files changed, 75 insertions(+), 123 deletions(-) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt index eebec3b02395e..58f9b4c8921b9 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-minimal.txt @@ -6,3 +6,4 @@ fail-on-missing=ON minimal=ON roottest=ON testing=ON +vdt=ON diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index a3f01e9327b6f..df5af6562a350 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -308,6 +308,10 @@ if(builtin_openssl AND NOT APPLE) message(FATAL_ERROR ">>> Option 'builtin_openssl' is only supported on macOS.") endif() +if(WINDOWS AND NOT shared) + message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") +endif() + #---Options depending of CMake Generator------------------------------------------------------- if( CMAKE_GENERATOR STREQUAL Ninja) set(fortran_defvalue OFF) @@ -335,6 +339,48 @@ endif() #---Define at moment the options with the selected default values------------------------------ ROOT_APPLY_OPTIONS() +# builtins require feature +if (builtin_fftw3 AND NOT fftw3) + message(SEND_ERROR "-Dbuiltin_fftw3=ON requires -Dfftw3=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dfftw3=ON) +endif() +if (builtin_xrootd AND NOT xrootd) + message(SEND_ERROR "-Dbuiltin_xrootd=ON requires -Dxrootd=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=ON) +endif() +if (builtin_cfitsio AND NOT fitsio) + message(SEND_ERROR "-Dbuiltin_cfitsio=ON requires -Dfitsio=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dfitsio=ON) +endif() +if (builtin_gl2ps AND NOT opengl) + message(SEND_ERROR "-Dbuiltin_gl2ps=ON requires -Dopengl=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=ON) +endif() +if (builtin_ftgl AND NOT opengl) + message(SEND_ERROR "-Dbuiltin_ftgl=ON requires -Dopengl=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=ON) +endif() +if (builtin_tbb AND NOT imt) + message(SEND_ERROR "-Dbuiltin_tbb=ON requires -Dimt=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dimt=ON) +endif() +if (builtin_vdt AND NOT vdt) + message(SEND_ERROR "-Dbuiltin_vdt=ON requires -Dvdt=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dvdt=ON) +endif() +if (builtin_gtest AND NOT (testing OR testsupport)) + message(SEND_ERROR "-Dbuiltin_gtest=ON requires -Dtesting=ON or -Dtestsupport=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dtestsupport=ON) +endif() +if(builtin_openui5 AND NOT webgui) + message(SEND_ERROR "-Dbuiltin_openui5=ON requires -Dwebgui=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dwebgui=ON) +endif() +if (builtin_openssl AND NOT ssl) + message(SEND_ERROR "-Dbuiltin_openssl=ON requires -Dssl=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dssl=ON) +endif() + #---roottest/rootbench options require testing if (roottest AND NOT testing) message(SEND_ERROR "-Droottest=ON requires -Dtesting=ON") diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index c2cedd4680610..7f9070001b236 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -67,7 +67,6 @@ if(clad AND NOT DEFINED CLAD_SOURCE_DIR) ROOT_CHECK_CONNECTION("clad") if(NO_CONNECTION) message(SEND_ERROR "No internet connection, check it or disable the 'clad' option") - list(APPEND MISSING_PACKAGES 'clad') list(APPEND HOTFIX_BUILD_FLAGS -Dclad=OFF) endif() endif() @@ -102,6 +101,13 @@ macro(ROOT_FIND_REQUIRED_DEP PACKAGE_NAME BUILTIN_CONFIG_OPTION) list(APPEND MISSING_PACKAGES ${PACKAGE_NAME}) list(APPEND HOTFIX_BUILD_FLAGS -D${BUILTIN_CONFIG_OPTION}=ON) endif() + else() + ROOT_CHECK_CONNECTION("${BUILTIN_CONFIG_OPTION}=ON") + if(NO_CONNECTION) + message(SEND_ERROR "No internet connection, check it or set -D${BUILTIN_CONFIG_OPTION}=OFF") + list(APPEND MISSING_PACKAGES '${PACKAGE_NAME}') + list(APPEND HOTFIX_BUILD_FLAGS -D${BUILTIN_CONFIG_OPTION}=OFF) + endif() endif() endmacro() @@ -141,9 +147,6 @@ ROOT_FIND_REQUIRED_DEP(Freetype builtin_freetype) # needed for asimage, but also if(opengl) ROOT_FIND_REQUIRED_DEP(gl2ps builtin_gl2ps) ROOT_FIND_REQUIRED_DEP(FTGL builtin_ftgl) -elseif(builtin_ftgl) - message(SEND_ERROR "FTGL features enabled with \"builtin_ftgl=ON\" require \"opengl=ON\"") - list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=ON) endif() if(webgui AND root7 AND geom) ROOT_FIND_REQUIRED_DEP(OpenGL builtin_glu) @@ -166,14 +169,6 @@ if(ssl) list(APPEND MISSING_PACKAGES 'OpenSSL') list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openssl=ON) endif() - else() - ROOT_CHECK_CONNECTION("builtin_openssl=OFF") - if(NO_CONNECTION) - message(SEND_ERROR "No internet connection, disable the 'ssl' and 'builtin_openssl' options") - list(APPEND MISSING_PACKAGES 'OpenSSL') - list(APPEND HOTFIX_BUILD_FLAGS -Dssl=OFF) - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openssl=OFF) - endif() endif() else() find_package(OpenSSL COMPONENTS SSL) @@ -250,8 +245,10 @@ elseif(builtin_tbb) list(APPEND HOTFIX_BUILD_FLAGS -Dimt=ON) endif() -# Double package name call, needs special manual treatment, cannot call ROOT_FIND_REQUIRED_DEP: -if(NOT builtin_pcre) +if(builtin_pcre) + ROOT_FIND_REQUIRED_DEP(PCRE2 builtin_pcre) +else() + # Double package name call, needs special manual treatment, cannot call ROOT_FIND_REQUIRED_DEP: message(STATUS "Looking for PCRE") # Clear cache before calling find_package(PCRE), # necessary to be able to toggle builtin_pcre and @@ -266,26 +263,15 @@ if(NOT builtin_pcre) message(SEND_ERROR "The required package PCRE2 was not found. " "Please install it in the system (preferred), set the corresponding CMake search variable, " "or opt in to downloading and auto-build it from externally provided source tarball using '-Dbuiltin_pcre=ON'.") - list(APPEND MISSING_PACKAGES PCRE2) + list(APPEND MISSING_PACKAGES 'PCRE2') list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_pcre=ON) endif() endif() endif() if(mathmore OR (tmva-cpu AND use_gsl_cblas)) - if(builtin_gsl) - ROOT_CHECK_CONNECTION("builtin_gsl") - if(NO_CONNECTION) - message(SEND_ERROR "No internet connection, check it or disable the 'builtin_gsl' option") - list(APPEND MISSING_PACKAGES 'GSL') - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_gsl=OFF) - endif() - endif() - message(STATUS "Looking for GSL") ROOT_FIND_REQUIRED_DEP(GSL builtin_gsl 1.10) - if(NOT builtin_gsl) - if(NOT GSL_FOUND) - message(SEND_ERROR "GSL package not found and 'mathmore' or 'tmva-cpu' and 'use_gsl_cblas' component is required. Either disable those, or enable the option 'builtin_gsl'") - endif() + if(NOT builtin_gsl AND NOT GSL_FOUND) + message(SEND_ERROR "GSL package not found and 'mathmore' or 'tmva-cpu' and 'use_gsl_cblas' component requires it. Either disable those, or enable the option 'builtin_gsl'") endif() endif() ROOT_FIND_REQUIRED_DEP(mathtext builtin_mathtext) @@ -318,13 +304,8 @@ set(CMAKE_FIND_FRAMEWORK LAST) #---If -Dshared=Off, prefer static libraries----------------------------------------- if(NOT shared) - if(WINDOWS) - message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") - list(APPEND HOTFIX_BUILD_FLAGS -Dshared=ON) - else() - message("Preferring static libraries.") - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;${CMAKE_FIND_LIBRARY_SUFFIXES}") - endif() + message("Preferring static libraries.") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;${CMAKE_FIND_LIBRARY_SUFFIXES}") endif() #---Check for Zlib ------------------------------------------------------------------ @@ -678,40 +659,14 @@ if(pythia8) endif() #---Check for FFTW3------------------------------------------------------------------- -if(builtin_fftw3) - ROOT_CHECK_CONNECTION("builtin_fftw3") - if(NO_CONNECTION) - message(SEND_ERROR "No internet connection, check it or disable the 'builtin_fftw3' option") - list(APPEND MISSING_PACKAGES 'fftw3') - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_fftw3=OFF) - endif() -endif() -if(builtin_fftw3) +if(fftw3 AND builtin_fftw3) add_subdirectory(builtins/fftw3) - if (NOT fftw3) - message(SEND_ERROR "builtin_fftw3=ON is incompatible with fftw3=OFF. Set -Dfftw3=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dfftw3=ON) - endif() endif() #---Check for fitsio------------------------------------------------------------------- -if(fitsio OR builtin_cfitsio) - if(builtin_cfitsio) - ROOT_CHECK_CONNECTION("builtin_cfitsio") - if(NO_CONNECTION) - message(SEND_ERROR "No internet connection, check it or disable the 'builtin_cfitsio' option") - list(APPEND MISSING_PACKAGES 'CFITSIO') - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_cfitsio=OFF) - endif() - endif() - if(builtin_cfitsio) - add_library(CFITSIO::CFITSIO STATIC IMPORTED GLOBAL) - add_subdirectory(builtins/cfitsio) - if(NOT fitsio) - message(SEND_ERROR "builtin_cfitsio=ON is incompatible with fitsio=OFF. Set -Dfitsio=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dfitsio=ON) - endif() - endif() +if(fitsio AND builtin_cfitsio) + add_library(CFITSIO::CFITSIO STATIC IMPORTED GLOBAL) + add_subdirectory(builtins/cfitsio) endif() #---Check Shadow password support---------------------------------------------------- @@ -738,19 +693,8 @@ if(xrootd AND NOT builtin_xrootd) endif() endif() -if(builtin_xrootd) - ROOT_CHECK_CONNECTION("builtin_xrootd=OFF") - if(NO_CONNECTION) - message(SEND_ERROR "No internet connection. Please check your connection, or disable the 'builtin_xrootd'" - " option and 'xrootd' options.") - list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=OFF) - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_xrootd=OFF) - endif() +if(xrootd AND builtin_xrootd) add_subdirectory(builtins/xrootd) - if (NOT xrootd) - message(SEND_ERROR "builtin_xrootd=ON is incompatible with xrootd=OFF (${xrootd_description}). Set xrootd=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dxrootd=ON) - endif() endif() # Backward compatibility for XRootD Date: Mon, 24 Aug 2026 12:34:14 +0200 Subject: [PATCH 12/21] [cmake] rm intermerdiate sync point as requested by hageboeck --- cmake/modules/SearchInstalledSoftware.cmake | 26 ++------------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 7f9070001b236..07a9971f73413 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -274,30 +274,8 @@ if(mathmore OR (tmva-cpu AND use_gsl_cblas)) message(SEND_ERROR "GSL package not found and 'mathmore' or 'tmva-cpu' and 'use_gsl_cblas' component requires it. Either disable those, or enable the option 'builtin_gsl'") endif() endif() -ROOT_FIND_REQUIRED_DEP(mathtext builtin_mathtext) - -if(NOT "${MISSING_PACKAGES}" STREQUAL "") - list(REMOVE_DUPLICATES MISSING_PACKAGES) - message(SEND_ERROR "The following packages need to be installed system-wide to build ROOT: ${MISSING_PACKAGES}") -endif() -if(NOT "${HOTFIX_BUILD_FLAGS}" STREQUAL "") - list(REMOVE_DUPLICATES HOTFIX_BUILD_FLAGS) - set(HOTFIX_BUILD_FLAGS_MESSAGE "Alternatively, a hotfix would be to add these flags to your CMake call:\n") - foreach(_item IN LISTS HOTFIX_BUILD_FLAGS) - string(APPEND HOTFIX_BUILD_FLAGS_MESSAGE " ${_item} \\\n") - endforeach() - - # Remove final trailing backslash and newline - string(REGEX REPLACE "\\\\\n$" "" HOTFIX_BUILD_FLAGS_MESSAGE "${HOTFIX_BUILD_FLAGS_MESSAGE}") - - message(FATAL_ERROR "${HOTFIX_BUILD_FLAGS_MESSAGE}") -endif() - -# Now that builtins have passed this synchronization point, let's collect in a second pass -# additional error messages that can appear when using contradictory flags -unset(MISSING_PACKAGES) -unset(HOTFIX_BUILD_FLAGS_MESSAGE) +ROOT_FIND_REQUIRED_DEP(mathtext builtin_mathtext) #---On MacOSX, try to find frameworks after standard libraries or headers------------ set(CMAKE_FIND_FRAMEWORK LAST) @@ -1274,7 +1252,7 @@ if(NOT "${MISSING_PACKAGES}" STREQUAL "") endif() if(NOT "${HOTFIX_BUILD_FLAGS}" STREQUAL "") list(REMOVE_DUPLICATES HOTFIX_BUILD_FLAGS) - set(HOTFIX_BUILD_FLAGS_MESSAGE "Alternatively, a hotfix would be to add these flags to your CMake call:\n") + set(HOTFIX_BUILD_FLAGS_MESSAGE "Alternatively, especially if you don't have Internet connection or admin rights, a hotfix would be to add these flags to your CMake call:\n") foreach(_item IN LISTS HOTFIX_BUILD_FLAGS) string(APPEND HOTFIX_BUILD_FLAGS_MESSAGE " ${_item} \\\n") From 7eeb87472c85513d64719c00afa947a9ebd4c196 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 13:03:15 +0200 Subject: [PATCH 13/21] [cmake] x11 asimage checks centralize --- cmake/modules/RootBuildOptions.cmake | 24 +++++++++++++++++ cmake/modules/SearchInstalledSoftware.cmake | 30 +-------------------- math/vecops/CMakeLists.txt | 2 +- roofit/batchcompute/CMakeLists.txt | 2 +- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index df5af6562a350..9b4e36e582192 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -380,6 +380,30 @@ if (builtin_openssl AND NOT ssl) message(SEND_ERROR "-Dbuiltin_openssl=ON requires -Dssl=ON") list(APPEND HOTFIX_BUILD_FLAGS -Dssl=ON) endif() +# On Linux, OpenGL should be working only with x11 +if(NOT WIN32 AND NOT APPLE) + if(opengl AND NOT x11) + message(SEND_ERROR "OpenGL requires x11 on Linux, either disable opengl or set -Dx11=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dopengl=OFF) + endif() +endif() +#---Check for Cocoa/Quartz graphics backend (MacOS X only)--------------------------- +# Note that this check happens *after* the above check for FreeType because that +# library is needed for builds on Apple with Cocoa graphics +if(cocoa) + if(APPLE) + if (x11) + message(SEND_ERROR "x11 (${x11_description}) and cocoa cannot be enabled simultaneously. Set -Dcocoa=OFF") + list(APPEND HOTFIX_BUILD_FLAGS -Dcocoa=OFF) + endif() + else() + message(SEND_ERROR "Cocoa option can only be enabled on MacOSX platform. Set -Dcocoa=OFF") + list(APPEND HOTFIX_BUILD_FLAGS -Dcocoa=OFF) + endif() +elseif(asimage AND NOT x11 AND NOT WIN32) + message(SEND_ERROR "asimage on Unix requires x11, either disable asimage or set -Dx11=ON") + list(APPEND HOTFIX_BUILD_FLAGS -Dasimage=OFF) +endif() #---roottest/rootbench options require testing if (roottest AND NOT testing) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 07a9971f73413..83cefea934211 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -337,21 +337,6 @@ elseif(NOT Freetype_VERSION AND FREETYPE_VERSION_STRING) set(Freetype_VERSION ${FREETYPE_VERSION_STRING}) endif() -#---Check for Cocoa/Quartz graphics backend (MacOS X only)--------------------------- -# Note that this check happens *after* the above check for FreeType because that -# library is needed for builds on Apple with Cocoa graphics -if(cocoa) - if(APPLE) - if (x11) - message(SEND_ERROR "x11 (${x11_description}) and cocoa cannot be enabled simultaneously. Set -Dx11=OFF") - list(APPEND HOTFIX_BUILD_FLAGS -Dx11=OFF) - endif() - else() - message(SEND_ERROR "Cocoa option can only be enabled on MacOSX platform. Set -Dcocoa=OFF") - list(APPEND HOTFIX_BUILD_FLAGS -Dcocoa=OFF) - endif() -endif() - #---Check for PCRE------------------------------------------------------------------- if(builtin_pcre) add_subdirectory(builtins/pcre) @@ -398,12 +383,6 @@ if(x11) endif() #---Check for all kind of graphics includes needed by libAfterImage-------------------- -if(asimage) - if(NOT x11 AND NOT cocoa AND NOT WIN32) - message(SEND_ERROR "'asimage' needs either 'x11' or 'cocoa' enabled. Set -Dasimage=OFF") - list(APPEND HOTFIX_BUILD_FLAGS -Dasimage=OFF) - endif() -endif() if(asimage) if(builtin_gif) @@ -505,14 +484,7 @@ if(opengl OR cocoa) endif() endif() endif() -# OpenGL should be working only with x11 (Linux), -# in case when -Dall=ON -Dx11=OFF, we will just disable opengl. -if(NOT WIN32 AND NOT APPLE) - if(opengl AND NOT x11) - message(SEND_ERROR "OpenGL requires x11 on Linux, either disable opengl or set -Dx11=ON") - list(APPEND HOTFIX_BUILD_FLAGS -Dx11=ON) - endif() -endif() + # The opengl flag enables the graf3d features that depend on OpenGL, and these # features also depend on asimage. Therefore, the configuration will fail if # asimage is off. See also: https://github.com/root-project/root/issues/16250 diff --git a/math/vecops/CMakeLists.txt b/math/vecops/CMakeLists.txt index 7e31f821d7694..e61910878ec69 100644 --- a/math/vecops/CMakeLists.txt +++ b/math/vecops/CMakeLists.txt @@ -19,7 +19,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTVecOps Core ) -if(builtin_vdt AND vdt) +if(vdt) target_link_libraries(ROOTVecOps PRIVATE VDT::VDT) endif() diff --git a/roofit/batchcompute/CMakeLists.txt b/roofit/batchcompute/CMakeLists.txt index 8a826d820bb37..54e9a1f21ce5b 100644 --- a/roofit/batchcompute/CMakeLists.txt +++ b/roofit/batchcompute/CMakeLists.txt @@ -203,7 +203,7 @@ if (cuda) endif() endif() -if(vdt AND builtin_vdt) +if(vdt) foreach(library RooBatchCompute_GENERIC RooBatchCompute_SSE4.1 RooBatchCompute_AVX RooBatchCompute_AVX2 RooBatchCompute_AVX512 ) if(TARGET ${library}) target_link_libraries(${library} PRIVATE VDT::VDT) From da7653ecb5f2860db19f17056389daaa0efd1741 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Fri, 28 Aug 2026 08:40:45 +0200 Subject: [PATCH 14/21] [cmake] fix typo in CMake variable name see https://cmake.org/cmake/help/latest/variable/WIN32.html --- 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 9b4e36e582192..28da6e476d204 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -308,7 +308,7 @@ if(builtin_openssl AND NOT APPLE) message(FATAL_ERROR ">>> Option 'builtin_openssl' is only supported on macOS.") endif() -if(WINDOWS AND NOT shared) +if(WIN32 AND NOT shared) message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") endif() From 68b3bb202bf506dedf34855709473ef353148c01 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sat, 5 Sep 2026 08:23:38 +0200 Subject: [PATCH 15/21] [ci] add flags to asan build --- .github/workflows/root-ci-config/buildconfig/alma10-asan.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt b/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt index 98aad2c25685c..34b830b1b9027 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt @@ -4,9 +4,11 @@ ccache=ON builtin_civetweb=ON builtin_vdt=ON ccache=ON +daos_mock=ON fail-on-missing=ON minimal=ON roottest=ON testing=ON +vdt=ON LSAN_OPTIONS=verbosity=1:log_threads=1 ROOT_CTEST_CUSTOM_FLAGS=-E \(gtest-core-metacling-TClingTest$\|roottest-cling-specialobj-runf02$\|roottest-root-collection-DeleteWarning$\|roottest-root-io-evolution-fixarr2$\|roottest-root-meta-rlibmap$\|roottest-root-tree-cloning-runtreeCloneTest2$\|roottest-root-treeproxy-vectorint-vectorint$\) From e607ec6b429eaa755fe6d63c0dd988ed6aab1d76 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:08:16 +0200 Subject: [PATCH 16/21] [macos] do not forceenable libcxx --- cmake/modules/SetUpMacOS.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake index 73297065cd08e..7fc682d0f92ca 100644 --- a/cmake/modules/SetUpMacOS.cmake +++ b/cmake/modules/SetUpMacOS.cmake @@ -10,7 +10,10 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin) MESSAGE(STATUS "Found a macOS system") if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang) - set(libcxx ON CACHE BOOL "Build using libc++" FORCE) + if (NOT libcxx) + message(SEND_ERROR "libcxx=ON is needed for Clang compilers") + list(APPEND HOTFIX_BUILD_FLAGS -Dlibcxx=ON) + endif() endif() #TODO: check haveconfig and rpath -> set rpath true From 698ad63b758117088975f7335c386314c92b3132 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:10:10 +0200 Subject: [PATCH 17/21] change libcxx default value to ON for mac+clang --- cmake/modules/RootBuildOptions.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 28da6e476d204..a9d3f59e40500 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -301,6 +301,9 @@ if(WIN32) elseif(APPLE) set(cocoa_defvalue ON) set(x11_defvalue OFF) + if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang) + set(libcxx_defvalue ON) + endif() endif() # builtin_openssl is only supported on macOS From 93ae4cb6062ce5a9b40a33f80a366d2eab44cc64 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:14:09 +0200 Subject: [PATCH 18/21] [libcxx] do not silently force-OFF on Linux but rather error out Was hit again by it on my local build --- cmake/modules/CheckCompiler.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index 2590fba0da006..3aeabf3401d89 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -207,8 +207,8 @@ endif() if(libcxx) CHECK_CXX_COMPILER_FLAG("-stdlib=libc++" HAS_LIBCXX11) if(NOT HAS_LIBCXX11) - message(STATUS "Current compiler does not support -stdlib=libc++ option. Switching OFF libcxx option") - set(libcxx OFF CACHE BOOL "" FORCE) + message(SEND_ERROR "Current compiler does not support -stdlib=libc++ option. Set -Dlibcxx=OFF") + list(APPEND HOTFIX_BUILD_FLAGS -Dlibcxx=OFF) endif() endif() From 03c9523fa33df9dbdd1ed8fe43b49ba253a5f2db Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:15:28 +0200 Subject: [PATCH 19/21] [nfc] improve error message --- cmake/modules/CheckCompiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index 3aeabf3401d89..b4cf76c50d839 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -207,7 +207,7 @@ endif() if(libcxx) CHECK_CXX_COMPILER_FLAG("-stdlib=libc++" HAS_LIBCXX11) if(NOT HAS_LIBCXX11) - message(SEND_ERROR "Current compiler does not support -stdlib=libc++ option. Set -Dlibcxx=OFF") + message(SEND_ERROR "Current compiler ${CMAKE_CXX_COMPILER_ID} does not support -stdlib=libc++ option. Install compatible compiler or set -Dlibcxx=OFF") list(APPEND HOTFIX_BUILD_FLAGS -Dlibcxx=OFF) endif() endif() From 538074e4c625d37e76c200f1c034e7e65c56d22f Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:27:13 +0200 Subject: [PATCH 20/21] [ci] explicit libcxx --- .github/workflows/root-ci-config/buildconfig/mac-beta.txt | 1 + .github/workflows/root-ci-config/buildconfig/mac14.txt | 1 + .github/workflows/root-ci-config/buildconfig/mac15.txt | 1 + .github/workflows/root-ci-config/buildconfig/mac26.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/root-ci-config/buildconfig/mac-beta.txt b/.github/workflows/root-ci-config/buildconfig/mac-beta.txt index d30211cae244e..7c408e04fcab0 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac-beta.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac-beta.txt @@ -21,5 +21,6 @@ builtin_zstd=ON check_connection=ON cocoa=ON davix=OFF +libcxx=ON minuit2_omp=OFF x11=OFF diff --git a/.github/workflows/root-ci-config/buildconfig/mac14.txt b/.github/workflows/root-ci-config/buildconfig/mac14.txt index edeb1d24f4a0c..e6a552157fa9e 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac14.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac14.txt @@ -23,6 +23,7 @@ builtin_xxhash=ON builtin_zstd=ON cocoa=ON davix=OFF +libcxx=ON minuit2_omp=OFF test_distrdf_dask=OFF test_distrdf_pyspark=OFF diff --git a/.github/workflows/root-ci-config/buildconfig/mac15.txt b/.github/workflows/root-ci-config/buildconfig/mac15.txt index ac9bdf90fed0c..ab4e9151e8e37 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac15.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac15.txt @@ -20,5 +20,6 @@ builtin_xxhash=ON builtin_zstd=ON cocoa=ON davix=OFF +libcxx=ON minuit2_omp=OFF x11=OFF diff --git a/.github/workflows/root-ci-config/buildconfig/mac26.txt b/.github/workflows/root-ci-config/buildconfig/mac26.txt index d30211cae244e..7c408e04fcab0 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac26.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac26.txt @@ -21,5 +21,6 @@ builtin_zstd=ON check_connection=ON cocoa=ON davix=OFF +libcxx=ON minuit2_omp=OFF x11=OFF From a75c324685e3ab6c089a6d7f62dda8dfacc65090 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 10 Sep 2026 10:47:25 +0200 Subject: [PATCH 21/21] [cmake] mv check to right place after defvalue platform override --- cmake/modules/RootBuildOptions.cmake | 7 +++++++ cmake/modules/SetUpMacOS.cmake | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index a9d3f59e40500..55aaa8e825b56 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -342,6 +342,13 @@ endif() #---Define at moment the options with the selected default values------------------------------ ROOT_APPLY_OPTIONS() +if(APPLE AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang) + if (NOT libcxx) + message(SEND_ERROR "libcxx=ON is needed for Clang compilers on Apple") + list(APPEND HOTFIX_BUILD_FLAGS -Dlibcxx=ON) + endif() +endif() + # builtins require feature if (builtin_fftw3 AND NOT fftw3) message(SEND_ERROR "-Dbuiltin_fftw3=ON requires -Dfftw3=ON") diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake index 7fc682d0f92ca..7dd4fbf8020c2 100644 --- a/cmake/modules/SetUpMacOS.cmake +++ b/cmake/modules/SetUpMacOS.cmake @@ -9,13 +9,6 @@ set(ROOT_PLATFORM macosx) if (CMAKE_SYSTEM_NAME MATCHES Darwin) MESSAGE(STATUS "Found a macOS system") - if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang) - if (NOT libcxx) - message(SEND_ERROR "libcxx=ON is needed for Clang compilers") - list(APPEND HOTFIX_BUILD_FLAGS -Dlibcxx=ON) - endif() - endif() - #TODO: check haveconfig and rpath -> set rpath true #TODO: check Thread, define link command #TODO: more stuff check configure script