Fix linking error on arm compute library (#1456)
author이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Thu, 31 May 2018 01:24:25 +0000 (10:24 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Thu, 31 May 2018 01:24:25 +0000 (10:24 +0900)
Recently introduced `ARMCompute` removed link to dl and pthread.
So it produces linking error like following:

```
arm-linux-gnueabihf/bin/ld:
warning: libdl.so.2, needed by
/home/brian/z/nnfw/Product/armv7l-linux.debug/out/lib/libarm_compute.so,
not found (try using -rpath or -rpath-link)
/home/brian/z/nnfw/Product/armv7l-linux.debug/out/lib/libarm_compute_core.so:
undefined reference to `dlopen@GLIBC_2.4'
/home/brian/z/nnfw/Product/armv7l-linux.debug/out/lib/libarm_compute_core.so:
undefined reference to `dlsym@GLIBC_2.4'
/home/brian/z/nnfw/Product/armv7l-linux.debug/out/lib/libarm_compute_core.so:
undefined reference to `dlerror@GLIBC_2.4'
collect2: error: ld returned 1 exit status
```

By specifying dl and pthread as dependency of arm_compute_xxx, the
linking error could be fixed.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
cmake/packages/ARMComputeConfig.cmake

index 2aa4cc1..b542438 100644 (file)
@@ -57,6 +57,7 @@ function(_ARMCompute_Import)
   if(NOT TARGET arm_compute_core)
     add_library(arm_compute_core INTERFACE)
     target_include_directories(arm_compute_core INTERFACE ${INCLUDE_DIR})
+    target_link_libraries(arm_compute_core INTERFACE dl pthread)
     target_link_libraries(arm_compute_core INTERFACE ${CORE_LIBRARY})
     if (${TARGET_OS} STREQUAL "tizen")
       target_link_libraries(arm_compute_core INTERFACE OpenCL)