From 195f04e50ea3fe67ab4b0bcf9bb906829aadc117 Mon Sep 17 00:00:00 2001 From: liubuyu Date: Wed, 5 Aug 2020 16:27:05 +0800 Subject: [PATCH] compile the core directory into a separate static library --- CMakeLists.txt | 1 + cmake/package.cmake | 6 ----- mindspore/ccsrc/CMakeLists.txt | 19 ++++----------- .../kernel_compiler/akg/akg_kernel_build.h | 1 + .../kernel_compiler/cpu/sub_cpu_kernel.cc | 3 ++- mindspore/ccsrc/gvar/CMakeLists.txt | 6 ----- .../ccsrc/minddata/dataset/CMakeLists.txt | 2 +- .../ccsrc/minddata/mindrecord/CMakeLists.txt | 4 ++-- .../ccsrc/utils/load_onnx/anf_converter.cc | 1 + mindspore/ccsrc/utils/primitive_py.cc | 1 + mindspore/ccsrc/utils/primitive_utils.cc | 1 + mindspore/core/CMakeLists.txt | 23 +++++++++++++++++++ mindspore/core/abstract/CMakeLists.txt | 3 --- mindspore/core/base/CMakeLists.txt | 3 --- mindspore/core/c_ops/CMakeLists.txt | 2 -- .../{ccsrc => core}/gvar/logging_level.cc | 0 .../{ccsrc => core}/gvar/typeid_manager.cc | 0 mindspore/core/ir/CMakeLists.txt | 3 --- mindspore/core/ir/primitive.h | 2 +- mindspore/core/utils/CMakeLists.txt | 3 --- mindspore/core/utils/label.h | 6 ++--- mindspore/core/utils/log_adapter.cc | 3 +-- mindspore/core/utils/log_adapter.h | 3 +-- mindspore/core/utils/ms_utils.h | 6 ++--- mindspore/core/utils/profile.h | 6 ++--- mindspore/lite/CMakeLists.txt | 4 ++-- mindspore/lite/minddata/CMakeLists.txt | 2 +- mindspore/lite/test/CMakeLists.txt | 4 ++-- serving/CMakeLists.txt | 2 +- tests/ut/cpp/CMakeLists.txt | 4 ++-- 30 files changed, 57 insertions(+), 67 deletions(-) delete mode 100644 mindspore/ccsrc/gvar/CMakeLists.txt create mode 100644 mindspore/core/CMakeLists.txt delete mode 100644 mindspore/core/abstract/CMakeLists.txt delete mode 100644 mindspore/core/base/CMakeLists.txt delete mode 100644 mindspore/core/c_ops/CMakeLists.txt rename mindspore/{ccsrc => core}/gvar/logging_level.cc (100%) rename mindspore/{ccsrc => core}/gvar/typeid_manager.cc (100%) delete mode 100644 mindspore/core/ir/CMakeLists.txt delete mode 100644 mindspore/core/utils/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cebff40830..2eef7107535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,7 @@ endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") add_subdirectory(mindspore/ccsrc) +add_subdirectory(mindspore/core) if (ENABLE_TESTCASES) add_subdirectory(tests) endif() diff --git a/cmake/package.cmake b/cmake/package.cmake index edc88c2b348..a57b8a130f7 100644 --- a/cmake/package.cmake +++ b/cmake/package.cmake @@ -52,12 +52,6 @@ install( COMPONENT mindspore ) -install( - TARGETS mindspore_gvar - DESTINATION ${INSTALL_LIB_DIR} - COMPONENT mindspore -) - if (USE_GLOG) file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libglog*) install( diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index d2f25c0fac1..c7b8e9f467e 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -130,7 +130,7 @@ set(SUB_COMP frontend/operator pipeline/jit pipeline/pynative - common debug gvar pybind_api utils vm + common debug pybind_api utils vm ) foreach (_comp ${SUB_COMP}) @@ -141,23 +141,14 @@ foreach (_comp ${SUB_COMP}) add_dependencies(_mindspore_${sub}_obj proto_input ) endif () endforeach () -add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/base base) -list(APPEND SUB_OBJECTS_SRC $) -add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/abstract abstract) -list(APPEND SUB_OBJECTS_SRC $) -add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/utils util) -list(APPEND SUB_OBJECTS_SRC $) -add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/ir ir) -list(APPEND SUB_OBJECTS_SRC $) -add_subdirectory(${CMAKE_SOURCE_DIR}/mindspore/core/c_ops c_ops) -list(APPEND SUB_OBJECTS_SRC $) -add_dependencies(_mindspore_core_utils_obj _mindspore_base_obj _mindspore_ir_obj _mindspore_abstract_obj _mindspore_c_ops_obj proto_input) set_property(SOURCE ${SUB_OBJECTS_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ME) add_library(mindspore STATIC ${SUB_OBJECTS_SRC}) target_link_libraries(proto_input mindspore::protobuf) +target_link_libraries(mindspore mindspore_core) + if (ENABLE_DEBUGGER) # debugger: link grpc target_link_libraries(proto_input mindspore::grpc++) @@ -244,7 +235,6 @@ set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${ORIGIN_PATH}) if (CMAKE_SYSTEM_NAME MATCHES "Windows") 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) else () if (ENABLE_CPU AND (ENABLE_D OR ENABLE_GPU)) @@ -255,7 +245,6 @@ else () endif() 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_gvar) endif () if (USE_GLOG) @@ -299,7 +288,7 @@ add_library(inference SHARED ${LOAD_ONNX_SRC} ) target_link_libraries(inference PRIVATE ${PYTHON_LIBRARIES} ${SECUREC_LIBRARY} - -Wl,--whole-archive mindspore -Wl,--no-whole-archive mindspore_gvar mindspore::protobuf) + -Wl,--whole-archive mindspore -Wl,--no-whole-archive mindspore::protobuf) if (ENABLE_CPU) target_link_libraries(inference PRIVATE mindspore::dnnl mindspore::mkldnn) diff --git a/mindspore/ccsrc/backend/kernel_compiler/akg/akg_kernel_build.h b/mindspore/ccsrc/backend/kernel_compiler/akg/akg_kernel_build.h index 41073007bcb..6b70cfad819 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/akg/akg_kernel_build.h +++ b/mindspore/ccsrc/backend/kernel_compiler/akg/akg_kernel_build.h @@ -25,6 +25,7 @@ #include "backend/kernel_compiler/kernel.h" #include "ir/dtype.h" #include "ir/primitive.h" +#include "pybind11/pybind11.h" #include #include "backend/kernel_compiler/common_utils.h" #include "backend/kernel_compiler/oplib/oplib.h" diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sub_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sub_cpu_kernel.cc index 1e759390a25..f99c53d577b 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sub_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sub_cpu_kernel.cc @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "backend/kernel_compiler/cpu/sub_cpu_kernel.h" +#include +#include #include "runtime/device/cpu/cpu_device_address.h" namespace mindspore { diff --git a/mindspore/ccsrc/gvar/CMakeLists.txt b/mindspore/ccsrc/gvar/CMakeLists.txt deleted file mode 100644 index 3ee91098326..00000000000 --- a/mindspore/ccsrc/gvar/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -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) -add_library(mindspore_gvar SHARED ${MS_GVAR_SRC_LIST}) -if (APPLE) - set_target_properties(mindspore_gvar PROPERTIES MACOSX_RPATH ON) -endif () diff --git a/mindspore/ccsrc/minddata/dataset/CMakeLists.txt b/mindspore/ccsrc/minddata/dataset/CMakeLists.txt index 81032180b69..a13121d5888 100644 --- a/mindspore/ccsrc/minddata/dataset/CMakeLists.txt +++ b/mindspore/ccsrc/minddata/dataset/CMakeLists.txt @@ -126,7 +126,7 @@ endif() ###################################################################### ################# Link with external libraries ######################## -target_link_libraries(_c_dataengine PRIVATE mindspore mindspore_gvar) +target_link_libraries(_c_dataengine PRIVATE mindspore) if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (ENABLE_PYTHON) target_link_libraries(_c_dataengine PRIVATE mindspore::pybind11_module ${PYTHON_LIBRARIES} mindspore::protobuf ${SECUREC_LIBRARY}) diff --git a/mindspore/ccsrc/minddata/mindrecord/CMakeLists.txt b/mindspore/ccsrc/minddata/mindrecord/CMakeLists.txt index 4b2a30c9f1f..5bd3752d6b3 100644 --- a/mindspore/ccsrc/minddata/mindrecord/CMakeLists.txt +++ b/mindspore/ccsrc/minddata/mindrecord/CMakeLists.txt @@ -28,9 +28,9 @@ set_target_properties(_c_mindrecord PROPERTIES # add link library if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") - target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite mindspore mindspore_gvar mindspore::protobuf) + target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite mindspore mindspore::protobuf) else() - target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite ${PYTHON_LIB} ${SECUREC_LIBRARY} mindspore mindspore_gvar mindspore::protobuf) + target_link_libraries(_c_mindrecord PRIVATE mindspore::sqlite ${PYTHON_LIB} ${SECUREC_LIBRARY} mindspore mindspore::protobuf) endif() if (USE_GLOG) diff --git a/mindspore/ccsrc/utils/load_onnx/anf_converter.cc b/mindspore/ccsrc/utils/load_onnx/anf_converter.cc index 9e8e51a46b4..f811bfe1f1b 100644 --- a/mindspore/ccsrc/utils/load_onnx/anf_converter.cc +++ b/mindspore/ccsrc/utils/load_onnx/anf_converter.cc @@ -22,6 +22,7 @@ #include #include #include +#include "utils/base_ref_extends.h" #include "utils/load_onnx/anf_model_parser.h" #include "utils/load_onnx/anf_converter.h" #include "google/protobuf/io/zero_copy_stream_impl.h" diff --git a/mindspore/ccsrc/utils/primitive_py.cc b/mindspore/ccsrc/utils/primitive_py.cc index ea15abdce9a..721f52c67f0 100644 --- a/mindspore/ccsrc/utils/primitive_py.cc +++ b/mindspore/ccsrc/utils/primitive_py.cc @@ -24,6 +24,7 @@ #include "utils/convert_utils_base.h" #include "utils/primitive_utils.h" #include "utils/base_ref_py.h" +#include "utils/base_ref_extends.h" #include "pybind_api/api_register.h" #include "pybind_api/export_flags.h" diff --git a/mindspore/ccsrc/utils/primitive_utils.cc b/mindspore/ccsrc/utils/primitive_utils.cc index 956041d8fb3..8b6b06bfcb8 100644 --- a/mindspore/ccsrc/utils/primitive_utils.cc +++ b/mindspore/ccsrc/utils/primitive_utils.cc @@ -21,6 +21,7 @@ #include "pipeline/jit/parse/python_adapter.h" #include "utils/log_adapter.h" #include "utils/ms_utils.h" +#include "utils/base_ref_extends.h" namespace mindspore { py::function GetBpropFunctionByObj(py::object obj) { diff --git a/mindspore/core/CMakeLists.txt b/mindspore/core/CMakeLists.txt new file mode 100644 index 00000000000..609fc7ac75b --- /dev/null +++ b/mindspore/core/CMakeLists.txt @@ -0,0 +1,23 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_BINARY_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/mindspore/core) +message("************build core***************") + +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -DHAVE_SNPRINTF") + add_compile_definitions(BUILDING_DLL) +endif() + +file(GLOB_RECURSE CORE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "abstract/*.cc" + "base/*.cc" + "c_ops/*.cc" + "ir/*.cc" + "utils/*.cc" + "gvar/*.cc" +) +set_property(SOURCE ${CORE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_CORE) +add_library(mindspore_core STATIC ${CORE_SRC_LIST}) +if (USE_GLOG) + target_link_libraries(mindspore_core PRIVATE mindspore::glog) +endif () diff --git a/mindspore/core/abstract/CMakeLists.txt b/mindspore/core/abstract/CMakeLists.txt deleted file mode 100644 index fa331776b34..00000000000 --- a/mindspore/core/abstract/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -file(GLOB_RECURSE _ABSTRACT_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -set_property(SOURCE ${_ABSTRACT_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ABSTRACT) -add_library(_mindspore_abstract_obj OBJECT ${_ABSTRACT_ALL_SRC_FILES}) diff --git a/mindspore/core/base/CMakeLists.txt b/mindspore/core/base/CMakeLists.txt deleted file mode 100644 index d65b91a8249..00000000000 --- a/mindspore/core/base/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -file(GLOB_RECURSE _BASE_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -set_property(SOURCE ${_BASE_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_BASE) -add_library(_mindspore_base_obj OBJECT ${_BASE_ALL_SRC_FILES}) diff --git a/mindspore/core/c_ops/CMakeLists.txt b/mindspore/core/c_ops/CMakeLists.txt deleted file mode 100644 index 04709ed6351..00000000000 --- a/mindspore/core/c_ops/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -file(GLOB_RECURSE _C_OPS_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -add_library(_mindspore_c_ops_obj OBJECT ${_C_OPS_ALL_SRC_FILES}) diff --git a/mindspore/ccsrc/gvar/logging_level.cc b/mindspore/core/gvar/logging_level.cc similarity index 100% rename from mindspore/ccsrc/gvar/logging_level.cc rename to mindspore/core/gvar/logging_level.cc diff --git a/mindspore/ccsrc/gvar/typeid_manager.cc b/mindspore/core/gvar/typeid_manager.cc similarity index 100% rename from mindspore/ccsrc/gvar/typeid_manager.cc rename to mindspore/core/gvar/typeid_manager.cc diff --git a/mindspore/core/ir/CMakeLists.txt b/mindspore/core/ir/CMakeLists.txt deleted file mode 100644 index 77bc1b7661a..00000000000 --- a/mindspore/core/ir/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -file(GLOB_RECURSE _IR_SRC_LIST ./*.cc dtype/*.cc) -set_property(SOURCE ${_IR_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_IR) -add_library(_mindspore_ir_obj OBJECT ${_IR_SRC_LIST}) diff --git a/mindspore/core/ir/primitive.h b/mindspore/core/ir/primitive.h index 2d52872eefa..be1155b40a1 100644 --- a/mindspore/core/ir/primitive.h +++ b/mindspore/core/ir/primitive.h @@ -25,7 +25,7 @@ #include "ir/dtype/type.h" #include "abstract/abstract_value.h" -#include "utils/base_ref_extends.h" +#include "base/base_ref.h" namespace mindspore { // Supported meta type diff --git a/mindspore/core/utils/CMakeLists.txt b/mindspore/core/utils/CMakeLists.txt deleted file mode 100644 index f90d1b426a3..00000000000 --- a/mindspore/core/utils/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -file(GLOB_RECURSE _UTIL_ALL_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") -set_property(SOURCE ${_UTIL_ALL_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_UTILS) -add_library(_mindspore_core_utils_obj OBJECT ${_UTIL_ALL_SRC_FILES}) diff --git a/mindspore/core/utils/label.h b/mindspore/core/utils/label.h index 62b98defd32..21f3493c367 100644 --- a/mindspore/core/utils/label.h +++ b/mindspore/core/utils/label.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef MINDSPORE_CCSRC_UTILS_LABEL_H_ -#define MINDSPORE_CCSRC_UTILS_LABEL_H_ +#ifndef MINDSPORE_CORE_UTILS_LABEL_H_ +#define MINDSPORE_CORE_UTILS_LABEL_H_ #include #include #include @@ -32,4 +32,4 @@ std::string Label(const DebugInfoPtr &debug_info, TraceLabelType trace_type = Tr } // namespace label_manage } // namespace mindspore -#endif // MINDSPORE_CCSRC_UTILS_LABEL_H_ +#endif // MINDSPORE_CORE_UTILS_LABEL_H_ diff --git a/mindspore/core/utils/log_adapter.cc b/mindspore/core/utils/log_adapter.cc index 8d91a6f7768..0c5528353b2 100644 --- a/mindspore/core/utils/log_adapter.cc +++ b/mindspore/core/utils/log_adapter.cc @@ -160,7 +160,7 @@ static std::string ExceptionTypeToString(ExceptionType type) { static const char *GetSubModuleName(SubModuleId module_id) { static const char *sub_module_names[NUM_SUBMODUES] = { "UNKNOWN", // SM_UNKNOWN - "BASE", // SM_BASE + "CORE", // SM_CORE "ANALYZER", // SM_ANALYZER "COMMON", // SM_COMMON "DEBUG", // SM_DEBUG @@ -180,7 +180,6 @@ static const char *GetSubModuleName(SubModuleId module_id) { "SESSION", // SM_SESSION "UTILS", // SM_UTILS "VM", // SM_VM - "ABSTRACT" // SM_ABSTRACT }; return sub_module_names[module_id % NUM_SUBMODUES]; diff --git a/mindspore/core/utils/log_adapter.h b/mindspore/core/utils/log_adapter.h index ce31ce9ab8e..3b760836fa4 100644 --- a/mindspore/core/utils/log_adapter.h +++ b/mindspore/core/utils/log_adapter.h @@ -103,7 +103,7 @@ enum MsLogLevel : int { DEBUG = 0, INFO, WARNING, ERROR, EXCEPTION }; enum SubModuleId : int { SM_UNKNOWN = 0, // unknown submodule - SM_BASE, // base + SM_CORE, // core SM_ANALYZER, // static analyzer SM_COMMON, // common SM_DEBUG, // debug @@ -123,7 +123,6 @@ enum SubModuleId : int { SM_SESSION, // session SM_UTILS, // utils SM_VM, // VM - SM_ABSTRACT, // abstract NUM_SUBMODUES // number of submodules }; diff --git a/mindspore/core/utils/ms_utils.h b/mindspore/core/utils/ms_utils.h index 23d08f8f281..bf85f47dc9c 100644 --- a/mindspore/core/utils/ms_utils.h +++ b/mindspore/core/utils/ms_utils.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef MINDSPORE_CCSRC_COMMON_UTILS_H_ -#define MINDSPORE_CCSRC_COMMON_UTILS_H_ +#ifndef MINDSPORE_CORE_UTILS_MS_UTILS_H_ +#define MINDSPORE_CORE_UTILS_MS_UTILS_H_ #include #include @@ -49,4 +49,4 @@ static inline int SetEnv(const char *envname, const char *envvar, int overwrite } // namespace common } // namespace mindspore -#endif // MINDSPORE_CCSRC_COMMON_UTILS_H_ +#endif // MINDSPORE_CORE_UTILS_MS_UTILS_H_ diff --git a/mindspore/core/utils/profile.h b/mindspore/core/utils/profile.h index 2e236b7f5e9..4478e236b8a 100644 --- a/mindspore/core/utils/profile.h +++ b/mindspore/core/utils/profile.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef MINDSPORE_CCSRC_UTILS_PROFILE_H_ -#define MINDSPORE_CCSRC_UTILS_PROFILE_H_ +#ifndef MINDSPORE_CORE_UTILS_PROFILE_H_ +#define MINDSPORE_CORE_UTILS_PROFILE_H_ #include #include @@ -230,4 +230,4 @@ class MsProfile { #define WITH(x) NoProfTransaction(x) - #endif -#endif // MINDSPORE_CCSRC_UTILS_PROFILE_H_ +#endif // MINDSPORE_CORE_UTILS_PROFILE_H_ diff --git a/mindspore/lite/CMakeLists.txt b/mindspore/lite/CMakeLists.txt index b11adfbbb04..10ba1130ae0 100644 --- a/mindspore/lite/CMakeLists.txt +++ b/mindspore/lite/CMakeLists.txt @@ -65,8 +65,8 @@ endif() set(ANF_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../core/ir/meta_tensor.cc - ${CCSRC_DIR}/gvar/logging_level.cc - ${CCSRC_DIR}/gvar/typeid_manager.cc + ${CORE_DIR}/gvar/logging_level.cc + ${CORE_DIR}/gvar/typeid_manager.cc ${CMAKE_CURRENT_SOURCE_DIR}/../core/base/base.cc ${CMAKE_CURRENT_SOURCE_DIR}/../core/utils/log_adapter.cc ) diff --git a/mindspore/lite/minddata/CMakeLists.txt b/mindspore/lite/minddata/CMakeLists.txt index d825f87f54d..fa769605602 100644 --- a/mindspore/lite/minddata/CMakeLists.txt +++ b/mindspore/lite/minddata/CMakeLists.txt @@ -31,7 +31,7 @@ add_library(minddata-lite SHARED ${MINDDATA_DIR}/util/path.cc ${MINDDATA_DIR}/api/transforms.cc ${CORE_DIR}/utils/log_adapter.cc - ${CCSRC_DIR}/gvar/logging_level.cc + ${CORE_DIR}/gvar/logging_level.cc ) target_link_libraries(minddata-lite diff --git a/mindspore/lite/test/CMakeLists.txt b/mindspore/lite/test/CMakeLists.txt index 868b7ed6a58..877af06249a 100644 --- a/mindspore/lite/test/CMakeLists.txt +++ b/mindspore/lite/test/CMakeLists.txt @@ -9,8 +9,8 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/dependency_gtest.cmake) ### anf src set(ANF_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../core/ir/meta_tensor.cc - ${CCSRC_DIR}/gvar/logging_level.cc - ${CCSRC_DIR}/gvar/typeid_manager.cc + ${CORE_DIR}/gvar/logging_level.cc + ${CORE_DIR}/gvar/typeid_manager.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../core/base/base.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../core/utils/log_adapter.cc ) diff --git a/serving/CMakeLists.txt b/serving/CMakeLists.txt index 8b60168228a..91a9cd678a2 100644 --- a/serving/CMakeLists.txt +++ b/serving/CMakeLists.txt @@ -110,5 +110,5 @@ if (ENABLE_ACL) target_link_libraries(ms_serving ${ALC_LIB_SO}) target_link_libraries(ms_serving jpeg_turbo::jpeg) else () - target_link_libraries(ms_serving inference mindspore_gvar) + target_link_libraries(ms_serving inference) endif () diff --git a/tests/ut/cpp/CMakeLists.txt b/tests/ut/cpp/CMakeLists.txt index eddf8f66ba1..3d2c29d0677 100644 --- a/tests/ut/cpp/CMakeLists.txt +++ b/tests/ut/cpp/CMakeLists.txt @@ -180,12 +180,12 @@ if (ENABLE_GE) endif() if (CMAKE_SYSTEM_NAME MATCHES "Linux") - target_link_libraries(ut_tests PRIVATE mindspore::gtest mindspore_gvar ${PYTHON_LIBRARIES} pthread util dl) + target_link_libraries(ut_tests PRIVATE mindspore::gtest ${PYTHON_LIBRARIES} pthread util dl) if (ENABLE_MINDDATA) target_link_libraries(ut_tests PRIVATE _c_dataengine _c_mindrecord) endif() else() - target_link_libraries(ut_tests PRIVATE mindspore::gtest mindspore_gvar ${PYTHON_LIBRARIES}) + target_link_libraries(ut_tests PRIVATE mindspore::gtest ${PYTHON_LIBRARIES}) endif() if (USE_GLOG) target_link_libraries(ut_tests PRIVATE mindspore::glog)