Skip to content

Commit f7026fd

Browse files
committed
[Math] Migrate completely aways from VecCore
1 parent 9ed26e3 commit f7026fd

33 files changed

+75
-218
lines changed

.ci/copy_headers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -ex
66
mkdir ../build
77
cd ../build
88
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -Dall=On -Dtesting=On -Dx11=Off -Dalien=Off \
9-
-Dcuda=Off -Dtmva-gpu=Off -Dveccore=Off ../root
9+
-Dcuda=Off -Dtmva-gpu=Off ../root
1010
# We need to prebuild a minimal set of targets which are responsible for header copy
1111
# or generation.
1212
make -j4 move_headers intrinsics_gen clang-tablegen-targets ClangDriverOptions \

.github/workflows/root-ci-config/buildconfig/global.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ builtin_pcre=OFF
2525
builtin_tbb=OFF
2626
builtin_unuran=OFF
2727
builtin_vdt=OFF
28-
builtin_veccore=OFF
2928
builtin_xrootd=OFF
3029
builtin_xxhash=OFF
3130
builtin_zeromq=ON
@@ -97,7 +96,6 @@ unfold=ON
9796
unuran=ON
9897
uring=OFF
9998
vdt=ON
100-
veccore=OFF
10199
vecgeom=OFF
102100
webgui=ON
103101
win_broken_tests=OFF

.github/workflows/root-ci-config/buildconfig/mac-beta.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ builtin_pcre=ON
1717
builtin_tbb=ON
1818
builtin_unuran=ON
1919
builtin_vdt=ON
20-
builtin_veccore=ON
2120
builtin_xrootd=ON
2221
builtin_xxhash=ON
2322
builtin_zeromq=ON

.github/workflows/root-ci-config/buildconfig/mac14.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ builtin_pcre=ON
1919
builtin_tbb=ON
2020
builtin_unuran=ON
2121
builtin_vdt=ON
22-
builtin_veccore=ON
2322
builtin_xrootd=ON
2423
builtin_xxhash=ON
2524
builtin_zeromq=ON

.github/workflows/root-ci-config/buildconfig/mac15.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ builtin_pcre=ON
1616
builtin_tbb=ON
1717
builtin_unuran=ON
1818
builtin_vdt=ON
19-
builtin_veccore=ON
2019
builtin_xrootd=ON
2120
builtin_xxhash=ON
2221
builtin_zeromq=ON

.github/workflows/root-ci-config/buildconfig/mac26.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ builtin_pcre=ON
1717
builtin_tbb=ON
1818
builtin_unuran=ON
1919
builtin_vdt=ON
20-
builtin_veccore=ON
2120
builtin_xrootd=ON
2221
builtin_xxhash=ON
2322
builtin_zeromq=ON

cmake/modules/RootBuildOptions.cmake

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ ROOT_BUILD_OPTION(builtin_png OFF "Build bundled copy of libpng")
108108
ROOT_BUILD_OPTION(builtin_tbb OFF "Build TBB internally (requires network)")
109109
ROOT_BUILD_OPTION(builtin_unuran OFF "Build bundled copy of unuran")
110110
ROOT_BUILD_OPTION(builtin_vdt OFF "Build VDT internally (requires network)")
111-
ROOT_BUILD_OPTION(builtin_veccore OFF "Build VecCore internally (requires network)")
112111
ROOT_BUILD_OPTION(builtin_xrootd OFF "Build XRootD internally (requires network)")
113112
ROOT_BUILD_OPTION(builtin_xxhash OFF "Build bundled copy of xxHash")
114113
ROOT_BUILD_OPTION(builtin_zeromq OFF "Build ZeroMQ internally (requires network)")
@@ -180,7 +179,6 @@ ROOT_BUILD_OPTION(unuran OFF "Enable support for UNURAN (package for generating
180179
ROOT_BUILD_OPTION(uring OFF "Enable support for io_uring (requires liburing and Linux kernel >= 5.1)")
181180
ROOT_BUILD_OPTION(use_gsl_cblas ON "Use the CBLAS library from GSL instead of finding a more optimized BLAS library automatically with FindBLAS (the GSL CBLAS is less performant but more portable)")
182181
ROOT_BUILD_OPTION(vdt ON "Enable support for VDT (fast and vectorisable mathematical functions)")
183-
ROOT_BUILD_OPTION(veccore OFF "Enable support for VecCore SIMD abstraction library")
184182
ROOT_BUILD_OPTION(vecgeom OFF "Enable support for VecGeom vectorized geometry library")
185183
ROOT_BUILD_OPTION(webgui ON "Build Web-based UI components of ROOT")
186184
ROOT_BUILD_OPTION(win_broken_tests OFF "Enable broken tests on Windows")
@@ -252,7 +250,6 @@ if(all)
252250
set(tmva-rmva_defvalue ON)
253251
set(unuran_defvalue ON)
254252
set(vdt_defvalue ON)
255-
set(veccore_defvalue ON)
256253
set(vecgeom_defvalue ON)
257254
set(x11_defvalue ON)
258255
set(xml_defvalue ON)
@@ -293,7 +290,6 @@ if(builtin_all)
293290
set(builtin_tbb_defvalue ON)
294291
# set(builtin_unuran_defvalue ON) (GPL)
295292
set(builtin_vdt_defvalue ON)
296-
set(builtin_veccore_defvalue ON)
297293
set(builtin_xrootd_defvalue ON)
298294
set(builtin_xxhash_defvalue ON)
299295
set(builtin_zeromq_defvalue ON)
@@ -411,35 +407,14 @@ if(DEFINED rpath)
411407
"") # empty line at the end to make the deprecation message more visible
412408
endif()
413409

414-
foreach(opt vc builtin_vc)
410+
foreach(opt vc builtin_vc veccore builtin_veccore)
415411
if(${opt})
416412
message(DEPRECATION ">>> Option '${opt}' is deprecated and ignored."
417-
"ROOT now uses std::simd for the vectorized TFormula and TMath classes when available (Clang or GCC >= 9)."
413+
"ROOT now uses std::experimental::simd for the vectorized TFormula and TMath classes when available (on Linux when compiling with C++20 or higher)."
418414
"Using this option will result in configuration errors in ROOT 6.42.")
419415
endif()
420416
endforeach()
421417

422-
foreach(opt veccore builtin_veccore)
423-
# Disable VecCore if we don't support it for a given platform.
424-
# We try to give clear explanations here in all distinct cases.
425-
if(${opt})
426-
if(WIN32)
427-
message(WARNING "ROOT option '${opt}' will be disabled. Using VecCore on Windows is not supported by ROOT.")
428-
set(${opt} OFF CACHE BOOL "Disabled because VecCore is not supported on Windows." FORCE)
429-
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
430-
message(WARNING "ROOT option '${opt}' will be disabled. We don't support using VecCore on Apple with Intel hardware anymore.")
431-
set(${opt} OFF CACHE BOOL "Disabled because VecCore is not supported on Apple with Intel hardware." FORCE)
432-
elseif(APPLE)
433-
message(WARNING "ROOT option '${opt}' will be disabled. We don't support using VecCore on Apple silicon, as std::simd is not available for Apple Clang and the old Vc backend also didn't support Apple silicon anyway.")
434-
set(${opt} OFF CACHE BOOL "Disabled because VecCore is not supported on Apple silicon." FORCE)
435-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
436-
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
437-
message(WARNING "ROOT option '${opt}' will be disabled. GCC versions older than 9 do not provide std::simd, and the Vc backend of VecCore is not supported anymore by ROOT.")
438-
set(${opt} OFF CACHE BOOL "Disabled because VecCore is not supported on GCC < 9." FORCE)
439-
endif()
440-
endif()
441-
endforeach()
442-
443418
foreach(opt minuit2_mpi)
444419
if(${opt})
445420
message(WARNING "The option '${opt}' can only be used to minimise thread-safe functions in Minuit2. It cannot be used for Histogram/Graph fitting and for RooFit. If you want to use Minuit2 with MPI support, it is better to build Minuit2 as a standalone library.")

cmake/modules/RootConfiguration.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,11 @@ if(vdt)
370370
else()
371371
set(hasvdt undef)
372372
endif()
373-
if(veccore)
374-
set(hasveccore define)
373+
# Assume std::experimental::simd is available on Linux if we build with C++20 on Linux
374+
if(WIN32 OR APPLE OR CMAKE_CXX_STANDARD LESS 20)
375+
set(hasstdsimd undef)
375376
else()
376-
set(hasveccore undef)
377+
set(hasstdsimd define)
377378
endif()
378379
if(dataframe)
379380
set(hasdataframe define)

cmake/modules/SearchInstalledSoftware.cmake

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,88 +1365,6 @@ if(builtin_tbb)
13651365
set(TBB_TARGET TBB)
13661366
endif()
13671367

1368-
#---Check for VecCore--------------------------------------------------------------------
1369-
if(builtin_veccore)
1370-
unset(VecCore_FOUND)
1371-
unset(VecCore_FOUND CACHE)
1372-
set(veccore ON CACHE BOOL "Enabled because builtin_veccore requested (${veccore_description})" FORCE)
1373-
elseif(veccore)
1374-
if(fail-on-missing)
1375-
find_package(VecCore 0.4.2 CONFIG QUIET REQUIRED COMPONENTS ${VecCore_COMPONENTS})
1376-
else()
1377-
find_package(VecCore 0.4.2 CONFIG QUIET COMPONENTS ${VecCore_COMPONENTS})
1378-
if(NOT VecCore_FOUND)
1379-
ROOT_CHECK_CONNECTION("veccore=OFF")
1380-
if(NO_CONNECTION)
1381-
message(STATUS "VecCore not found and no internet connection, disabling the 'veccore' option")
1382-
set(veccore OFF CACHE BOOL "Disabled because not found and No internet connection" FORCE)
1383-
else()
1384-
message(STATUS "VecCore not found, switching on 'builtin_veccore' option.")
1385-
set(builtin_veccore ON CACHE BOOL "Enabled because veccore requested and not found externally (${builtin_veccore_description})" FORCE)
1386-
endif()
1387-
endif()
1388-
endif()
1389-
if(VecCore_FOUND)
1390-
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${VecCore_INCLUDE_DIRS})
1391-
endif()
1392-
endif()
1393-
1394-
if(builtin_veccore)
1395-
ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("builtin_veccore")
1396-
endif()
1397-
1398-
if(builtin_veccore)
1399-
set(VecCore_VERSION "0.8.2")
1400-
set(VecCore_PROJECT "VecCore-${VecCore_VERSION}")
1401-
set(VecCore_SRC_URI "${lcgpackages}/${VecCore_PROJECT}.tar.gz")
1402-
set(VecCore_DESTDIR "${CMAKE_BINARY_DIR}/externals")
1403-
set(VecCore_ROOTDIR "${VecCore_DESTDIR}/${CMAKE_INSTALL_PREFIX}")
1404-
1405-
ExternalProject_Add(VECCORE
1406-
URL ${VecCore_SRC_URI}
1407-
URL_HASH SHA256=1268bca92acf00acd9775f1e79a2da7b1d902733d17e283e0dd5e02c41ac9666
1408-
BUILD_IN_SOURCE 0
1409-
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1
1410-
CMAKE_ARGS -G ${CMAKE_GENERATOR}
1411-
-DBUILD_TESTING=OFF
1412-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
1413-
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
1414-
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
1415-
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
1416-
-DCMAKE_CXX_FLAGS=${ROOT_EXTERNAL_CXX_FLAGS}
1417-
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
1418-
INSTALL_COMMAND env DESTDIR=${VecCore_DESTDIR} ${CMAKE_COMMAND} --build . --target install
1419-
TIMEOUT 600
1420-
)
1421-
1422-
set(VECCORE_TARGET VecCore)
1423-
set(VecCore_LIBRARIES VecCore)
1424-
list(APPEND VecCore_INCLUDE_DIRS ${VecCore_ROOTDIR}/include)
1425-
1426-
add_library(VecCore INTERFACE)
1427-
target_include_directories(VecCore SYSTEM INTERFACE $<BUILD_INTERFACE:${VecCore_ROOTDIR}/include>)
1428-
add_dependencies(VecCore VECCORE)
1429-
1430-
find_package_handle_standard_args(VecCore
1431-
FOUND_VAR VecCore_FOUND
1432-
REQUIRED_VARS VecCore_INCLUDE_DIRS VecCore_LIBRARIES
1433-
VERSION_VAR VecCore_VERSION)
1434-
1435-
# FIXME: This is a workaround to let ROOT find the headers at runtime if
1436-
# they are in the build directory. This is necessary until we decide how to
1437-
# treat externals with headers used by ROOT
1438-
if(NOT EXISTS ${CMAKE_BINARY_DIR}/include/VecCore)
1439-
if (NOT EXISTS ${CMAKE_BINARY_DIR}/include)
1440-
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include)
1441-
endif()
1442-
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
1443-
${VecCore_ROOTDIR}/include/VecCore ${CMAKE_BINARY_DIR}/include/VecCore)
1444-
endif()
1445-
# end of workaround
1446-
1447-
install(DIRECTORY ${VecCore_ROOTDIR}/ DESTINATION ".")
1448-
endif()
1449-
14501368
if(builtin_vdt)
14511369
ROOT_CHECK_CONNECTION_AND_DISABLE_OPTION("builtin_vdt")
14521370
endif()
@@ -1520,12 +1438,6 @@ endif()
15201438
if (vecgeom)
15211439
message(STATUS "Looking for VecGeom")
15221440
find_package(VecGeom 1.2 CONFIG)
1523-
if(builtin_veccore)
1524-
message(WARNING "ROOT must be built against the VecCore installation that was used to build VecGeom; builtin_veccore cannot be used. Option VecGeom will be disabled.")
1525-
set(vecgeom OFF CACHE BOOL "Disabled because non-builtin VecGeom specified but its VecCore cannot be found" FORCE)
1526-
elseif(builtin_veccore AND fail-on-missing)
1527-
message(SEND_ERROR "ROOT must be built against the VecCore installation that was used to build VecGeom; builtin_veccore cannot be used. Ensure that builtin_veccore option is OFF.")
1528-
endif()
15291441
if(NOT VecGeom_FOUND )
15301442
if(fail-on-missing)
15311443
message(SEND_ERROR "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH")

config/RConfigure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#@hasclad@ R__HAS_CLAD /**/
3939
#@hascocoa@ R__HAS_COCOA /**/
4040
#@hasvdt@ R__HAS_VDT /**/
41-
#@hasveccore@ R__HAS_VECCORE /**/
41+
#@hasstdsimd@ R__HAS_STD_SIMD /**/
4242
#@usecxxmodules@ R__USE_CXXMODULES /**/
4343
#@uselibc++@ R__USE_LIBCXX /**/
4444
#@has_found_attribute_always_inline@ R__HAS_ATTRIBUTE_ALWAYS_INLINE /**/

0 commit comments

Comments
 (0)