!4268 fix glog level dont work

Merge pull request !4268 from liubuyu/master
This commit is contained in:
mindspore-ci-bot 2020-08-11 20:05:03 +08:00 committed by Gitee
commit c6acafcbc6
8 changed files with 28 additions and 8 deletions

View File

@ -52,6 +52,12 @@ install(
COMPONENT mindspore COMPONENT mindspore
) )
install(
TARGETS mindspore_gvar
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if (USE_GLOG) if (USE_GLOG)
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libglog*) file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libglog*)
install( install(

View File

@ -231,6 +231,7 @@ set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${ORIGIN_PATH})
if (CMAKE_SYSTEM_NAME MATCHES "Windows") if (CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(mindspore mindspore::pybind11_module) target_link_libraries(mindspore mindspore::pybind11_module)
target_link_libraries(mindspore mindspore_gvar)
target_link_libraries(_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive) target_link_libraries(_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive)
else () else ()
if (ENABLE_CPU AND (ENABLE_D OR ENABLE_GPU)) if (ENABLE_CPU AND (ENABLE_D OR ENABLE_GPU))
@ -241,6 +242,7 @@ else ()
endif() endif()
target_link_libraries(_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive) target_link_libraries(_c_expression PRIVATE -Wl,--whole-archive mindspore -Wl,--no-whole-archive)
target_link_libraries(_c_expression PRIVATE mindspore::pybind11_module) target_link_libraries(_c_expression PRIVATE mindspore::pybind11_module)
target_link_libraries(_c_expression PRIVATE mindspore_gvar)
endif () endif ()
if (USE_GLOG) if (USE_GLOG)
@ -284,7 +286,7 @@ add_library(inference SHARED
${LOAD_ONNX_SRC} ${LOAD_ONNX_SRC}
) )
target_link_libraries(inference PRIVATE ${PYTHON_LIBRARIES} ${SECUREC_LIBRARY} target_link_libraries(inference PRIVATE ${PYTHON_LIBRARIES} ${SECUREC_LIBRARY}
-Wl,--whole-archive mindspore -Wl,--no-whole-archive mindspore::protobuf) -Wl,--whole-archive mindspore -Wl,--no-whole-archive mindspore_gvar mindspore::protobuf)
if (ENABLE_CPU) if (ENABLE_CPU)
target_link_libraries(inference PRIVATE mindspore::dnnl mindspore::mkldnn) target_link_libraries(inference PRIVATE mindspore::dnnl mindspore::mkldnn)

View File

@ -131,7 +131,7 @@ endif()
###################################################################### ######################################################################
################# Link with external libraries ######################## ################# Link with external libraries ########################
target_link_libraries(_c_dataengine PRIVATE mindspore) target_link_libraries(_c_dataengine PRIVATE mindspore mindspore_gvar)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (ENABLE_PYTHON) if (ENABLE_PYTHON)
target_link_libraries(_c_dataengine PRIVATE mindspore::pybind11_module ${PYTHON_LIBRARIES} mindspore::protobuf ${SECUREC_LIBRARY}) target_link_libraries(_c_dataengine PRIVATE mindspore::pybind11_module ${PYTHON_LIBRARIES} mindspore::protobuf ${SECUREC_LIBRARY})

View File

@ -28,9 +28,9 @@ set_target_properties(_c_mindrecord PROPERTIES
# add link library # add link library
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite mindspore mindspore::protobuf) target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite mindspore mindspore_gvar mindspore::protobuf)
else() else()
target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite ${PYTHON_LIB} ${SECUREC_LIBRARY} mindspore mindspore::protobuf) target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite ${PYTHON_LIB} ${SECUREC_LIBRARY} mindspore mindspore_gvar mindspore::protobuf)
endif() endif()
if (USE_GLOG) if (USE_GLOG)

View File

@ -1,6 +1,7 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/mindspore/core) include_directories(${CMAKE_SOURCE_DIR}/mindspore/core)
add_subdirectory(gvar)
message("************build core***************") message("************build core***************")
if (CMAKE_SYSTEM_NAME MATCHES "Windows") if (CMAKE_SYSTEM_NAME MATCHES "Windows")
@ -14,10 +15,10 @@ file(GLOB_RECURSE CORE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"c_ops/*.cc" "c_ops/*.cc"
"ir/*.cc" "ir/*.cc"
"utils/*.cc" "utils/*.cc"
"gvar/*.cc"
) )
set_property(SOURCE ${CORE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_CORE) set_property(SOURCE ${CORE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_CORE)
add_library(mindspore_core STATIC ${CORE_SRC_LIST}) add_library(mindspore_core STATIC ${CORE_SRC_LIST})
target_link_libraries(mindspore_core PRIVATE mindspore_gvar)
if (USE_GLOG) if (USE_GLOG)
target_link_libraries(mindspore_core PRIVATE mindspore::glog) target_link_libraries(mindspore_core PRIVATE mindspore::glog)
endif () endif ()

View File

@ -0,0 +1,11 @@
file(GLOB_RECURSE MS_GVAR_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cc)
set_property(SOURCE ${MS_GVAR_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_COMMON)
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -DHAVE_SNPRINTF")
add_compile_definitions(BUILDING_DLL)
endif()
add_library(mindspore_gvar SHARED ${MS_GVAR_SRC_LIST})
if (APPLE)
set_target_properties(mindspore_gvar PROPERTIES MACOSX_RPATH ON)
endif ()

View File

@ -110,5 +110,5 @@ if (ENABLE_ACL)
target_link_libraries(ms_serving ${ALC_LIB_SO}) target_link_libraries(ms_serving ${ALC_LIB_SO})
target_link_libraries(ms_serving jpeg_turbo::jpeg) target_link_libraries(ms_serving jpeg_turbo::jpeg)
else () else ()
target_link_libraries(ms_serving inference) target_link_libraries(ms_serving inference mindspore_gvar)
endif () endif ()

View File

@ -181,12 +181,12 @@ if (ENABLE_GE)
endif() endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(ut_tests PRIVATE mindspore::gtest ${PYTHON_LIBRARIES} pthread util dl) target_link_libraries(ut_tests PRIVATE mindspore::gtest mindspore_gvar ${PYTHON_LIBRARIES} pthread util dl)
if (ENABLE_MINDDATA) if (ENABLE_MINDDATA)
target_link_libraries(ut_tests PRIVATE _c_dataengine _c_mindrecord) target_link_libraries(ut_tests PRIVATE _c_dataengine _c_mindrecord)
endif() endif()
else() else()
target_link_libraries(ut_tests PRIVATE mindspore::gtest ${PYTHON_LIBRARIES}) target_link_libraries(ut_tests PRIVATE mindspore::gtest mindspore_gvar ${PYTHON_LIBRARIES})
endif() endif()
if (USE_GLOG) if (USE_GLOG)
target_link_libraries(ut_tests PRIVATE mindspore::glog) target_link_libraries(ut_tests PRIVATE mindspore::glog)