Skip to content

Commit 3c6791c

Browse files
committed
[tmva][sofie] Don't run Keras tests if the Keras version is too new
1 parent fe45f11 commit 3c6791c

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

tmva/sofie/test/CMakeLists.txt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,27 @@ 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+
# TODO: make sure we also support the newest Keras
158+
if (NOT DEFINED ROOT_KERAS_VERSION)
159+
message(WARNING "Keras found, but version unknown — cannot verify compatibility.")
160+
elseif (ROOT_KERAS_VERSION VERSION_LESS "3.12.0")
161+
configure_file(generateKerasModels.py generateKerasModels.py COPYONLY)
162+
configure_file(scale_by_2_op.hxx scale_by_2_op.hxx COPYONLY)
163+
164+
ROOT_ADD_GTEST(TestRModelParserKeras TestRModelParserKeras.C
165+
LIBRARIES
166+
ROOTTMVASofie
167+
Python3::NumPy
168+
Python3::Python
169+
BLAS::BLAS
170+
INCLUDE_DIRS
171+
SYSTEM
172+
${CMAKE_CURRENT_BINARY_DIR}
173+
)
174+
else()
175+
message(WARNING "Keras version ${ROOT_KERAS_VERSION} is too new for the SOFIE Keras parser (>= 3.12.0)")
176+
endif()
169177
endif()
170178

171179

0 commit comments

Comments
 (0)