diff --git a/CMakeLists.txt b/CMakeLists.txt index dbe84b4..3e25ec2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ if (ENABLE_OPEN_SRC) endif() set(GE_LIB_PATH ${GE_LIB_PATH}/${GE_SYS_ARCH}) find_module(slog libslog.so ${GE_LIB_PATH}) - find_module(mmpa libmmpa.so ${GE_LIB_PATH}) + find_module(static_mmpa libmmpa.a ${GE_LIB_PATH}) find_module(error_manager liberror_manager.so ${GE_LIB_PATH}) else() if(DEFINED ENV{ASCEND_CUSTOM_PATH}) @@ -42,7 +42,7 @@ if (ENABLE_OPEN_SRC) set(ASCEND_ATC_DIR ${ASCEND_DIR}/atc/lib64) find_module(slog libslog.so ${ASCEND_ATC_DIR}) - find_module(mmpa libmmpa.so ${ASCEND_ATC_DIR}) + find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) endif() diff --git a/metadef b/metadef index 1b09ed0..6bdf2e3 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 1b09ed04b6dd22d1aed1bee92fd42736c0fafc65 +Subproject commit 6bdf2e3011150b200fdcd2acd18b7186902534b6 diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index 6419f74..35ce7fa 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -92,6 +92,7 @@ target_include_directories(fmk_parser PRIVATE target_link_libraries(fmk_parser $ + static_mmpa -Wl,--no-as-needed ascend_protobuf error_manager @@ -101,10 +102,10 @@ target_link_libraries(fmk_parser _caffe_parser c_sec slog - mmpa -Wl,--as-needed json -lrt + -ldl ) ################################################################## diff --git a/parser/caffe/caffe_parser.cc b/parser/caffe/caffe_parser.cc index 5c48a0b..28fafbd 100644 --- a/parser/caffe/caffe_parser.cc +++ b/parser/caffe/caffe_parser.cc @@ -538,7 +538,7 @@ Status CaffeModelParser::ReadModelWithoutWarning(const char *model_path, google: return FAILED; } - int32_t fd = mmOpen(kDevNull, O_RDWR); + int32_t fd = mmOpen(kDevNull, M_RDWR); if (fd < 0) { (void)mmClose(copy_fd); ErrorManager::GetInstance().ATCReportErrMessage("E19001", {"file", "errmsg"}, {kDevNull, strerror(errno)}); diff --git a/parser/common/CMakeLists.txt b/parser/common/CMakeLists.txt index dcfc5a5..7471782 100644 --- a/parser/common/CMakeLists.txt +++ b/parser/common/CMakeLists.txt @@ -75,13 +75,13 @@ target_include_directories(parser_common PRIVATE target_link_libraries(parser_common PRIVATE $ + static_mmpa -Wl,--no-as-needed graph ascend_protobuf register c_sec slog - mmpa error_manager -Wl,--as-needed json diff --git a/parser/common/module.mk b/parser/common/module.mk index 79210c5..3dd4e0d 100644 --- a/parser/common/module.mk +++ b/parser/common/module.mk @@ -94,11 +94,12 @@ LOCAL_SHARED_LIBRARIES := \ libascend_protobuf \ libslog \ libgraph \ - libmmpa \ libc_sec \ liberror_manager \ libregister \ +LOCAL_STATIC_LIBRARIES += libmmpa + LOCAL_LDFLAGS := -lrt -ldl include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/parser/module.mk b/parser/module.mk index 8847790..fdd61a5 100644 --- a/parser/module.mk +++ b/parser/module.mk @@ -115,7 +115,6 @@ LOCAL_C_INCLUDES := $(COMMON_LOCAL_C_INCLUDES) LOCAL_SHARED_LIBRARIES := \ libascend_protobuf \ libslog \ - libmmpa \ libc_sec \ liberror_manager \ libparser_common \ @@ -123,7 +122,9 @@ LOCAL_SHARED_LIBRARIES := \ libregister \ lib_caffe_parser \ -LOCAL_LDFLAGS := -lrt +LOCAL_STATIC_LIBRARIES += libmmpa + +LOCAL_LDFLAGS := -lrt -ldl include $(BUILD_HOST_SHARED_LIBRARY) diff --git a/parser/onnx/CMakeLists.txt b/parser/onnx/CMakeLists.txt index 82dc484..10243a1 100644 --- a/parser/onnx/CMakeLists.txt +++ b/parser/onnx/CMakeLists.txt @@ -62,6 +62,7 @@ target_include_directories(fmk_onnx_parser PRIVATE target_link_libraries(fmk_onnx_parser PRIVATE $ + static_mmpa -Wl,--no-as-needed ascend_protobuf register @@ -69,10 +70,10 @@ target_link_libraries(fmk_onnx_parser PRIVATE parser_common graph slog - mmpa -Wl,--as-needed json -lrt + -ldl ) ############ install ############ diff --git a/parser/onnx/module.mk b/parser/onnx/module.mk index 3ba1f91..f3b4ee1 100644 --- a/parser/onnx/module.mk +++ b/parser/onnx/module.mk @@ -46,12 +46,13 @@ LOCAL_C_INCLUDES := \ LOCAL_SHARED_LIBRARIES := \ libascend_protobuf \ libslog \ - libmmpa \ libc_sec \ libparser_common \ libgraph \ libregister \ -LOCAL_LDFLAGS := -lrt +LOCAL_STATIC_LIBRARIES += libmmpa + +LOCAL_LDFLAGS := -lrt -ldl include $(BUILD_HOST_SHARED_LIBRARY)