Print build error on TensorFlowVersionChecker build error (#6477)
author이상규/On-Device Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Mon, 12 Aug 2019 05:05:02 +0000 (14:05 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 12 Aug 2019 05:05:02 +0000 (14:05 +0900)
TensorFlowConfig.cmake checks running result only.

When prebuilt libtensorflow library is built from Ubuntu 18.04,
 and nncc is going to be built on Ubuntu 16.04, it says:

"you need tensorflow version 1.12.0".

This patch will check build error also.
Then, it prints error message to guide the developers
to use libtensorflow built on same version of Ubuntu.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
infra/nncc/cmake/packages/TensorFlowConfig.cmake

index ea76380..14d2fdf 100644 (file)
@@ -23,6 +23,13 @@ function(_TensorFlow_import)
     LINK_LIBRARIES ${TensorFlow_LIB}
     ARGS ${TENSORFLOW_VERSION_REQUIRED})
 
+  if(NOT COMPILE_RESULT_VAR)
+    message(STATUS "Failed to build TensorFlowVersionChecker. Your libtensorflow may be built on different version of Ubuntu.")
+    message(STATUS "Found TensorFlow: FALSE")
+    set(TensorFlow_FOUND FALSE PARENT_SCOPE)
+    return()
+  endif(NOT COMPILE_RESULT_VAR)
+
   if(NOT RUN_RESULT_VAR EQUAL 0)
     message(STATUS "you need tensorflow version ${TENSORFLOW_VERSION_REQUIRED}")
     message(STATUS "Found TensorFlow: FALSE")