Skip to content

Commit 7e9752e

Browse files
bellenotguitargeek
authored andcommitted
[CMake] Disable TestSofieModels if PyTorch >= 2.9.0
1 parent 8104eb4 commit 7e9752e

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tmva/sofie/test/CMakeLists.txt

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,24 @@ if (ROOT_TORCH_FOUND)
136136
configure_file(RecurrentModelGenerator.py RecurrentModelGenerator.py COPYONLY)
137137

138138
if (BLAS_FOUND)
139-
ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx
140-
LIBRARIES
141-
ROOTTMVASofie
142-
ROOTTMVASofieParser
143-
BLAS::BLAS
144-
INCLUDE_DIRS
145-
${CMAKE_CURRENT_BINARY_DIR}
146-
)
139+
execute_process(COMMAND "${Python3_EXECUTABLE}" "-c"
140+
"import torch; print(getattr(torch, '__version__', 'unknown'))"
141+
RESULT_VARIABLE status
142+
OUTPUT_VARIABLE module_version
143+
OUTPUT_STRIP_TRAILING_WHITESPACE
144+
ERROR_QUIET)
145+
if(${status} EQUAL 0 AND ${module_version} VERSION_LESS 2.9.0)
146+
# Disable TestSofieModels which is failing on alma8, alma10, ubuntu2204, and ubuntu2404
147+
# with PyTorch 2.9.0
148+
ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx
149+
LIBRARIES
150+
ROOTTMVASofie
151+
ROOTTMVASofieParser
152+
BLAS::BLAS
153+
INCLUDE_DIRS
154+
${CMAKE_CURRENT_BINARY_DIR}
155+
)
156+
endif()
147157
endif()
148158
endif()
149159

0 commit comments

Comments
 (0)