From acbb23f8a707ba7dcd5fc2f7157e20f18db43b2f Mon Sep 17 00:00:00 2001 From: wsc Date: Tue, 25 Aug 2020 14:53:59 +0800 Subject: [PATCH] Fix bug: the output folders of packages are the same. --- cmake/package_lite.cmake | 15 ++++++++------- mindspore/lite/test/run_benchmark_nets.sh | 9 +++------ mindspore/lite/tools/benchmark/CMakeLists.txt | 4 ++-- mindspore/lite/tools/converter/CMakeLists.txt | 2 +- mindspore/lite/tools/time_profile/CMakeLists.txt | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/cmake/package_lite.cmake b/cmake/package_lite.cmake index 996ea06dfc..3b295ceb6f 100644 --- a/cmake/package_lite.cmake +++ b/cmake/package_lite.cmake @@ -1,12 +1,13 @@ include(CMakePackageConfigHelpers) -set(LIB_DIR ${MAIN_DIR}/lib) -set(INC_DIR ${MAIN_DIR}/include) -set(TURBO_DIR ${MAIN_DIR}/third_party/libjpeg-turbo) -set(OPENCV_DIR ${MAIN_DIR}/third_party/opencv) -set(PROTOBF_DIR ${MAIN_DIR}/third_party/protobuf) -set(FLATBF_DIR ${MAIN_DIR}/third_party/flatbuffers) +set(LIB_DIR ${MAIN_DIR}-${COMPONENT_NAME}/lib) +set(INC_DIR ${MAIN_DIR}-${COMPONENT_NAME}/include) +set(TURBO_DIR ${MAIN_DIR}-${COMPONENT_NAME}/third_party/libjpeg-turbo) +set(OPENCV_DIR ${MAIN_DIR}-${COMPONENT_NAME}/third_party/opencv) +set(PROTOBF_DIR ${MAIN_DIR}-${COMPONENT_NAME}/third_party/protobuf) +set(FLATBF_DIR ${MAIN_DIR}-${COMPONENT_NAME}/third_party/flatbuffers) +set(LIB_DIR_RUN_X86 ${MAIN_DIR}-${RUN_X86_COMPONENT_NAME}/lib) if (BUILD_MINDDATA) install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/ DESTINATION ${INC_DIR} COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${LIB_DIR} COMPONENT ${COMPONENT_NAME}) @@ -42,7 +43,7 @@ elseif (PLATFORM_ARM32) install(DIRECTORY ${TOP_DIR}/mindspore/lite/schema/ DESTINATION ${INC_DIR}/schema COMPONENT ${COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "inner" EXCLUDE) install(DIRECTORY ${TOP_DIR}/third_party/flatbuffers/include DESTINATION ${FLATBF_DIR} COMPONENT ${COMPONENT_NAME}) else () - install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR} COMPONENT ${RUN_X86_COMPONENT_NAME}) + install(FILES ${TOP_DIR}/mindspore/lite/build/src/libmindspore-lite.so DESTINATION ${LIB_DIR_RUN_X86} COMPONENT ${RUN_X86_COMPONENT_NAME}) install(FILES ${TOP_DIR}/third_party/protobuf/build/lib/libprotobuf.so.19.0.0 DESTINATION ${PROTOBF_DIR}/lib RENAME libprotobuf.so.19 COMPONENT ${COMPONENT_NAME}) endif () diff --git a/mindspore/lite/test/run_benchmark_nets.sh b/mindspore/lite/test/run_benchmark_nets.sh index 389229ab30..76a8181041 100644 --- a/mindspore/lite/test/run_benchmark_nets.sh +++ b/mindspore/lite/test/run_benchmark_nets.sh @@ -332,16 +332,13 @@ process_unit_x86=${suffix[0]} # Unzip arm cd ${arm_path} || exit 1 -mkdir mindspore-lite-${version}-runtime-arm64-${process_unit_arm} -tar -zxf mindspore-lite-${version}-runtime-arm64-${process_unit_arm}.tar.gz -C mindspore-lite-${version}-runtime-arm64-${process_unit_arm} --strip-components 1 || exit 1 +tar -zxf mindspore-lite-${version}-runtime-arm64-${process_unit_arm}.tar.gz || exit 1 # Unzip x86 runtime and convertor cd ${convertor_path} || exit 1 -mkdir mindspore-lite-${version}-runtime-x86-${process_unit_x86} -tar -zxf mindspore-lite-${version}-runtime-x86-${process_unit_x86}.tar.gz -C mindspore-lite-${version}-runtime-x86-${process_unit_x86} --strip-components 1 || exit 1 +tar -zxf mindspore-lite-${version}-runtime-x86-${process_unit_x86}.tar.gz || exit 1 -mkdir mindspore-lite-${version}-convert-ubuntu -tar -zxf mindspore-lite-${version}-convert-ubuntu.tar.gz -C mindspore-lite-${version}-convert-ubuntu --strip-components 1 || exit 1 +tar -zxf mindspore-lite-${version}-convert-ubuntu.tar.gz || exit 1 cd ${convertor_path}/mindspore-lite-${version}-convert-ubuntu || exit 1 cp converter/converter_lite ./ || exit 1 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./lib/:./third_party/protobuf/lib diff --git a/mindspore/lite/tools/benchmark/CMakeLists.txt b/mindspore/lite/tools/benchmark/CMakeLists.txt index 8151e126ed..b369b7d1df 100644 --- a/mindspore/lite/tools/benchmark/CMakeLists.txt +++ b/mindspore/lite/tools/benchmark/CMakeLists.txt @@ -17,8 +17,8 @@ else() endif() if (PLATFORM_ARM32 OR PLATFORM_ARM64) install(TARGETS benchmark - RUNTIME DESTINATION ${MAIN_DIR}/benchmark COMPONENT ${COMPONENT_NAME}) + RUNTIME DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/benchmark COMPONENT ${COMPONENT_NAME}) else() install(TARGETS benchmark - RUNTIME DESTINATION ${MAIN_DIR}/benchmark COMPONENT ${RUN_X86_COMPONENT_NAME}) + RUNTIME DESTINATION ${MAIN_DIR}-${RUN_X86_COMPONENT_NAME}/benchmark COMPONENT ${RUN_X86_COMPONENT_NAME}) endif() diff --git a/mindspore/lite/tools/converter/CMakeLists.txt b/mindspore/lite/tools/converter/CMakeLists.txt index d98b37a6da..d6fb0e150f 100644 --- a/mindspore/lite/tools/converter/CMakeLists.txt +++ b/mindspore/lite/tools/converter/CMakeLists.txt @@ -187,5 +187,5 @@ target_link_libraries(converter_lite PRIVATE if (NOT PLATFORM_ARM64 AND NOT PLATFORM_ARM32) install(TARGETS converter_lite - RUNTIME DESTINATION ${MAIN_DIR}/converter COMPONENT ${COMPONENT_NAME}) + RUNTIME DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/converter COMPONENT ${COMPONENT_NAME}) endif () diff --git a/mindspore/lite/tools/time_profile/CMakeLists.txt b/mindspore/lite/tools/time_profile/CMakeLists.txt index dd494ae01c..af96c660f8 100644 --- a/mindspore/lite/tools/time_profile/CMakeLists.txt +++ b/mindspore/lite/tools/time_profile/CMakeLists.txt @@ -19,8 +19,8 @@ endif() if (PLATFORM_ARM32 OR PLATFORM_ARM64) install(TARGETS timeprofile - RUNTIME DESTINATION ${MAIN_DIR}/time_profile COMPONENT ${COMPONENT_NAME}) + RUNTIME DESTINATION ${MAIN_DIR}-${COMPONENT_NAME}/time_profile COMPONENT ${COMPONENT_NAME}) else() install(TARGETS timeprofile - RUNTIME DESTINATION ${MAIN_DIR}/time_profile COMPONENT ${RUN_X86_COMPONENT_NAME}) + RUNTIME DESTINATION ${MAIN_DIR}-${RUN_X86_COMPONENT_NAME}/time_profile COMPONENT ${RUN_X86_COMPONENT_NAME}) endif()