From 9a8bd9e68bd6a741b22dd9df29975151ec929aea Mon Sep 17 00:00:00 2001 From: Alex Xie Date: Fri, 29 May 2020 12:11:58 -0400 Subject: [PATCH] ROCMOPS-924 centos-6.10 support for opencl_on_rocclr build Fix a build error in centos 6.10. When linking, ld cannot find function clock_getres. This function is from librt (for glibc version before 2.17). Change-Id: I698f768d0618a054d5d0fc73b9f1916a7ce542fb --- rocclr/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rocclr/CMakeLists.txt b/rocclr/CMakeLists.txt index 540527295e..2ed0d36c3f 100644 --- a/rocclr/CMakeLists.txt +++ b/rocclr/CMakeLists.txt @@ -198,6 +198,11 @@ endif() if (UNIX) set(ROCclr_DEFAULT_INSTALL_PREFIX "/opt/rocm/rocclr") + + find_library(LIBRT rt) + if (LIBRT) + target_link_libraries(amdrocclr_static PUBLIC ${LIBRT}) + endif() endif() #comment out as it's not available in cmake 3.5 #if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)