From 0aa8881a16fb5e4398e24e57862267f79808901d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Thu, 19 Dec 2019 19:06:25 +0800 Subject: [PATCH] fix cmake flaws, test=develop (#2468) --- cmake/cudnn.cmake | 7 +++---- lite/tools/debug/CMakeLists.txt | 9 +++++---- lite/tools/debug/debug_utils.h | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmake/cudnn.cmake b/cmake/cudnn.cmake index 574baa86a8..e5f1ec4cf2 100644 --- a/cmake/cudnn.cmake +++ b/cmake/cudnn.cmake @@ -32,10 +32,9 @@ list(APPEND CUDNN_CHECK_LIBRARY_DIRS $ENV{CUDNN_ROOT}/lib64 $ENV{CUDNN_ROOT}/lib /usr/lib - ${CUDA_TOOLKIT_ROOT_DIR} - ${CUDA_TOOLKIT_ROOT_DIR}/lib/x64 - ${CUDA_TOOLKIT_ROOT_DIR}/lib64 - ) + ${CUDA_TOOLKIT_ROOT_DIR} + ${CUDA_TOOLKIT_ROOT_DIR}/lib/x64 + ${CUDA_TOOLKIT_ROOT_DIR}/lib64) if((${CUDA_VERSION} GREATER 10.0) OR (${CUDA_VERSION} EQUAL 10.0)) find_library(CUBLAS_LIBRARY NAMES libcublas.so PATHS ${CUDNN_CHECK_LIBRARY_DIRS} NO_DEFAULT_PATH) diff --git a/lite/tools/debug/CMakeLists.txt b/lite/tools/debug/CMakeLists.txt index 43c0812ab9..a82c154050 100644 --- a/lite/tools/debug/CMakeLists.txt +++ b/lite/tools/debug/CMakeLists.txt @@ -1,7 +1,9 @@ -lite_cc_library(debug_utils SRCS debug_utils.cc DEPS op_params model_parser) +if(NOT LITE_ON_MODEL_OPTIMIZE_TOOL) + return() +endif() -if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK OR LITE_ON_MODEL_OPTIMIZE_TOOL) - lite_cc_binary(lite_model_debug_tool SRCS model_debug_tool.cc +lite_cc_library(debug_utils SRCS debug_utils.cc DEPS op_params model_parser) +lite_cc_binary(lite_model_debug_tool SRCS model_debug_tool.cc DEPS cxx_api debug_utils @@ -16,4 +18,3 @@ if(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK OR LITE_ON_MODEL_OPTIMIZE_TOOL) XPU_DEPS ${xpu_kernels} FPGA_DEPS ${fpga_kernels} CL_DEPS ${opencl_kernels}) -endif() diff --git a/lite/tools/debug/debug_utils.h b/lite/tools/debug/debug_utils.h index 9cc283ecc2..d2659c2c7f 100644 --- a/lite/tools/debug/debug_utils.h +++ b/lite/tools/debug/debug_utils.h @@ -27,7 +27,7 @@ #include "lite/model_parser/pb/var_desc.h" #include "lite/utils/all.h" -DEFINE_string(model_path, "", "Model dir path"); +DEFINE_string(model_dir, "", "Model dir path"); DEFINE_string(input_file, "", "Input datas file path"); DEFINE_string(topo_output_file, "", "Runtime topology order output file path"); DEFINE_bool(output_topo, true, "Dump runtime topology or not"); @@ -185,7 +185,7 @@ void ParseConfig(DebugConfig* conf) { CHECK(conf); #define CHECK_NON_EMPTY(name__) \ CHECK(!FLAGS_##name__.empty()) << "Option " << #name__ << " can't be empty." - CHECK_NON_EMPTY(model_path); + CHECK_NON_EMPTY(model_dir); if (FLAGS_output_topo) { CHECK_NON_EMPTY(topo_output_file); } @@ -193,7 +193,7 @@ void ParseConfig(DebugConfig* conf) { CHECK_NON_EMPTY(tensor_output_file); } #undef CHECK_NON_EMPTY - conf->model_dir = FLAGS_model_path; + conf->model_dir = FLAGS_model_dir; conf->topo_output_file = FLAGS_topo_output_file; conf->tensor_output_file = FLAGS_tensor_output_file; conf->input_file = FLAGS_input_file; -- GitLab