From a0882750df365bcc7b41ece22cd853b615c0dd1b Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 12 Mar 2026 15:25:06 +0530 Subject: [PATCH 1/3] [tmva] Fix SOFIE tests exclusion with builtin GSL (use_gsl_cblas=ON) --- tmva/sofie/test/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tmva/sofie/test/CMakeLists.txt b/tmva/sofie/test/CMakeLists.txt index 1a9295237cff1..d390e612f31e0 100644 --- a/tmva/sofie/test/CMakeLists.txt +++ b/tmva/sofie/test/CMakeLists.txt @@ -46,7 +46,7 @@ ROOTTEST_ADD_TEST(SofieCompileModels_ONNX ) # Creating a Google Test -if (BLAS_FOUND) # we need BLAS for compiling the models +if (BLAS_FOUND OR use_gsl_cblas) # we need BLAS for compiling the models ROOT_EXECUTABLE(TestCustomModelsFromONNX TestCustomModelsFromONNX.cxx LIBRARIES Core @@ -74,7 +74,7 @@ ROOTTEST_ADD_TEST(SofieCompileModels_ROOT FIXTURES_SETUP sofie-compile-models-root ) -if (BLAS_FOUND) +if (BLAS_FOUND OR use_gsl_cblas) # Creating a Google Test for Serialisation of RModel ROOT_EXECUTABLE(TestCustomModelsFromROOT TestCustomModelsFromROOT.cxx LIBRARIES @@ -119,7 +119,7 @@ if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) configure_file(LinearModelGenerator.py LinearModelGenerator.py COPYONLY) configure_file(RecurrentModelGenerator.py RecurrentModelGenerator.py COPYONLY) - if (BLAS_FOUND) + if (BLAS_FOUND OR use_gsl_cblas) ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx LIBRARIES ROOTTMVASofie @@ -132,7 +132,7 @@ if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) endif() # Any features that link against libpython are disabled if built with tpython=OFF -if (tpython AND ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND BLAS_FOUND AND NOT broken_onnx) +if (tpython AND ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND (BLAS_FOUND OR use_gsl_cblas) AND NOT broken_onnx) configure_file(generatePyTorchModels.py generatePyTorchModels.py COPYONLY) # Test RModelParser_PyTorch @@ -151,7 +151,7 @@ endif() # Any features that link against libpython are disabled if built with tpython=OFF -if (tpython AND ROOT_KERAS_FOUND AND BLAS_FOUND) +if (tpython AND ROOT_KERAS_FOUND AND (BLAS_FOUND OR use_gsl_cblas)) configure_file(generateKerasModels.py generateKerasModels.py COPYONLY) configure_file(scale_by_2_op.hxx scale_by_2_op.hxx COPYONLY) From f5777146fa3f0f7cb62e89d395dd04baa823e205 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 17 Mar 2026 19:30:01 +0530 Subject: [PATCH 2/3] build: replace BLAS::BLAS with ROOT::BLAS for GSL fallback compatibility --- tmva/sofie/test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tmva/sofie/test/CMakeLists.txt b/tmva/sofie/test/CMakeLists.txt index d390e612f31e0..be5fa4533fcb9 100644 --- a/tmva/sofie/test/CMakeLists.txt +++ b/tmva/sofie/test/CMakeLists.txt @@ -88,7 +88,7 @@ if (BLAS_FOUND OR use_gsl_cblas) if (clad) # Creating a Google Test for the automatic differentiation of Gemm_Call - ROOT_ADD_GTEST(TestGemmDerivative TestGemmDerivative.cxx LIBRARIES Core BLAS::BLAS) + ROOT_ADD_GTEST(TestGemmDerivative TestGemmDerivative.cxx LIBRARIES Core ROOT::BLAS) endif() endif() @@ -124,7 +124,7 @@ if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) LIBRARIES ROOTTMVASofie ROOTTMVASofieParser - BLAS::BLAS + ROOT::BLAS INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ) @@ -142,7 +142,7 @@ if (tpython AND ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND (BLAS_FOUND OR use_gsl_ TMVA Python3::NumPy Python3::Python - BLAS::BLAS + ROOT::BLAS INCLUDE_DIRS SYSTEM ${CMAKE_CURRENT_BINARY_DIR} @@ -161,7 +161,7 @@ if (tpython AND ROOT_KERAS_FOUND AND (BLAS_FOUND OR use_gsl_cblas)) ROOTTMVASofie Python3::NumPy Python3::Python - BLAS::BLAS + ROOT::BLAS INCLUDE_DIRS SYSTEM ${CMAKE_CURRENT_BINARY_DIR} From 75131380cc3079be6f0c20232fc84e17c0683fe3 Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 18 Mar 2026 16:48:18 +0530 Subject: [PATCH 3/3] [Cmake][tmva] Fix: Replace TARGET ROOT::BLAS instead of BLAS_FOUND Replace all BLAS_FOUND and (BLAS_FOUND OR use_gsl_cblas) condition gates with if(TARGET ROOT::BLAS). ROOT::BLAS is only instantiated inside the tmva-cpu AND imt block in SearchInstalledSoftware.cmake, so querying the target directly is the correct gate rather than relying on proxy boolean variables that can be stale or inconsistent across configurations. Also replace BLAS::BLAS with ROOT::BLAS in all LIBRARIES sections as ROOT::BLAS is the public compatibility alias for both external BLAS and GSL CBLAS configurations. --- tmva/sofie/test/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tmva/sofie/test/CMakeLists.txt b/tmva/sofie/test/CMakeLists.txt index be5fa4533fcb9..2c66cb845add1 100644 --- a/tmva/sofie/test/CMakeLists.txt +++ b/tmva/sofie/test/CMakeLists.txt @@ -46,7 +46,7 @@ ROOTTEST_ADD_TEST(SofieCompileModels_ONNX ) # Creating a Google Test -if (BLAS_FOUND OR use_gsl_cblas) # we need BLAS for compiling the models +if (TARGET ROOT::BLAS) # we need BLAS for compiling the models ROOT_EXECUTABLE(TestCustomModelsFromONNX TestCustomModelsFromONNX.cxx LIBRARIES Core @@ -74,7 +74,7 @@ ROOTTEST_ADD_TEST(SofieCompileModels_ROOT FIXTURES_SETUP sofie-compile-models-root ) -if (BLAS_FOUND OR use_gsl_cblas) +if (TARGET ROOT::BLAS) # Creating a Google Test for Serialisation of RModel ROOT_EXECUTABLE(TestCustomModelsFromROOT TestCustomModelsFromROOT.cxx LIBRARIES @@ -119,7 +119,7 @@ if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) configure_file(LinearModelGenerator.py LinearModelGenerator.py COPYONLY) configure_file(RecurrentModelGenerator.py RecurrentModelGenerator.py COPYONLY) - if (BLAS_FOUND OR use_gsl_cblas) + if (TARGET ROOT::BLAS) ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx LIBRARIES ROOTTMVASofie @@ -132,7 +132,7 @@ if (ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND NOT broken_onnx) endif() # Any features that link against libpython are disabled if built with tpython=OFF -if (tpython AND ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND (BLAS_FOUND OR use_gsl_cblas) AND NOT broken_onnx) +if (tpython AND ROOT_TORCH_FOUND AND ROOT_ONNX_FOUND AND (TARGET ROOT::BLAS) AND NOT broken_onnx) configure_file(generatePyTorchModels.py generatePyTorchModels.py COPYONLY) # Test RModelParser_PyTorch @@ -151,7 +151,7 @@ endif() # Any features that link against libpython are disabled if built with tpython=OFF -if (tpython AND ROOT_KERAS_FOUND AND (BLAS_FOUND OR use_gsl_cblas)) +if (tpython AND ROOT_KERAS_FOUND AND (TARGET ROOT::BLAS)) configure_file(generateKerasModels.py generateKerasModels.py COPYONLY) configure_file(scale_by_2_op.hxx scale_by_2_op.hxx COPYONLY)