[neurun] Show dlerror on dlopen/dlsym failure (#6632)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Wed, 14 Aug 2019 11:22:11 +0000 (20:22 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 14 Aug 2019 11:22:11 +0000 (20:22 +0900)
Show dlerror on dlopen/dlsym failure

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/include/NeuralNetworksLoadHelpers.h

index eeef2b5..fe9c8e2 100644 (file)
@@ -80,6 +80,7 @@ inline void* loadLibrary(const char* name) {
   handle = dlopen(name, RTLD_LAZY | RTLD_LOCAL);
   if (handle == nullptr) {
     NNAPI_LOG("nnapi error: unable to open library %s", name);
+    NNAPI_LOG("             %s", dlerror());
   }
 #endif
   return handle;
@@ -106,6 +107,7 @@ inline void* loadFunction(const char* name) {
   }
   if (fn == nullptr) {
     NNAPI_LOG("nnapi error: unable to open function %s", name);
+    NNAPI_LOG("             %s", dlerror());
     abort();
   }
   else {