提交 cfe9b3c5 编写于 作者: S storypku 提交者: Liu Jiaming

Cyber: bugfix for SharedLibrary's dlopen operations

Or else, running "mainboard -d modules/planning/dag/planning.dag"
will complains:

INTEL MKL ERROR: /usr/local/lib/libmkl_avx2.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.
上级 d809e21b
......@@ -29,6 +29,8 @@ namespace apollo {
namespace cyber {
namespace class_loader {
std::mutex SharedLibrary::mutex_;
SharedLibrary::SharedLibrary(const std::string& path) { Load(path, 0); }
SharedLibrary::SharedLibrary(const std::string& path, int flags) {
......@@ -43,9 +45,9 @@ void SharedLibrary::Load(const std::string& path, int flags) {
int real_flag = RTLD_LAZY;
if (flags & SHLIB_LOCAL) {
real_flag |= SHLIB_LOCAL;
real_flag |= RTLD_LOCAL;
} else {
real_flag |= SHLIB_GLOBAL;
real_flag |= RTLD_GLOBAL;
}
handle_ = dlopen(path.c_str(), real_flag);
if (!handle_) {
......
......@@ -114,7 +114,7 @@ class SharedLibrary {
private:
void* handle_ = nullptr;
std::string path_;
std::mutex mutex_;
static std::mutex mutex_;
};
} // namespace class_loader
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册