SWDEV-540176 - deb and rpm package include OpenCL config files (#615)

[ROCm/clr commit: 592c25e936]
This commit is contained in:
Xie, AlexBin
2025-06-27 11:59:24 -04:00
zatwierdzone przez GitHub
rodzic c43b8ca05c
commit a158b5c4a2
14 zmienionych plików z 72 dodań i 56 usunięć
+26 -2
Wyświetl plik
@@ -102,18 +102,42 @@ if(NOT DEFINED ROCM_PATH)
endif()
message (STATUS "ROCM Installation path(ROCM_PATH): ${ROCM_PATH}")
configure_file(
packaging/amdocl64.icd
${CMAKE_BINARY_DIR}/opencl/packages/opencl/${OPENCL_AMD_ICD_FILE}
COPYONLY
)
install(
FILES ${CMAKE_BINARY_DIR}/opencl/packages/opencl/${OPENCL_AMD_ICD_FILE}
DESTINATION /${CMAKE_INSTALL_SYSCONFDIR}/OpenCL/vendors
COMPONENT binary
EXCLUDE_FROM_ALL
)
configure_file(
packaging/rocm-opencl.conf
${CMAKE_BINARY_DIR}/opencl/packages/opencl/10-rocm-opencl.conf
COPYONLY
)
install(
FILES ${CMAKE_BINARY_DIR}/opencl/packages/opencl/10-rocm-opencl.conf
DESTINATION /${CMAKE_INSTALL_SYSCONFDIR}/ld.so.conf.d
COMPONENT binary
EXCLUDE_FROM_ALL
)
#Package: rocm-opencl,rocm-opencl-dev/devel,rocm-ocl-icd
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/opencl)
configure_file(packaging/rocm-opencl.postinst ${BUILD_DIR}/postinst @ONLY)
configure_file(packaging/rocm-opencl.prerm ${BUILD_DIR}/prerm @ONLY)
configure_file(packaging/rocm-opencl.postrm ${BUILD_DIR}/postrm @ONLY)
configure_file(packaging/rocm-opencl.rpm_post ${BUILD_DIR}/rpm_post @ONLY)
configure_file(packaging/rocm-opencl.rpm_postun ${BUILD_DIR}/rpm_postun @ONLY)
if(BUILD_ICD)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/rocm-ocl-icd)
configure_file(packaging/rocm-ocl-icd.postinst ${BUILD_DIR}/postinst @ONLY)
configure_file(packaging/rocm-ocl-icd.prerm ${BUILD_DIR}/prerm @ONLY)
configure_file(packaging/rocm-ocl-icd.postrm ${BUILD_DIR}/postrm @ONLY)
configure_file(packaging/rocm-ocl-icd.rpm_post ${BUILD_DIR}/rpm_post @ONLY)
configure_file(packaging/rocm-ocl-icd.rpm_postun ${BUILD_DIR}/rpm_postun @ONLY)
endif()
@@ -55,7 +55,7 @@ set(CPACK_DEBIAN_BINARY_PACKAGE_REPLACES "rocm-opencl-icd-loader")
set(CPACK_DEBIAN_BINARY_PACKAGE_CONFLICTS "rocm-opencl-icd-loader")
set(CPACK_RPM_BINARY_PACKAGE_OBSOLETES "rocm-opencl-icd-loader")
set(CPACK_DEBIAN_BINARY_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/opencl/packages/opencl/postinst;${CMAKE_BINARY_DIR}/opencl/packages/opencl/prerm")
set(CPACK_DEBIAN_BINARY_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/opencl/packages/opencl/postinst;${CMAKE_BINARY_DIR}/opencl/packages/opencl/postrm")
# RPM CPACK variables
set(CPACK_RPM_BINARY_POST_INSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/opencl/packages/opencl/rpm_post")
set(CPACK_RPM_BINARY_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_BINARY_DIR}/opencl/packages/opencl/rpm_postun")
@@ -124,7 +124,7 @@ if(BUILD_ICD)
set(CPACK_ICD_DEB "ON")
set(CPACK_DEBIAN_ICD_PACKAGE_NAME "rocm-ocl-icd")
set(CPACK_DEBIAN_ICD_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/opencl/packages/rocm-ocl-icd/postinst;${CMAKE_BINARY_DIR}/opencl/packages/rocm-ocl-icd/prerm")
set(CPACK_DEBIAN_ICD_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/opencl/packages/rocm-ocl-icd/postinst;${CMAKE_BINARY_DIR}/opencl/packages/rocm-ocl-icd/postrm")
set(CPACK_DEBIAN_ICD_PACKAGE_DEPENDS "rocm-core")
# RPM CPACK variables
@@ -0,0 +1 @@
libamdocl64.so
@@ -6,7 +6,6 @@ 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
mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
}
case "$1" in
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
rm_ldconfig() {
ldconfig
}
case "$1" in
purge)
;;
remove | upgrade )
rm_ldconfig
;;
*)
exit 0
;;
esac
@@ -1,19 +0,0 @@
#!/bin/bash
set -e
rm_ldconfig() {
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
}
case "$1" in
purge)
;;
remove | upgrade )
rm_ldconfig
;;
*)
exit 0
;;
esac
@@ -1,4 +1,3 @@
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
@@ -1,8 +1,5 @@
if [ $1 -eq 0 ]; then
# Remove rocm-opencl.conf during remove/uninstall operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
# ldconfig during remove/uninstall operation. No ldconfig during upgrade
ldconfig
fi
# Remove icd file for uninstall and upgrade operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
@@ -0,0 +1,3 @@
# Default value.
# It will be replaced by package script, such as postinst, during installation.
/opt/rocm/lib
@@ -7,7 +7,6 @@ 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
mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
}
case "$1" in
@@ -0,0 +1,18 @@
#!/bin/bash
set -e
rm_ldconfig() {
ldconfig
}
case "$1" in
purge)
;;
remove | upgrade )
rm_ldconfig
;;
*)
exit 0
;;
esac
@@ -1,19 +0,0 @@
#!/bin/bash
set -e
rm_ldconfig() {
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
}
case "$1" in
purge)
;;
remove | upgrade )
rm_ldconfig
;;
*)
exit 0
;;
esac
@@ -1,4 +1,3 @@
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
echo ${INSTALL_PATH}/@CMAKE_INSTALL_LIBDIR@ > /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
mkdir -p /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors && (echo libamdocl64.so > /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
@@ -1,8 +1,5 @@
if [ $1 -eq 0 ]; then
# Remove rocm-opencl.conf during remove/uninstall operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/ld.so.conf.d/10-rocm-opencl.conf && ldconfig
# ldconfig during remove/uninstall operation. No ldconfig during upgrade
ldconfig
fi
# Remove icd file for uninstall and upgrade operation
rm -f /@CMAKE_INSTALL_SYSCONFDIR@/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@