From 311171317ef44af8941ce256e3abf0d8b32ecb2e Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 10:47:21 +0200 Subject: [PATCH 01/15] [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 | 353 +++++++++++++------- gui/qt6webdisplay/CMakeLists.txt | 6 - 5 files changed, 232 insertions(+), 132 deletions(-) diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index 28bc71a175208..65481023d2642 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -45,6 +45,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 method `RooRealVar::removeRange()` and the corresponding method in `RooErrorVar` that were deprecated in ROOT 6.40 are now removed. * The overloads of `RooAbsReal::createChi2()` and `RooAbsReal::chi2FitTo()` that take unbinned **RooDataSet** data objects were deprecated in ROOT 6.40 and are now removed. * The **RooStats::HybridPlot** class and the related **HybridResult::GetPlot** method were deprecated in ROOT 6.40 and 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 be3b19988076d..379d579e9f545 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -157,7 +157,7 @@ ROOT_BUILD_OPTION(roofit_multiprocess OFF "Build RooFit::MultiProcess and multi- 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 67aa8431fcaf4..5bb89709c111a 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,19 +1137,26 @@ if (roofit_multiprocess) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG_ORIGINAL_VALUE ${CMAKE_FIND_PACKAGE_PREFER_CONFIG}) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) - # The fail-on-missing branching is not implemented, and we always look for - # ZeroMQ and cppzmq with REQUIRED to fail configuration if not available. - # That's because the roofit_multiprocess option can only be deliberately - # enabled by the user with roofit_multiprocess=ON, in which case it would - # be frustrating to get it auto-disabled on missing dependencies. - find_package(ZeroMQ 4.3.5 REQUIRED) + # We always look for ZeroMQ and cppzmq with REQUIRED to fail configuration if not available. + find_package(ZeroMQ 4.3.5) + if (NOT ZeroMQ_FOUND) + message(SEND_ERROR "ZeroMQ not found. Install it or disable option 'roofit_multiprocess'") + list(APPEND MISSING_PACKAGES 'ZeroMQ') + list(APPEND HOTFIX_BUILD_FLAGS '-Droofit_multiprocess=OFF') + endif() # Reset default find_package mode set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ${CMAKE_FIND_PACKAGE_PREFER_CONFIG_ORIGINAL_VALUE}) unset(CMAKE_FIND_PACKAGE_PREFER_CONFIG_ORIGINAL_VALUE) message(STATUS "Looking for ZeroMQ C++ bindings (cppzmq)") - find_package(cppzmq REQUIRED) + find_package(cppzmq) + if (NOT cppzmq_FOUND) + message(SEND_ERROR "cppzmq not found. Install it or disable option 'roofit_multiprocess'") + list(APPEND MISSING_PACKAGES 'cppzmq') + list(APPEND HOTFIX_BUILD_FLAGS '-Droofit_multiprocess=OFF') + endif() + endif (roofit_multiprocess) #---Check for googletest--------------------------------------------------------------- @@ -1098,10 +1164,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() @@ -1112,7 +1176,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. @@ -1278,12 +1344,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 b4bc397354ccdafebe8c19f4a621309f8e0704b8 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 11:33:35 +0200 Subject: [PATCH 02/15] [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 5bb89709c111a..dd6797317cd75 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -966,6 +966,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 8aa9aaf69fd0e55488163b057687398be97d885d Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 11:53:09 +0200 Subject: [PATCH 03/15] [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 0d83e5d28d4e6..32d1ea301cf2c 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -38,6 +38,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 379d579e9f545..ce6c92322517f 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -122,6 +122,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 c80bebaabfc6a4c422a38131b302500903d2d03c Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 12:20:34 +0200 Subject: [PATCH 04/15] [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 e6400a2d19e62..8c811f9a409a2 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -406,7 +406,7 @@ jobs: overrides: ["CMAKE_BUILD_TYPE=Debug"] - image: alma10 - image: ubuntu22 - 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 10e825e473f2aa42a92466e801393f233f23fd62 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 16:40:17 +0200 Subject: [PATCH 05/15] [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 ce6c92322517f..6976400495f9d 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -337,45 +337,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 9c5e9f685969abf808ef55b35886d46a04e4a97b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 18 Aug 2026 17:36:26 +0200 Subject: [PATCH 06/15] [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 32d1ea301cf2c..dd8dc757af6b9 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -84,6 +84,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 6976400495f9d..1ddf8dc3728ca 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -340,7 +340,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() @@ -348,8 +348,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 d26ac2195ea86a3170ce1454990480c88dc1e779 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 09:08:21 +0200 Subject: [PATCH 07/15] [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 | 160 +++++++++++--------- 3 files changed, 96 insertions(+), 86 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 1ddf8dc3728ca..ba9406d29a7b5 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -341,8 +341,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() @@ -350,42 +350,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 dd6797317cd75..2d6674f995555 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() @@ -100,7 +100,7 @@ macro(ROOT_FIND_REQUIRED_DEP PACKAGE_NAME BUILTIN_CONFIG_OPTION) "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 '-D${BUILTIN_CONFIG_OPTION}=ON'.") list(APPEND MISSING_PACKAGES ${PACKAGE_NAME}) - list(APPEND HOTFIX_BUILD_FLAGS '-D${BUILTIN_CONFIG_OPTION}=ON') + list(APPEND HOTFIX_BUILD_FLAGS -D${BUILTIN_CONFIG_OPTION}=ON) endif() endif() endmacro() @@ -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() @@ -811,7 +812,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() @@ -834,7 +835,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() @@ -842,24 +843,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) @@ -867,7 +868,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) @@ -875,7 +877,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() @@ -892,7 +894,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() @@ -904,7 +907,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() @@ -921,7 +925,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() @@ -933,7 +937,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) @@ -962,7 +966,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() @@ -970,7 +974,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)------------------------------- @@ -983,7 +987,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() @@ -991,10 +995,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) @@ -1005,7 +1009,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() @@ -1016,7 +1020,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) @@ -1042,14 +1048,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 @@ -1068,7 +1074,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() endif() @@ -1077,21 +1083,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) @@ -1104,7 +1110,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() @@ -1116,7 +1122,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() @@ -1129,7 +1135,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() @@ -1149,7 +1155,7 @@ if (roofit_multiprocess) if (NOT ZeroMQ_FOUND) message(SEND_ERROR "ZeroMQ not found. Install it or disable option 'roofit_multiprocess'") list(APPEND MISSING_PACKAGES 'ZeroMQ') - list(APPEND HOTFIX_BUILD_FLAGS '-Droofit_multiprocess=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Droofit_multiprocess=OFF) endif() # Reset default find_package mode @@ -1161,7 +1167,7 @@ if (roofit_multiprocess) if (NOT cppzmq_FOUND) message(SEND_ERROR "cppzmq not found. Install it or disable option 'roofit_multiprocess'") list(APPEND MISSING_PACKAGES 'cppzmq') - list(APPEND HOTFIX_BUILD_FLAGS '-Droofit_multiprocess=OFF') + list(APPEND HOTFIX_BUILD_FLAGS -Droofit_multiprocess=OFF) endif() endif (roofit_multiprocess) @@ -1172,7 +1178,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() @@ -1185,7 +1193,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. @@ -1355,7 +1365,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() @@ -1367,7 +1377,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() @@ -1376,7 +1386,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 47b0ba1683cc5ae5e25f39397caae642a71edf60 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 11:50:37 +0200 Subject: [PATCH 08/15] [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 ba9406d29a7b5..073a4df991bd2 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -165,7 +165,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)") @@ -337,20 +337,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 eec36a5afd3e5c4ead612efdfaaca3b0f46a0617 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 12:19:57 +0200 Subject: [PATCH 09/15] [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 dd8dc757af6b9..fd494342297de 100644 --- a/.github/workflows/root-ci-config/buildconfig/global.txt +++ b/.github/workflows/root-ci-config/buildconfig/global.txt @@ -84,7 +84,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 073a4df991bd2..c673abe616244 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -165,7 +165,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)") @@ -191,11 +191,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 9bba33ca0fc3e18912aba1ad6159f0cb7eadb38a Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 19 Aug 2026 17:08:23 +0200 Subject: [PATCH 10/15] [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 c673abe616244..3e7eb99852328 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -338,11 +338,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 7e1c0591f2485b8c0047fd7791adb9edeea0b738 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 12:24:14 +0200 Subject: [PATCH 11/15] [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 3e7eb99852328..89f075368e568 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -310,6 +310,10 @@ if(roofit_multiprocess AND WIN32) message(FATAL_ERROR ">>> Option 'roofit_multiprocess' is not supported on Windows.") 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) @@ -337,6 +341,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 2d6674f995555..be7b91b012dda 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() @@ -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/15] [cmake] rm intermerdiate sync point as requested by hageboeck --- cmake/modules/SearchInstalledSoftware.cmake | 26 +-------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index be7b91b012dda..472797a136036 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -275,30 +275,6 @@ if(mathmore OR (tmva-cpu AND use_gsl_cblas)) 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() - -# 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) @@ -1301,7 +1277,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 044480fc6a554c95a78340e3b77b5583bae8cf33 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 13:03:15 +0200 Subject: [PATCH 13/15] [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 89f075368e568..aaff9b9795ea6 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -382,6 +382,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 472797a136036..b1c869755bbd1 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -335,21 +335,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) @@ -396,12 +381,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) @@ -503,14 +482,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 6c33281ccb935..2e9056587b994 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 c2f1a8349e853d50e9153cac6a9111dd66c8c481 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Fri, 28 Aug 2026 08:40:45 +0200 Subject: [PATCH 14/15] [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 aaff9b9795ea6..a23b44bc99c1c 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -310,7 +310,7 @@ if(roofit_multiprocess AND WIN32) message(FATAL_ERROR ">>> Option 'roofit_multiprocess' is not supported on Windows.") endif() -if(WINDOWS AND NOT shared) +if(WIN32 AND NOT shared) message(FATAL_ERROR "Option \"shared=Off\" not supported on Windows!") endif() From cf1cdb17e40e802e5bedae15d2154d0a431da0af Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sat, 5 Sep 2026 08:23:38 +0200 Subject: [PATCH 15/15] [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 65f3fd63f791a..c40f124e99c32 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$\)"