[ACL] Link system libaries correctly (#174)
author박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 23 Mar 2018 01:01:21 +0000 (10:01 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Fri, 23 Mar 2018 01:01:21 +0000 (10:01 +0900)
ARM Compute Library needs libdl and libpthread, but these libraries are
not linked, or incorrectly linked.

This commit fixes this link issue. Now, cl_convolution and
neon_convolution examples built by CMake works on ODROID.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
externals/acl.cmake

index 6ba0668..ed96b34 100644 (file)
@@ -15,6 +15,7 @@ file(GLOB_RECURSE ACL_UTIL_SRCS "${ACL_BASE}/src/core/utils/*.cpp")
 add_library(acl_foundation ${ACL_UTIL_SRCS})
 target_include_directories(acl_foundation PUBLIC "${ACL_BASE}")
 target_include_directories(acl_foundation PUBLIC "${ACL_BASE}/include")
+target_link_libraries(acl_foundation dl pthread)
 
 ###
 ### ARM Compute Library Common (Core & Runtime)
@@ -41,7 +42,7 @@ file(GLOB ACL_CORE_OPENCL_KERNEL_SRCS "${ACL_BASE}/src/core/CL/kernels/*.cpp")
 list(APPEND ACL_CORE_OPENCL_SRCS ${ACL_CORE_OPENCL_KERNEL_SRCS})
 
 add_library(acl_core_opencl ${ACL_CORE_OPENCL_SRCS})
-target_link_libraries(acl_core_opencl acl_core_common OpenCL dl)
+target_link_libraries(acl_core_opencl acl_core_common OpenCL)
 
 file(GLOB_RECURSE ACL_RUNTIME_OPENCL_SRCS "${ACL_BASE}/src/runtime/CL/*.cpp")
 
@@ -100,6 +101,7 @@ add_library(arm_compute_core SHARED ${ACL_CORE_SRCS})
 target_include_directories(arm_compute_core PUBLIC "${ACL_GENERATED}")
 target_include_directories(arm_compute_core PUBLIC "${ACL_BASE}")
 target_include_directories(arm_compute_core PUBLIC "${ACL_BASE}/include")
+target_link_libraries(arm_compute_core dl pthread)
 
 list(APPEND ACL_RUNTIME_SRCS ${ACL_RUNTIME_COMMON_SRCS})
 list(APPEND ACL_RUNTIME_SRCS ${ACL_RUNTIME_OPENCL_SRCS})