Skip to content

Commit

Permalink
Add patch to respect no-versioned-soname.
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Mar 12, 2024
1 parent 4ee722d commit a9ee7bc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function apply_patch() {

stash_changes clr
apply_patch clr clr-disable-hipconfig-check.patch
apply_patch clr clr-respect-no-versioned-soname.patch

stash_changes rocm-cmake
apply_patch rocm-cmake rocm-cmake-nocheck.patch
Expand Down
34 changes: 34 additions & 0 deletions patches/clr-respect-no-versioned-soname.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/hipamd/packaging/CMakeLists.txt b/hipamd/packaging/CMakeLists.txt
index 73ae1baad..76e359e22 100644
--- a/hipamd/packaging/CMakeLists.txt
+++ b/hipamd/packaging/CMakeLists.txt
@@ -42,16 +42,23 @@ set(CPACK_RPM_PACKAGE_LICENSE "MIT")
#Begin binary files install
if(HIP_PLATFORM STREQUAL "amd" )
if(BUILD_SHARED_LIBS)
+ # Note: This is not locally built. It is downloaded and included.
install(PROGRAMS ${PROJECT_BINARY_DIR}/libamdhip64.so.5 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary OPTIONAL)
+
+ # Locally built libraries must respect the CMAKE_PLATFORM_NO_VERSIONED_SONAME
+ # setting. Note that the better way to do this would be to install the
+ # targets and let CMake distinghuish (would also work on Windows).
install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libamdhip64.so DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libamdhip64.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libamdhip64.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc.so DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc-builtins.so DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc-builtins.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
- install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc-builtins.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ if(NOT CMAKE_PLATFORM_NO_VERSIONED_SONAME)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc-builtins.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc-builtins.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libhiprtc.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libamdhip64.so.${HIP_LIB_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/libamdhip64.so.${HIP_LIB_VERSION_STRING} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT binary)
+ endif()
# Add libraries to asan package
install(DIRECTORY ${PROJECT_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT asan
PATTERN ".hipInfo" EXCLUDE)
3 changes: 1 addition & 2 deletions python_projects/runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ requires = [
"setuptools>=62.3",
"wheel",
"cmake",
# TODO: Re-enable for real.
#"ninja",
"ninja",
# ROCM requires this.
"CppHeaderParser",
]
Expand Down

0 comments on commit a9ee7bc

Please sign in to comment.