From a7252008924e9a0d03edeb2d691b88c146c6fd39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=83=81=EA=B7=9C/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Principal=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Thu, 31 May 2018 10:24:25 +0900 Subject: [PATCH] Fix linking error on arm compute library (#1456) 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 --- cmake/packages/ARMComputeConfig.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/packages/ARMComputeConfig.cmake b/cmake/packages/ARMComputeConfig.cmake index 2aa4cc1..b542438 100644 --- a/cmake/packages/ARMComputeConfig.cmake +++ b/cmake/packages/ARMComputeConfig.cmake @@ -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) -- 2.7.4