Skip to content

Commit 5f3a91f

Browse files
authored
[CMake] Disable TestSofieModels if PyTorch >= 2.9.0
1 parent 3f5a22f commit 5f3a91f

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
@@ -116,14 +116,24 @@ if (ROOT_TORCH_FOUND)
116116
configure_file(RecurrentModelGenerator.py RecurrentModelGenerator.py COPYONLY)
117117

118118
if (BLAS_FOUND)
119-
ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx
120-
LIBRARIES
121-
ROOTTMVASofie
122-
ROOTTMVASofieParser
123-
BLAS::BLAS
124-
INCLUDE_DIRS
125-
${CMAKE_CURRENT_BINARY_DIR}
126-
)
119+
execute_process(COMMAND "${Python3_EXECUTABLE}" "-c"
120+
"import torch; print(getattr(torch, '__version__', 'unknown'))"
121+
RESULT_VARIABLE status
122+
OUTPUT_VARIABLE module_version
123+
OUTPUT_STRIP_TRAILING_WHITESPACE
124+
ERROR_QUIET)
125+
if(${status} EQUAL 0 AND ${module_version} VERSION_LESS 2.9.0)
126+
# Disable TestSofieModels which is failing on alma8, alma10, ubuntu2204, and ubuntu2404
127+
# with PyTorch 2.9.0
128+
ROOT_ADD_GTEST(TestSofieModels TestSofieModels.cxx
129+
LIBRARIES
130+
ROOTTMVASofie
131+
ROOTTMVASofieParser
132+
BLAS::BLAS
133+
INCLUDE_DIRS
134+
${CMAKE_CURRENT_BINARY_DIR}
135+
)
136+
endif()
127137
endif()
128138
endif()
129139

0 commit comments

Comments
 (0)