diff --git a/.github/workflows/root-ci-config/buildconfig/alma9.txt b/.github/workflows/root-ci-config/buildconfig/alma9.txt index e28883917904a..ebd18850fbd3c 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma9.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma9.txt @@ -1,4 +1,4 @@ +BLAS_LIBRARIES=/usr/lib64/libblas.so builtin_nlohmannjson=ON builtin_vdt=On tmva-sofie=On -BLA_VENDOR=OpenBLAS diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index eef248d0de62d..171bfdc871290 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1549,6 +1549,13 @@ endif() #---Check for protobuf------------------------------------------------------------------- if(tmva-sofie) + if(testing) + message(STATUS "Looking for BLAS as an optional testing dependency of TMVA-SOFIE") + find_package(BLAS) + if(NOT BLAS_FOUND) + message(WARNING "BLAS not found: TMVA-SOFIE will not be fully tested") + endif() + endif() message(STATUS "Looking for Protobuf") set(protobuf_MODULE_COMPATIBLE TRUE) find_package(Protobuf CONFIG) diff --git a/tmva/sofie/test/CMakeLists.txt b/tmva/sofie/test/CMakeLists.txt index 499ca7fea7368..29e9026aa4d75 100644 --- a/tmva/sofie/test/CMakeLists.txt +++ b/tmva/sofie/test/CMakeLists.txt @@ -60,12 +60,11 @@ add_custom_command(TARGET SofieCompileModels_ONNX POST_BUILD # Creating a Google Test -if (tmva-cpu) # we need BLAS for compiling the models +if (BLAS_FOUND) # we need BLAS for compiling the models ROOT_ADD_GTEST(TestCustomModelsFromONNX TestCustomModelsFromONNX.cxx LIBRARIES ROOTTMVASofie - ${BLAS_LINKER_FLAGS} - ${BLAS_LIBRARIES} + BLAS::BLAS INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ) @@ -103,12 +102,11 @@ COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ./emitFromROOT USES_TERMINAL ) # Creating a Google Test for Serialisation of RModel -if (tmva-cpu) +if (BLAS_FOUND) ROOT_ADD_GTEST(TestCustomModelsFromROOT TestCustomModelsFromROOT.cxx LIBRARIES ROOTTMVASofie - ${BLAS_LINKER_FLAGS} - ${BLAS_LIBRARIES} + BLAS::BLAS INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ) @@ -128,13 +126,12 @@ if(PY_TORCH_FOUND AND PY_ONNX_FOUND) configure_file(LinearModelGenerator.py LinearModelGenerator.py COPYONLY) configure_file(RecurrentModelGenerator.py RecurrentModelGenerator.py COPYONLY) -if (tmva-cpu) +if (BLAS_FOUND) ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx LIBRARIES ROOTTMVASofie ROOTTMVASofieParser - ${BLAS_LINKER_FLAGS} - ${BLAS_LIBRARIES} + BLAS::BLAS INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} )