Skip to content

Commit 9dc8669

Browse files
committed
[CMake] Add test_tmva_sofie build option
Most of the SOFIE tests require BLAS as a runtime dependency. We need to make it possible to toggle the TMVA SOFIE tests, so you can switch them off on platforms where no BLAS is installed or available.
1 parent 6f02baa commit 9dc8669

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ roofit_multiprocess=OFF
6868
root7=ON
6969
rootbench=OFF
7070
roottest=ON
71-
test_roofit_hs3testsuite=ON
7271
runtime_cxxmodules=ON
7372
shadowpw=OFF
7473
shared=ON
@@ -78,6 +77,8 @@ sqlite=ON
7877
ssl=ON
7978
test_distrdf_dask=ON
8079
test_distrdf_pyspark=ON
80+
test_roofit_hs3testsuite=ON
81+
test_tmva_sofie=ON
8182
testing=ON
8283
tmva-cpu=ON
8384
tmva-gpu=OFF

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ runtime_cxxmodules=OFF
2929
ssl=OFF
3030
test_distrdf_dask=OFF
3131
test_distrdf_pyspark=OFF
32+
test_tmva_sofie=OFF
3233
use_gsl_cblas=ON
3334
vdt=OFF
3435
x11=OFF

cmake/modules/RootBuildOptions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ option(minimal "Enable only required options by default" OFF)
191191
option(rootbench "Build rootbench if rootbench exists in root or if it is a sibling directory (implies testing=ON)" OFF)
192192
option(roottest "Build roottest (implies testing=ON)" OFF)
193193
option(test_roofit_hs3testsuite "Setup and use the HS3 conformance test suite (requires network)" OFF)
194+
option(test_tmva_sofie "Enable SOFIE tests (requires BLAS library that can be found with CMake's FindBLAS)" ON)
194195
option(testing "Enable testing with CTest" OFF)
195196
option(asan "Build ROOT with address sanitizer instrumentation (see core/sanitizer for details)" OFF)
196197
option(_wheel_build "ROOT is being packaged as a wheel, do not install .dist-info metadata" OFF)

cmake/modules/SearchInstalledSoftware.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,16 +1013,14 @@ endif()
10131013
# SOFIE itself has no external dependencies: ONNX models are read with a small
10141014
# self-contained protobuf wire-format decoder (tmva/sofie_parsers/src/onnx.hxx).
10151015

1016-
if(tmva)
1017-
if(testing)
1018-
message(STATUS "Looking for BLAS as an optional testing dependency of TMVA-SOFIE")
1019-
find_package(BLAS)
1020-
if(NOT BLAS_FOUND)
1021-
if(fail-on-missing)
1022-
message(FATAL_ERROR "BLAS not found, but it's required for TMVA-SOFIE testing")
1023-
else()
1024-
message(WARNING "BLAS not found: TMVA-SOFIE will not be fully tested")
1025-
endif()
1016+
if(tmva AND testing AND test_tmva_sofie)
1017+
message(STATUS "Looking for BLAS as an optional testing dependency of TMVA-SOFIE")
1018+
find_package(BLAS)
1019+
if(NOT BLAS_FOUND)
1020+
if(fail-on-missing)
1021+
message(FATAL_ERROR "BLAS not found, but it's required for TMVA-SOFIE testing")
1022+
else()
1023+
message(WARNING "BLAS not found: TMVA-SOFIE will not be fully tested")
10261024
endif()
10271025
endif()
10281026
endif()

tmva/sofie/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,7 @@ if(sofie_root_support)
109109
target_compile_definitions(ROOTTMVASofie PRIVATE SOFIE_SUPPORT_ROOT_BINARY)
110110
endif()
111111

112-
ROOT_ADD_TEST_SUBDIRECTORY(test)
112+
# Tests are not enabled unconditionally because they require BLAS
113+
if(test_tmva_sofie)
114+
ROOT_ADD_TEST_SUBDIRECTORY(test)
115+
endif()

0 commit comments

Comments
 (0)