From e4e4e914974eb7f17a0de0ef724cd9e459cd5a4c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Dec 2022 14:16:18 +0800 Subject: [PATCH] fix a cmakelist bug, find python first then find TF --- source/CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index bfb05c617c..d86d1dd24c 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -108,6 +108,11 @@ else() message(STATUS "Will not build AMD GPU support") endif (USE_ROCM_TOOLKIT) +# setup tensorflow libraries by python +if (USE_TF_PYTHON_LIBS) + find_package (Python COMPONENTS Interpreter Development REQUIRED) +endif(USE_TF_PYTHON_LIBS) + #define USE_ASCEND, find tensorflow abi info if (USE_ASCEND) add_definitions("-DHUAWEI_ASCEND") @@ -154,14 +159,6 @@ endif(USE_ASCEND AND BUILD_CPP_IF) set(DEEPMD_SOURCE_DIR ${PROJECT_SOURCE_DIR}/..) -# setup tensorflow libraries by python -if (USE_TF_PYTHON_LIBS) - find_package (Python COMPONENTS Interpreter Development REQUIRED) -endif(USE_TF_PYTHON_LIBS) - -# find tensorflow, I need tf abi info -find_package(tensorflow REQUIRED) - # find threads find_package(Threads)