lite remove gvar so

This commit is contained in:
sunsuodong 2021-05-15 23:12:59 +08:00
parent 1c07ab866b
commit 120d1b0446
6 changed files with 21 additions and 17 deletions

View File

@ -229,8 +229,6 @@ elseif(WIN32)
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/mindspore_core/gvar/libmindspore_gvar.dll
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/registry/libmslite_converter_plugin_reg.dll
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${glog_LIBPATH}/../bin/libglog.dll DESTINATION ${CONVERTER_ROOT_DIR}/lib
@ -300,12 +298,9 @@ else()
if(ENABLE_CONVERTER)
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/mindspore_core/gvar/libmindspore_gvar.so
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin_reg.so
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
install(FILES ${glog_LIBPATH}/libglog.so.0.4.0
DESTINATION ${CONVERTER_ROOT_DIR}/third_party/glog/lib RENAME libglog.so.0
install(FILES ${glog_LIBPATH}/libglog.so.0.4.0 DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libglog.so.0
COMPONENT ${RUNTIME_COMPONENT_NAME})
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})

View File

@ -8,7 +8,7 @@ if("${ENABLE_HIDDEN}" STREQUAL "OFF")
string(REPLACE " -fvisibility=hidden" " -fvisibility=default" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
if(NOT(COMPILE_LITE))
if(NOT(BUILD_LITE))
add_subdirectory(mindrt)
endif()
@ -24,7 +24,7 @@ file(GLOB_RECURSE CORE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
)
file(GLOB_RECURSE PROTO_FILE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "proto/*.proto")
if(NOT(COMPILE_LITE))
if(NOT(BUILD_LITE))
ms_protobuf_generate_py(PROTO_SRCS PY_HDRS PY_PYS ${PROTO_FILE})
else()
ms_protobuf_generate(PROTO_SRCS PROTO_HDRS ${PROTO_FILE})
@ -41,7 +41,7 @@ endif()
set_property(SOURCE ${CORE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_CORE)
add_library(mindspore_core STATIC ${CORE_SRC_LIST} ${PROTO_SRCS})
target_link_libraries(mindspore_core PRIVATE mindspore_gvar)
if(NOT(COMPILE_LITE))
if(NOT(BUILD_LITE))
target_link_libraries(mindspore_core PRIVATE mindrt_mid)
endif()

View File

@ -9,7 +9,11 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wuser-defined-warnings -Winconsistent-missing-override")
endif()
add_library(mindspore_gvar SHARED ${MS_GVAR_SRC_LIST})
if(BUILD_LITE)
add_library(mindspore_gvar STATIC ${MS_GVAR_SRC_LIST})
else()
add_library(mindspore_gvar SHARED ${MS_GVAR_SRC_LIST})
endif()
if(APPLE)
set_target_properties(mindspore_gvar PROPERTIES MACOSX_RPATH ON)

View File

@ -14,8 +14,7 @@ CONVERTER="../../../build/tools/converter/converter_lite"
if [ ! -f "$CONVERTER" ]; then
if ! command -v converter_lite &> /dev/null
then
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libmindspore_gvar.so
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 6 --wildcards --no-anchored libglog.so.0
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0
if [ -f ./converter_lite ]; then
CONVERTER=./converter_lite
else

View File

@ -19,8 +19,7 @@ CONVERTER="../../../build/tools/converter/converter_lite"
if [ ! -f "$CONVERTER" ]; then
if ! command -v converter_lite &> /dev/null
then
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libmindspore_gvar.so
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 6 --wildcards --no-anchored libglog.so.0
tar -xzf ../../../../../output/mindspore-lite-*-train-linux-x64.tar.gz --strip-components 4 --wildcards --no-anchored converter_lite libglog.so.0
if [ -f ./converter_lite ]; then
CONVERTER=./converter_lite
else

View File

@ -163,11 +163,18 @@ set(TEST_LITE_SRC
${LITE_DIR}/src/common/dynamic_library_loader.cc
${LITE_DIR}/src/common/string_util.cc
${LITE_DIR}/src/common/quant_utils.cc
${LITE_DIR}/tools/common/flag_parser.cc
${LITE_DIR}/tools/benchmark/benchmark.cc
${LITE_DIR}/test/st/benchmark_test.cc
${LITE_DIR}/src/errorcode.cc
)
if(ENABLE_TOOLS)
set(TEST_LITE_SRC
${TEST_LITE_SRC}
${LITE_DIR}/tools/common/flag_parser.cc
${LITE_DIR}/tools/benchmark/benchmark.cc
${LITE_DIR}/test/st/benchmark_test.cc
)
endif()
### gpu runtime
if(SUPPORT_GPU STREQUAL opencl)
include_directories(${CMAKE_BINARY_DIR}/_deps/opencl-headers-src)