diff --git a/.github/workflows/root-ci-config/buildconfig/alma8.txt b/.github/workflows/root-ci-config/buildconfig/alma8.txt deleted file mode 100644 index a057ed5fc6801..0000000000000 --- a/.github/workflows/root-ci-config/buildconfig/alma8.txt +++ /dev/null @@ -1 +0,0 @@ -root7=Off diff --git a/.github/workflows/root-ci-config/buildconfig/ubuntu18.txt b/.github/workflows/root-ci-config/buildconfig/ubuntu18.txt index 3baa852100e8e..9808d4c4e31ae 100644 --- a/.github/workflows/root-ci-config/buildconfig/ubuntu18.txt +++ b/.github/workflows/root-ci-config/buildconfig/ubuntu18.txt @@ -1,2 +1,2 @@ -CMAKE_CXX_STANDARD=14 +CMAKE_CXX_STANDARD=17 root7=OFF \ No newline at end of file diff --git a/cmake/modules/CheckCompiler.cmake b/cmake/modules/CheckCompiler.cmake index 015d74f52566d..3a2f5d387ff2d 100644 --- a/cmake/modules/CheckCompiler.cmake +++ b/cmake/modules/CheckCompiler.cmake @@ -123,10 +123,15 @@ else() OUTPUT_VARIABLE CXX_STANDARD_STRING ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - # if the above command fails to set the variable for any reason, let's default to 2011 with a warning + # if the above command fails to set the variable for any reason, let's default to 2017 with a warning if (NOT CXX_STANDARD_STRING) - message(WARNING "Could not detect the default C++ standard in use by the detected compiler (${CMAKE_CXX_COMPILER}). Falling back to C++14 as a default, can be overridden by setting CMAKE_CXX_STANDARD.") - set(CXX_STANDARD_STRING 2014) + message(WARNING "Could not detect the default C++ standard in use by the detected compiler (${CMAKE_CXX_COMPILER}). Falling back to C++17 as a default, can be overridden by setting CMAKE_CXX_STANDARD.") + set(CXX_STANDARD_STRING 2017) + endif() + # If the native compiler defaults to a C++ standard lower than 17, overwrite the default value + if (NOT ${CXX_STANDARD_STRING} STRGREATER "201402L") + message(STATUS "The default C++ standard in use by the detected compiler (${CMAKE_CXX_COMPILER}) is lower than C++17. Setting C++17 as the minimum standard.") + set(CXX_STANDARD_STRING 2017) endif() endif() # Lexicographically compare the value of __cplusplus (e.g. "201703L" for C++17) to figure out @@ -140,8 +145,8 @@ if (${CXX_STANDARD_STRING} STRGREATER "201703L") elseif(${CXX_STANDARD_STRING} STRGREATER "201402L") set(CXX_STANDARD_STRING 17 CACHE STRING "") else() - # We stick to C++14 as a minimum value - set(CXX_STANDARD_STRING 14 CACHE STRING "") + # We stick to C++17 as a minimum value + set(CXX_STANDARD_STRING 17 CACHE STRING "") endif() set(CMAKE_CXX_STANDARD ${CXX_STANDARD_STRING} CACHE STRING "") set(CMAKE_CXX_STANDARD_REQUIRED TRUE) @@ -164,8 +169,8 @@ if(cxx11 OR cxx14 OR cxx17) unset(cxx11 CACHE) endif() -if(NOT CMAKE_CXX_STANDARD MATCHES "14|17|20") - message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}") +if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") + message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}. Supported standards are: 17, 20.") endif() # needed by roottest, to be removed once roottest is fixed diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index 4caa8fc64d34d..9a7d3d96cbe43 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -369,11 +369,6 @@ foreach(opt ${root_build_options}) endif() endforeach() -#---ROOT 7 requires C++17 standard or higher--------------------------------------------------- -if(NOT CMAKE_CXX_STANDARD GREATER 14) - set(root7_defvalue OFF) -endif() - #---webgui by default always build together with root7----------------------------------------- set(webgui_defvalue ${root7_defvalue}) @@ -396,24 +391,6 @@ if (NOT builtin_cling) endif() endif(NOT builtin_cling) -if(root7) - if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++17 standard used with root7") - message(STATUS "Enabling C++17 for compilation of root7 components") - elseif(NOT CMAKE_CXX_STANDARD GREATER 14) - message(FATAL_ERROR ">>> At least C++17 standard required with root7, please enable it using CMake option: -DCMAKE_CXX_STANDARD=17") - endif() -endif() - -#---check if webgui can be built------------------------------- -if(webgui) - if(NOT CMAKE_CXX_STANDARD GREATER 11) - set(webgui OFF CACHE BOOL "(WebGUI requires at least C++14)" FORCE) - elseif(NOT http) - set(http ON CACHE BOOL "(Enabled since it's needed by webgui)" FORCE) - endif() -endif() - if(NOT webgui) set(qt5web OFF CACHE BOOL "Disabled because webgui not build" FORCE) set(qt6web OFF CACHE BOOL "Disabled because webgui not build" FORCE) diff --git a/core/foundation/inc/ROOT/RConfig.hxx b/core/foundation/inc/ROOT/RConfig.hxx index 5f53eb9f21c61..d09a1618225ee 100644 --- a/core/foundation/inc/ROOT/RConfig.hxx +++ b/core/foundation/inc/ROOT/RConfig.hxx @@ -44,10 +44,10 @@ # define R__NULLPTR # endif #else -# if defined(__cplusplus) && (__cplusplus < 201402L) -# error "ROOT requires support for C++14 or higher." +#if defined(__cplusplus) && (__cplusplus < 201703L) +#error "ROOT requires support for C++17 or higher." # if defined(__GNUC__) || defined(__clang__) -# error "Pass `-std=c++14` as compiler argument." +#error "Pass `-std=c++17` as compiler argument." # endif # endif #endif @@ -380,7 +380,7 @@ # define R__OLDHPACC # define R__TEMPLATE_OVERLOAD_BUG # define R__GLOBALSTL /* STL in global name space */ -# error "ROOT requires proper support for C++11 or higher" +#error "ROOT requires proper support for C++17 or higher" # else # define R__PLACEMENTDELETE /* supports overloading placement delete */ # define R__TMPLTSTREAM /* std::iostream implemented with templates */ diff --git a/core/meta/test/CMakeLists.txt b/core/meta/test/CMakeLists.txt index 66e1e41ce82fc..1a37c67acaa0a 100644 --- a/core/meta/test/CMakeLists.txt +++ b/core/meta/test/CMakeLists.txt @@ -6,9 +6,7 @@ ROOT_ADD_GTEST(testStatusBitsChecker testStatusBitsChecker.cxx LIBRARIES Core) ROOT_ADD_GTEST(testHashRecursiveRemove testHashRecursiveRemove.cxx LIBRARIES Core) -if(NOT MSVC OR win_broken_tests OR CMAKE_CXX_STANDARD GREATER 14) - ROOT_ADD_GTEST(testTClass testTClass.cxx LIBRARIES Core) -endif() +ROOT_ADD_GTEST(testTClass testTClass.cxx LIBRARIES Core) ROOT_ADD_GTEST(testTDataType testTDataType.cxx LIBRARIES Core) ROOT_ADD_GTEST(testTEnum testTEnum.cxx LIBRARIES Core) configure_file(stlDictCheck.h . COPYONLY) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index 3fd88b49d440a..e750480eb3f11 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -137,12 +137,12 @@ if(MSVC) __std_find_trivial_8 ) endif() - if(CMAKE_CXX_STANDARD GREATER 14) - set(cling_exports ${cling_exports} - _Smtx_lock_shared - _Smtx_unlock_shared - ) - endif() + + set(cling_exports ${cling_exports} + _Smtx_lock_shared + _Smtx_unlock_shared + ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(cling_exports ${cling_exports} ??2@YAPEAX_K@Z diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 84449d7cd3acf..7259f460e786a 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -106,12 +106,11 @@ elseif(MSVC AND NOT win_broken_tests) list(APPEND dataframe_veto dataframe/df016_vecOps.py) list(APPEND dataframe_veto dataframe/df017_vecOpsHEP.py) endif() - if(CMAKE_CXX_STANDARD GREATER 14) - list(APPEND dataframe_veto dataframe/df032_RDFFromNumpy.py) - list(APPEND dataframe_veto dataframe/df033_Describe.py) - else() - list(APPEND dataframe_veto dataframe/*.py) - endif() + + # Why do we need to veto these tutorials on Windows with C++17? + list(APPEND dataframe_veto dataframe/df032_RDFFromNumpy.py) + list(APPEND dataframe_veto dataframe/df033_Describe.py) + endif() if(NOT sqlite) @@ -150,9 +149,6 @@ if(NOT ROOT_roofit_FOUND) else() if(MSVC AND NOT win_broken_tests) set(roofit_veto roofit/rf401_importttreethx.py roofit/rf708_bphysics.py roofit/rf501_simultaneouspdf.py) - if(CMAKE_CXX_STANDARD LESS 17) - list(APPEND roofit_veto roofit/rf408_RDataFrameToRooFit.py) - endif() if(CMAKE_SIZEOF_VOID_P EQUAL 8) list(APPEND roofit_veto roofit/rf409_NumPyPandasToRooFit.py) endif() diff --git a/tutorials/v7/global_temperatures.cxx b/tutorials/v7/global_temperatures.cxx index 109297ca0356b..a2b4787b04eb5 100644 --- a/tutorials/v7/global_temperatures.cxx +++ b/tutorials/v7/global_temperatures.cxx @@ -1,10 +1,11 @@ /// \file /// \ingroup tutorial_v7 /// -/// This ROOT 7 example demonstrates how to use RNTuple in combination with ROOT 6 features like RDataframe and visualizations. -/// It ingests climate data and creates a model with fields like AverageTemperature. Then it uses RDataframe to process and filter the climate data for -/// average temperature per city by season. Then it does the same for average temperature per city for the years between 1993-2002, and 2003-2013. -/// Finally, the tutorial visualizes this processed data through histograms. +/// This ROOT 7 example demonstrates how to use RNTuple in combination with ROOT 6 features like RDataframe and +/// visualizations. It ingests climate data and creates a model with fields like AverageTemperature. Then it uses +/// RDataframe to process and filter the climate data for average temperature per city by season. Then it does the same +/// for average temperature per city for the years between 1993-2002, and 2003-2013. Finally, the tutorial visualizes +/// this processed data through histograms. /// /// TODO(jblomer): re-enable once issues are fixed (\macro_image (rcanvas_js)) /// \macro_code @@ -17,7 +18,7 @@ /// \warning The RNTuple classes are experimental at this point. /// Functionality, interface, and data format is still subject to changes. /// Do not use for real data! During ROOT setup, configure the following flags: -/// `-DCMAKE_CXX_STANDARD=14 -Droot7=ON -Dwebgui=ON` +/// `-DCMAKE_CXX_STANDARD=17 -Droot7=ON -Dwebgui=ON` /// /// \date 2021-02-26 /// \author John Yoon diff --git a/tutorials/webgui/qtweb/Readme.md b/tutorials/webgui/qtweb/Readme.md index ccddc5c3f1ac3..a7194c321b564 100644 --- a/tutorials/webgui/qtweb/Readme.md +++ b/tutorials/webgui/qtweb/Readme.md @@ -24,7 +24,7 @@ Compile ROOT with qt5web support in Release mode: cd C:\ mkdir root cd C:\root - cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 c:\git\root -Droot7=ON -DCMAKE_CXX_STANDARD=14 -Dwebgui=ON -Dqt5web=ON + cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 c:\git\root -Droot7=ON -DCMAKE_CXX_STANDARD=17 -Dwebgui=ON -Dqt5web=ON cmake --build . --config Release -- /maxcpucount Configure ROOT, create build directory and build qt5web tutorial: