Skip to content

Commit 4b327eb

Browse files
committed
[tmva][sofie] Don't run Keras tests if the Keras version is too new
1 parent f268f6f commit 4b327eb

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

tmva/sofie/test/CMakeLists.txt

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,29 @@ endif()
153153

154154
# Any reatures that link against libpython are disabled if built with tpython=OFF
155155
if (tpython AND ROOT_KERAS_FOUND AND BLAS_FOUND)
156-
configure_file(generateKerasModels.py generateKerasModels.py COPYONLY)
157-
configure_file(scale_by_2_op.hxx scale_by_2_op.hxx COPYONLY)
158-
159-
ROOT_ADD_GTEST(TestRModelParserKeras TestRModelParserKeras.C
160-
LIBRARIES
161-
ROOTTMVASofie
162-
Python3::NumPy
163-
Python3::Python
164-
BLAS::BLAS
165-
INCLUDE_DIRS
166-
SYSTEM
167-
${CMAKE_CURRENT_BINARY_DIR}
168-
)
156+
157+
set(unsupported_keras_version "3.10.0")
158+
159+
# TODO: make sure we also support the newest Keras
160+
if (NOT DEFINED ROOT_KERAS_VERSION)
161+
message(WARNING "Keras found, but version unknown — cannot verify compatibility.")
162+
elseif (ROOT_KERAS_VERSION VERSION_LESS ${unsupported_keras_version})
163+
configure_file(generateKerasModels.py generateKerasModels.py COPYONLY)
164+
configure_file(scale_by_2_op.hxx scale_by_2_op.hxx COPYONLY)
165+
166+
ROOT_ADD_GTEST(TestRModelParserKeras TestRModelParserKeras.C
167+
LIBRARIES
168+
ROOTTMVASofie
169+
Python3::NumPy
170+
Python3::Python
171+
BLAS::BLAS
172+
INCLUDE_DIRS
173+
SYSTEM
174+
${CMAKE_CURRENT_BINARY_DIR}
175+
)
176+
else()
177+
message(WARNING "Keras version ${ROOT_KERAS_VERSION} is too new for the SOFIE Keras parser (only supports < ${unsupported_keras_version})")
178+
endif()
169179
endif()
170180

171181

0 commit comments

Comments
 (0)