From 1d9d917015bfc795c429a6802aca5f6bb311d4a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=83=81=EA=B7=9C/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 12 Aug 2019 14:05:02 +0900 Subject: [PATCH] Print build error on TensorFlowVersionChecker build error (#6477) 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 --- infra/nncc/cmake/packages/TensorFlowConfig.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infra/nncc/cmake/packages/TensorFlowConfig.cmake b/infra/nncc/cmake/packages/TensorFlowConfig.cmake index ea76380..14d2fdf 100644 --- a/infra/nncc/cmake/packages/TensorFlowConfig.cmake +++ b/infra/nncc/cmake/packages/TensorFlowConfig.cmake @@ -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") -- 2.7.4