From 83a524860d5a10d58f708e2f90100fed4968bb6e Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Mon, 26 May 2025 14:11:12 +0200 Subject: [PATCH 1/5] [AdaptiveCpp] Add adaptivecpp --- cmake/modules/RootBuildOptions.cmake | 1 + cmake/modules/SearchInstalledSoftware.cmake | 27 +++++ cmake/modules/SetupAdaptiveCpp.cmake | 116 ++++++++++++++++++++ interpreter/CMakeLists.txt | 7 ++ 4 files changed, 151 insertions(+) create mode 100644 cmake/modules/SetupAdaptiveCpp.cmake diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index c06e585264333..d50ab860fe09c 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -126,6 +126,7 @@ 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)") ROOT_BUILD_OPTION(dev OFF "Enable recommended developer compilation flags, reduce exposed includes") ROOT_BUILD_OPTION(distcc OFF "Enable distcc usage for speeding up builds (ccache is called first if enabled)") +ROOT_BUILD_OPTION(experimental_adaptivecpp OFF "Build AdaptiveCPP for SYCL support") ROOT_BUILD_OPTION(fcgi OFF "Enable FastCGI support in HTTP server") ROOT_BUILD_OPTION(fftw3 OFF "Enable support for FFTW3 [GPL]") ROOT_BUILD_OPTION(fitsio ON "Enable support for reading FITS images") diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 634a5f12fc25f..1b55661112eee 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1592,6 +1592,33 @@ if (vecgeom) endif() endif() +if(experimental_adaptivecpp) + # Building adaptivecpp requires an internet connection, if we're not side-loading the source directory + if(NOT DEFINED ADAPTIVECPP_SOURCE_DIR) + ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("experimental_adaptivecpp") + endif() + include(SetupAdaptiveCpp) + set(HIPSYCL_NO_FIBERS ON) + set(WITH_OPENCL_BACKEND OFF) + set(WITH_LEVEL_ZERO_BACKEND OFF) + + find_package(AdaptiveCpp REQUIRED) + if (AdaptiveCpp_FOUND) + set(sycl ON) + set(SYCL_COMPILER_FLAGS "-ffast-math ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE_UPPER}}") + message(STATUS "SYCL compiler flags: ${SYCL_COMPILER_FLAGS}") + separate_arguments(SYCL_COMPILER_FLAGS NATIVE_COMMAND ${SYCL_COMPILER_FLAGS}) + message(STATUS "AdaptiveCpp sycl enabled") + else() + if(fail-on-missing) + message(FATAL_ERROR "AdaptiveCpp library not found") + else() + message(STATUS "AdaptiveCpp library not found") + set(sycl OFF CACHE BOOL "Disabled because no SYCL implementation is not found" FORCE) + endif() + endif() +endif() + #---Check for protobuf------------------------------------------------------------------- if(tmva-sofie) diff --git a/cmake/modules/SetupAdaptiveCpp.cmake b/cmake/modules/SetupAdaptiveCpp.cmake new file mode 100644 index 0000000000000..6e9c87502a2bb --- /dev/null +++ b/cmake/modules/SetupAdaptiveCpp.cmake @@ -0,0 +1,116 @@ +message(STATUS "Building AdaptiveCpp for SYCL support.") + +include(FetchContent) + +if(NOT DEFINED ADAPTIVE_CPP_SOURCE_DIR) + FetchContent_Declare( + AdaptiveCpp + GIT_REPOSITORY https://github.com/root-project/AdaptiveCpp.git + GIT_TAG ROOT-acpp-v25.02.0-20250615-01) + FetchContent_GetProperties(AdaptiveCpp) + if(NOT AdaptiveCpp_POPULATED) + FetchContent_Populate(AdaptiveCpp) + endif() + set(ADAPTIVE_CPP_SOURCE_DIR ${adaptivecpp_SOURCE_DIR}) + message(STATUS "Fetched AdaptiveCpp source to: ${ADAPTIVE_CPP_SOURCE_DIR}") +else() + message( + STATUS "ADAPTIVE_CPP_SOURCE_DIR already defined: ${ADAPTIVE_CPP_SOURCE_DIR}" + ) +endif() + +set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm) +set(CLANG_EXECUTABLE_PATH ${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}) + +set(ACPP_CLANG + ${CLANG_EXECUTABLE_PATH} + CACHE STRING "Clang compiler executable used for compilation." FORCE) + +set(ADAPTIVE_CPP_BINARY_DIR ${CMAKE_BINARY_DIR}) +message(STATUS "AdaptiveCpp will be built in: ${ADAPTIVE_CPP_BINARY_DIR}") + +set(ADAPTIVECPP_INSTALL_CMAKE_DIR + lib/cmake/AdaptiveCpp + CACHE PATH "Install path for CMake config files") + +# Set relative paths for install root in the following variables so that +# configure_package_config_file will generate paths relative whatever is the +# future install root +set(ADAPTIVECPP_INSTALL_COMPILER_DIR bin) +set(ACPP_CONFIG_FILE_INSTALL_DIR etc/AdaptiveCpp) +set(ADAPTIVECPP_INSTALL_LAUNCHER_DIR ${ADAPTIVECPP_INSTALL_CMAKE_DIR}) +set(ADAPTIVECPP_INSTALL_LAUNCHER_RULE_DIR ${ADAPTIVECPP_INSTALL_CMAKE_DIR}) + +install(FILES ${ADAPTIVE_CPP_BINARY_DIR}/lib/libacpp-rt.so DESTINATION lib) +install(DIRECTORY ${ADAPTIVE_CPP_BINARY_DIR}/lib/hipSYCL/bitcode/ + DESTINATION lib/hipSYCL/bitcode) +install(DIRECTORY ${ADAPTIVE_CPP_BINARY_DIR}/include/AdaptiveCpp/ + DESTINATION include/AdaptiveCpp) + +file( + COPY ${ADAPTIVE_CPP_SOURCE_DIR}/cmake/syclcc-launcher + DESTINATION ${ADAPTIVE_CPP_BINARY_DIR}/${ADAPTIVECPP_INSTALL_LAUNCHER_DIR}) +file( + COPY ${ADAPTIVE_CPP_SOURCE_DIR}/cmake/syclcc-launch.rule.in + DESTINATION ${ADAPTIVE_CPP_BINARY_DIR}/${ADAPTIVECPP_INSTALL_LAUNCHER_RULE_DIR}) + +list(APPEND CMAKE_PREFIX_PATH ${ADAPTIVE_CPP_BINARY_DIR}/${ADAPTIVECPP_INSTALL_CMAKE_DIR}) +message(STATUS "Added ${ADAPTIVE_CPP_BINARY_DIR}/${ADAPTIVECPP_INSTALL_CMAKE_DIR} to CMAKE_PREFIX_PATH.") + +install(PROGRAMS ${ADAPTIVE_CPP_BINARY_DIR}/bin/acpp + DESTINATION ${ADAPTIVECPP_INSTALL_COMPILER_DIR}) +install(FILES ${ADAPTIVE_CPP_SOURCE_DIR}/cmake/syclcc-launcher + DESTINATION ${ADAPTIVECPP_INSTALL_LAUNCHER_DIR}) +install(FILES ${ADAPTIVE_CPP_SOURCE_DIR}/cmake/syclcc-launch.rule.in + DESTINATION ${ADAPTIVECPP_INSTALL_LAUNCHER_RULE_DIR}) + +file(GLOB CLANG_EXECUTABLES "${LLVM_BINARY_DIR}/bin/clang*") +install(PROGRAMS ${CLANG_EXECUTABLES} + DESTINATION ${ADAPTIVECPP_INSTALL_COMPILER_DIR}) + +file(GLOB CONFIG_FILES "${ADAPTIVE_CPP_BINARY_DIR}/etc/AdaptiveCpp/*") +install(FILES ${CONFIG_FILES} DESTINATION ${ACPP_CONFIG_FILE_INSTALL_DIR}) + +# Create imported target AdaptiveCpp::acpp-common +add_library(AdaptiveCpp::acpp-common STATIC IMPORTED) + +set_target_properties(AdaptiveCpp::acpp-common PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ADAPTIVE_CPP_BINARY_DIR}/include;${ADAPTIVE_CPP_BINARY_DIR}/include/AdaptiveCpp" + INTERFACE_LINK_LIBRARIES "-Wl,-Bsymbolic-functions;\$" +) + +# Create imported target AdaptiveCpp::acpp-rt +add_library(AdaptiveCpp::acpp-rt SHARED IMPORTED) + +set_target_properties(AdaptiveCpp::acpp-rt PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ADAPTIVE_CPP_BINARY_DIR}/include;${ADAPTIVE_CPP_BINARY_DIR}/include/AdaptiveCpp" + INTERFACE_LINK_LIBRARIES "AdaptiveCpp::acpp-common" +) + +# Import target "AdaptiveCpp::acpp-common" for configuration "Release" +set_property(TARGET AdaptiveCpp::acpp-common APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(AdaptiveCpp::acpp-common PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${ADAPTIVE_CPP_BINARY_DIR}/lib/libacpp-common.a" + ) + +# Import target "AdaptiveCpp::acpp-rt" for configuration "Release" +set_property(TARGET AdaptiveCpp::acpp-rt APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(AdaptiveCpp::acpp-rt PROPERTIES + IMPORTED_LOCATION_RELEASE "${ADAPTIVE_CPP_BINARY_DIR}/lib/libacpp-rt.so" + IMPORTED_SONAME_RELEASE "libacpp-rt.so" + ) + +# Make a config file to make this usable as a CMake Package +# Start by adding the version in a CMake understandable way +include(CMakePackageConfigHelpers) + +configure_package_config_file( + ${ADAPTIVE_CPP_SOURCE_DIR}/cmake/adaptivecpp-config.cmake.in + ${ADAPTIVE_CPP_BINARY_DIR}/lib/cmake/AdaptiveCpp/adaptivecpp-config.cmake + INSTALL_DESTINATION ${ADAPTIVECPP_INSTALL_CMAKE_DIR} + PATH_VARS + ADAPTIVECPP_INSTALL_COMPILER_DIR + ADAPTIVECPP_INSTALL_LAUNCHER_DIR + ADAPTIVECPP_INSTALL_LAUNCHER_RULE_DIR +) diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 9a4674d700884..6e2ac03cfb9c7 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -214,6 +214,13 @@ if(builtin_llvm) set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") + if(experimental_adaptivecpp) + # Register AdaptiveCpp as an external project + set(LLVM_EXTERNAL_PROJECTS "AdaptiveCpp" CACHE STRING "") + set(LLVM_EXTERNAL_ADAPTIVECPP_SOURCE_DIR "${ADAPTIVE_CPP_SOURCE_DIR}" CACHE STRING "") + set(LLVM_ADAPTIVECPP_LINK_INTO_TOOLS ON CACHE BOOL "") # To force-link the plugin into clang + endif() + # Always build LLVM with C++17. It is not necessary to compile with the same # C++ standard as the rest of ROOT and sometimes it doesn't even work. set(_cxx_standard ${CMAKE_CXX_STANDARD}) From 2136dd4febc0d3c6315b8434c785aa3791a98d14 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Thu, 5 Dec 2024 11:29:18 +0100 Subject: [PATCH 2/5] [cling] Add support for SYCL with adaptiveCpp --- cmake/modules/SearchInstalledSoftware.cmake | 3 +++ core/metacling/src/CMakeLists.txt | 3 ++- core/metacling/src/TCling.cxx | 9 +++++++++ interpreter/CMakeLists.txt | 5 ++++- interpreter/cling/lib/Interpreter/BackendPasses.cpp | 8 ++++++++ interpreter/cling/lib/Interpreter/CIFactory.cpp | 7 +++++++ interpreter/cling/lib/Interpreter/CMakeLists.txt | 12 ++++++++++++ .../cling/lib/Interpreter/IncrementalParser.cpp | 2 ++ 8 files changed, 47 insertions(+), 2 deletions(-) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 1b55661112eee..5752083c4d3b5 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1598,6 +1598,9 @@ if(experimental_adaptivecpp) ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("experimental_adaptivecpp") endif() include(SetupAdaptiveCpp) + + add_compile_definitions(CLING_WITH_ADAPTIVECPP) + set(HIPSYCL_NO_FIBERS ON) set(WITH_OPENCL_BACKEND OFF) set(WITH_LEVEL_ZERO_BACKEND OFF) diff --git a/core/metacling/src/CMakeLists.txt b/core/metacling/src/CMakeLists.txt index f1c835d16c743..4482996cabb40 100644 --- a/core/metacling/src/CMakeLists.txt +++ b/core/metacling/src/CMakeLists.txt @@ -108,7 +108,8 @@ if (clad) else() set(CLING_PLUGIN_LINK_LIBS -Wl,--whole-archive cladPlugin cladDifferentiator -Wl,--no-whole-archive) endif() - if(TARGET clang) + # This will cause a cyclic dependency in adaptiveCpp, as it requires clang to build + if(TARGET clang AND NOT experimental_adaptivecpp) # Link our clad libraries to clang. If users use the clang from ROOT they will # also be able to use clad out of the box. add_dependencies(clang clad) diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index ab59fb66a567d..e7ce2aef4a535 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -1418,6 +1418,15 @@ TCling::TCling(const char *name, const char *title, const char* const argv[], vo clingArgsStorage.push_back("-mllvm"); clingArgsStorage.push_back("-optimize-regalloc=0"); #endif + +#ifdef CLING_WITH_ADAPTIVECPP + std::string acppInclude(TROOT::GetIncludeDir() + "/AdaptiveCpp"); + + clingArgsStorage.push_back("-isystem"); + clingArgsStorage.push_back(acppInclude); + clingArgsStorage.push_back("-mllvm"); + clingArgsStorage.push_back("-acpp-sscp"); +#endif } // Process externally passed arguments if present. diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 6e2ac03cfb9c7..c9b7ea788e031 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -53,7 +53,10 @@ set(LLVM_FORCE_USE_OLD_TOOLCHAIN ON CACHE BOOL "") # found before (because the user turned on cuda or tmva-gpu), this will not have # an effect, which is fine. # (Note that the option is very counter-intuitive: We turn *on* disabling it...) -set(CMAKE_DISABLE_FIND_PACKAGE_CUDA ON) +# Special case when we want to build cling with adaptiveCpp +if(NOT experimental_adaptivecpp) + set(CMAKE_DISABLE_FIND_PACKAGE_CUDA ON) +endif() # will be set again in case NOT builtin_llvm set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm-project/llvm") diff --git a/interpreter/cling/lib/Interpreter/BackendPasses.cpp b/interpreter/cling/lib/Interpreter/BackendPasses.cpp index eb898bb95944a..514e2c78d26a0 100644 --- a/interpreter/cling/lib/Interpreter/BackendPasses.cpp +++ b/interpreter/cling/lib/Interpreter/BackendPasses.cpp @@ -36,6 +36,10 @@ #include +#ifdef CLING_WITH_ADAPTIVECPP +llvm::PassPluginLibraryInfo getAdaptiveCppPluginInfo(); +#endif + using namespace cling; using namespace clang; using namespace llvm; @@ -511,6 +515,10 @@ void BackendPasses::CreatePasses(int OptLevel, llvm::ModulePassManager& MPM, std::optional PGOOpt; PassBuilder PB(&m_TM, PTO, PGOOpt, &PIC); +#ifdef CLING_WITH_ADAPTIVECPP + getAdaptiveCppPluginInfo().RegisterPassBuilderCallbacks(PB); +#endif + // Attempt to load pass plugins and register their callbacks with PB. for (auto& PluginFN : m_CGOpts.PassPlugins) { auto PassPlugin = PassPlugin::Load(PluginFN); diff --git a/interpreter/cling/lib/Interpreter/CIFactory.cpp b/interpreter/cling/lib/Interpreter/CIFactory.cpp index 82ebd2e028404..4eb0895450f50 100644 --- a/interpreter/cling/lib/Interpreter/CIFactory.cpp +++ b/interpreter/cling/lib/Interpreter/CIFactory.cpp @@ -1399,6 +1399,13 @@ namespace { argvCompile.push_back("-fno-omit-frame-pointer"); } +#ifdef CLING_WITH_ADAPTIVECPP + argvCompile.push_back("-D__ACPP_ENABLE_LLVM_SSCP_TARGET__"); + argvCompile.push_back("-Xclang"); + argvCompile.push_back("-disable-O0-optnone"); + if (!debuggingEnabled) + argvCompile.push_back("-ffp-contract=fast"); +#endif // Add host specific includes, -resource-dir if necessary, and -isysroot std::string ClingBin = GetExecutablePath(argv[0]); AddHostArguments(ClingBin, argvCompile, LLVMDir, COpts); diff --git a/interpreter/cling/lib/Interpreter/CMakeLists.txt b/interpreter/cling/lib/Interpreter/CMakeLists.txt index 294e3dca1748b..f2d19a2d4f447 100644 --- a/interpreter/cling/lib/Interpreter/CMakeLists.txt +++ b/interpreter/cling/lib/Interpreter/CMakeLists.txt @@ -23,6 +23,18 @@ set(LIBS clangLex ) +if(experimental_adaptivecpp) + list(APPEND LIBS AdaptiveCpp acpp-rt) + + set(ACPP_EXPORTS acpp-rt acpp-common) + + foreach(target IN LISTS ACPP_EXPORTS) + install(TARGETS ${target} EXPORT ClingTargets) + endforeach() + + set_property(GLOBAL APPEND PROPERTY CLING_EXPORTS ${ACPP_EXPORTS}) +endif() + set(LLVM_LINK_COMPONENTS analysis core diff --git a/interpreter/cling/lib/Interpreter/IncrementalParser.cpp b/interpreter/cling/lib/Interpreter/IncrementalParser.cpp index 82ae54e10763e..dcd2a213149ef 100644 --- a/interpreter/cling/lib/Interpreter/IncrementalParser.cpp +++ b/interpreter/cling/lib/Interpreter/IncrementalParser.cpp @@ -1033,9 +1033,11 @@ namespace cling { // Don't protect against crashes if we cannot run anything. // cling might also be in a PCH-generation mode; don't inject our Sema // pointer into the PCH. +#ifndef CLING_WITH_ADAPTIVECPP if (!isCUDADevice && m_Interpreter->getOptions().PtrCheck) ASTTransformers.emplace_back( new NullDerefProtectionTransformer(m_Interpreter)); +#endif if (isCUDADevice) ASTTransformers.emplace_back( new DeviceKernelInliner(TheSema)); From 1aad002a583d12e991d95b11f08d0893291cff65 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Tue, 13 May 2025 10:45:50 +0200 Subject: [PATCH 3/5] [roottest] Add SYCL tests --- roottest/cling/sycl/CMakeLists.txt | 7 +++++++ roottest/cling/sycl/syclbasic.C | 16 ++++++++++++++++ roottest/cling/sycl/syclbasic.ref | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 roottest/cling/sycl/CMakeLists.txt create mode 100644 roottest/cling/sycl/syclbasic.C create mode 100644 roottest/cling/sycl/syclbasic.ref diff --git a/roottest/cling/sycl/CMakeLists.txt b/roottest/cling/sycl/CMakeLists.txt new file mode 100644 index 0000000000000..70457cc2fe10e --- /dev/null +++ b/roottest/cling/sycl/CMakeLists.txt @@ -0,0 +1,7 @@ +if(experimental_adaptivecpp) + ROOTTEST_ADD_TEST(syclbasic + MACRO syclbasic.C + LABELS roottest regression cling sycl) + set_property(TEST roottest-cling-sycl-syclbasic PROPERTY ENVIRONMENT "ACPP_DEBUG_LEVEL=1") +endif() + diff --git a/roottest/cling/sycl/syclbasic.C b/roottest/cling/sycl/syclbasic.C new file mode 100644 index 0000000000000..05f86bc6f8d3e --- /dev/null +++ b/roottest/cling/sycl/syclbasic.C @@ -0,0 +1,16 @@ +#include +#include + +void syclbasic() +{ + sycl::queue q{sycl::cpu_selector_v}; // Only openMP CPU backend is supported right now + std::cout << "Running on: " << q.get_device().get_info() << "\n"; + + int a = 2, b = 3; + int *sum = sycl::malloc_shared(1, q); + + q.single_task([=] { *sum = a + b; }).wait(); + std::cout << "Sum = " << *sum << '\n'; + + sycl::free(sum, q); +} diff --git a/roottest/cling/sycl/syclbasic.ref b/roottest/cling/sycl/syclbasic.ref new file mode 100644 index 0000000000000..22e5e20f57ac0 --- /dev/null +++ b/roottest/cling/sycl/syclbasic.ref @@ -0,0 +1,3 @@ + +Running on: AdaptiveCpp OpenMP host device +Sum = 5 From 760995257760810af4c5747cf4218b9ca045a866 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Tue, 1 Apr 2025 15:03:42 +0200 Subject: [PATCH 4/5] [adaptivecpp] Fix failing tests with adaptiveCpp AdaptiveCpp requires NullDerefProtectionTransformer to be turned off to function properly --- bindings/pyroot/pythonizations/test/import_load_libs.py | 3 +++ roottest/cling/exception/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bindings/pyroot/pythonizations/test/import_load_libs.py b/bindings/pyroot/pythonizations/test/import_load_libs.py index b2cdedbd5c0f5..53cbba76edfc7 100644 --- a/bindings/pyroot/pythonizations/test/import_load_libs.py +++ b/bindings/pyroot/pythonizations/test/import_load_libs.py @@ -29,6 +29,9 @@ class ImportLoadLibs(unittest.TestCase): "librt", "libncurses.*", "libtinfo", # by libncurses (on some older platforms) + # adaptivecpp and dependencies + "libacpp-rt", + "libgomp", # libTree and dependencies "libTree", "libThread", diff --git a/roottest/cling/exception/CMakeLists.txt b/roottest/cling/exception/CMakeLists.txt index 3e7f7b612f4dc..61c78473d0aa6 100644 --- a/roottest/cling/exception/CMakeLists.txt +++ b/roottest/cling/exception/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT MSVC OR win_broken_tests) +if((NOT MSVC OR win_broken_tests) AND NOT experimental_adaptivecpp) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64.*|x86.*|amd64.*|AMD64.*|i686.*|i386.*") # All platforms except of ARM/AARCH64 set(RootExeOptions "--ptrcheck") @@ -9,7 +9,7 @@ if(NOT MSVC OR win_broken_tests) endif() endif() -if(NOT (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES arm64) OR M1_BROKEN_TESTS) +if((NOT (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES arm64) OR M1_BROKEN_TESTS) AND NOT experimental_adaptivecpp) ROOTTEST_ADD_TEST(nullderef-e COMMAND ${ROOT_root_CMD} -l -b -q --ptrcheck -e "int*p=nullptr" -e "*p" PASSRC 1 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4d59a9ef7d971..418bb644ef640 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -75,7 +75,7 @@ ROOT_EXECUTABLE(guitest guitest.cxx LIBRARIES RIO Gui Gpad Hist) #ROOT_ADD_TEST(test-hsimple COMMAND hsimple) #---invalid pointer checks--------------------------------------------------------------------- -if(NOT (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES arm64) OR M1_BROKEN_TESTS) +if((NOT (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES arm64) OR M1_BROKEN_TESTS) AND NOT experimental_adaptivecpp) ROOT_ADD_TEST(test-check-nullptr COMMAND ${ROOT_root_CMD} -b -q -l --ptrcheck -e "int*ptr=(int*)0" -e "*ptr" PASSREGEX "dereference null pointer") From 7a1a305d4ad958986619522afa8cd0723f4feb82 Mon Sep 17 00:00:00 2001 From: Devajith Valaparambil Sreeramaswamy Date: Thu, 10 Apr 2025 14:22:47 +0200 Subject: [PATCH 5/5] [CI] Enable adaptivecpp on some linux machines --- .github/workflows/root-ci-config/buildconfig/fedora41.txt | 1 + .github/workflows/root-ci-config/buildconfig/fedora42.txt | 1 + .github/workflows/root-ci-config/buildconfig/ubuntu2404.txt | 1 + .github/workflows/root-ci-config/buildconfig/ubuntu2504.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/root-ci-config/buildconfig/fedora41.txt b/.github/workflows/root-ci-config/buildconfig/fedora41.txt index 3870c8f23c051..2e4d8e173a36c 100644 --- a/.github/workflows/root-ci-config/buildconfig/fedora41.txt +++ b/.github/workflows/root-ci-config/buildconfig/fedora41.txt @@ -2,3 +2,4 @@ builtin_zstd=ON builtin_zlib=ON builtin_vdt=On ccache=On +experimental_adaptivecpp=ON diff --git a/.github/workflows/root-ci-config/buildconfig/fedora42.txt b/.github/workflows/root-ci-config/buildconfig/fedora42.txt index cb6ac259c9857..75aae23f2868f 100644 --- a/.github/workflows/root-ci-config/buildconfig/fedora42.txt +++ b/.github/workflows/root-ci-config/buildconfig/fedora42.txt @@ -1,4 +1,5 @@ builtin_zlib=ON builtin_zstd=ON ccache=ON +experimental_adaptivecpp=ON vdt=OFF diff --git a/.github/workflows/root-ci-config/buildconfig/ubuntu2404.txt b/.github/workflows/root-ci-config/buildconfig/ubuntu2404.txt index e4cf831b6111d..af99c7f89a68a 100644 --- a/.github/workflows/root-ci-config/buildconfig/ubuntu2404.txt +++ b/.github/workflows/root-ci-config/buildconfig/ubuntu2404.txt @@ -1,3 +1,4 @@ ccache=ON +experimental_adaptivecpp=ON pythia8=OFF tmva-sofie=ON diff --git a/.github/workflows/root-ci-config/buildconfig/ubuntu2504.txt b/.github/workflows/root-ci-config/buildconfig/ubuntu2504.txt index 9439d1f4057e1..14fe42a308705 100644 --- a/.github/workflows/root-ci-config/buildconfig/ubuntu2504.txt +++ b/.github/workflows/root-ci-config/buildconfig/ubuntu2504.txt @@ -1,2 +1,3 @@ +experimental_adaptivecpp=ON ccache=ON pythia8=OFF