diff --git a/build.sh b/build.sh index 91294e10c38..4d438c614a6 100755 --- a/build.sh +++ b/build.sh @@ -588,6 +588,7 @@ build_lite() COMPILE_MINDDATA_LITE="off" CMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} CMAKE_TOOLCHAIN_NAME=${TOOLCHAIN_NAME} + CMAKE_BUILD_TYPE=${LITE_BUILD_TYPE} else CMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake ANDROID_NATIVE_API_LEVEL="19" diff --git a/mindspore/lite/src/common/dynamic_library_loader.cc b/mindspore/lite/src/common/dynamic_library_loader.cc index 5d42664ba86..1de2ec40ef3 100644 --- a/mindspore/lite/src/common/dynamic_library_loader.cc +++ b/mindspore/lite/src/common/dynamic_library_loader.cc @@ -57,7 +57,7 @@ int DynamicLibraryLoader::Open(const char *lib_path) { #endif if (handler_ == nullptr) { - LOG_ERROR("open path failed"); + LOG_ERROR("handler is nullptr."); return RET_ERROR; } return RET_OK; diff --git a/mindspore/lite/tools/converter/converter.cc b/mindspore/lite/tools/converter/converter.cc index 5242bb6d814..88ecab3165e 100644 --- a/mindspore/lite/tools/converter/converter.cc +++ b/mindspore/lite/tools/converter/converter.cc @@ -77,15 +77,16 @@ schema::MetaGraphT *Converter::Convert(const std::unique_ptr & } // load plugin + static std::vector> dl_loaders; if (!flag->pluginsPath.empty()) { - DynamicLibraryLoader dynamic_library_loader{}; for (auto &path : flag->pluginsPath) { - auto status = dynamic_library_loader.Open(path.c_str()); + auto dl_loader = std::make_shared(); + auto status = dl_loader->Open(path.c_str()); if (status != RET_OK) { MS_LOG(ERROR) << "open dynamic library failed. " << path; return nullptr; } - dynamic_library_loader.Close(); + dl_loaders.emplace_back(dl_loader); } }