diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt index 7b97cfdeff..9ff955c845 100644 --- a/projects/clr/opencl/CMakeLists.txt +++ b/projects/clr/opencl/CMakeLists.txt @@ -28,6 +28,10 @@ if(ENABLE_ADDRESS_SANITIZER) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -gz -Wl,--build-id=sha1 -L${ROCM_PATH}/lib/asan") endif() +if(NOT WIN32) + set(AMDOCL_INSTALL_LIBDIR ${PROJECT_NAME}) +endif() + set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/khronos/headers/opencl2.2" CACHE PATH "") if(BUILD_ICD) add_subdirectory(khronos/icd) @@ -96,11 +100,6 @@ if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) endif() set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Package Installation path for OpenCL") -#ROCM_PATH is needed to create symlink of libraries -if(NOT DEFINED ROCM_PATH) - string(REPLACE "/opencl" "" ROCM_PATH ${CPACK_PACKAGING_INSTALL_PREFIX}) -endif() -message (STATUS "ROCM Installation path(ROCM_PATH): ${ROCM_PATH}") configure_file( packaging/amdocl64.icd diff --git a/projects/clr/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/amdocl/CMakeLists.txt index cbe814a6e5..c624cbe4c7 100644 --- a/projects/clr/opencl/amdocl/CMakeLists.txt +++ b/projects/clr/opencl/amdocl/CMakeLists.txt @@ -129,5 +129,5 @@ target_link_libraries(amdocl PUBLIC rocclr) INSTALL(TARGETS amdocl COMPONENT MAIN RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${AMDOCL_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${AMDOCL_INSTALL_LIBDIR}) diff --git a/projects/clr/opencl/packaging/CMakeLists.txt b/projects/clr/opencl/packaging/CMakeLists.txt index 153210946d..62c179a07c 100644 --- a/projects/clr/opencl/packaging/CMakeLists.txt +++ b/projects/clr/opencl/packaging/CMakeLists.txt @@ -17,8 +17,8 @@ set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_RPM_COMPONENT_INSTALL ON) install(TARGETS clinfo DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT binary) -install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary) -install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT asan) +install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR}/${AMDOCL_INSTALL_LIBDIR} COMPONENT binary) +install(TARGETS amdocl DESTINATION ${CMAKE_INSTALL_LIBDIR}/${AMDOCL_INSTALL_LIBDIR} COMPONENT asan) install(FILES ${opencl_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT binary) install(FILES ${opencl_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan) diff --git a/projects/clr/opencl/packaging/rocm-ocl-icd.postinst b/projects/clr/opencl/packaging/rocm-ocl-icd.postinst index e3ba5d4900..eb0167b177 100644 --- a/projects/clr/opencl/packaging/rocm-ocl-icd.postinst +++ b/projects/clr/opencl/packaging/rocm-ocl-icd.postinst @@ -5,7 +5,7 @@ set -e INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ do_ldconfig() { - echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig + echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@/@AMDOCL_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig } case "$1" in diff --git a/projects/clr/opencl/packaging/rocm-ocl-icd.rpm_post b/projects/clr/opencl/packaging/rocm-ocl-icd.rpm_post index 8c7657e581..22e77ea003 100644 --- a/projects/clr/opencl/packaging/rocm-ocl-icd.rpm_post +++ b/projects/clr/opencl/packaging/rocm-ocl-icd.rpm_post @@ -1,3 +1,3 @@ -INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ +INSTALL_PATH=$RPM_INSTALL_PREFIX0 -echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@/@AMDOCL_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig diff --git a/projects/clr/opencl/packaging/rocm-opencl.postinst b/projects/clr/opencl/packaging/rocm-opencl.postinst index 930be229b5..55ee0208bf 100644 --- a/projects/clr/opencl/packaging/rocm-opencl.postinst +++ b/projects/clr/opencl/packaging/rocm-opencl.postinst @@ -5,7 +5,7 @@ set -e INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ do_ldconfig() { - echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig + echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@/@AMDOCL_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig } diff --git a/projects/clr/opencl/packaging/rocm-opencl.rpm_post b/projects/clr/opencl/packaging/rocm-opencl.rpm_post index 8c7657e581..22e77ea003 100644 --- a/projects/clr/opencl/packaging/rocm-opencl.rpm_post +++ b/projects/clr/opencl/packaging/rocm-opencl.rpm_post @@ -1,3 +1,3 @@ -INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@ +INSTALL_PATH=$RPM_INSTALL_PREFIX0 -echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig +echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@/@AMDOCL_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig