From 114f93513757f6f60bf4b94dfcc3354ae2c6c2a7 Mon Sep 17 00:00:00 2001 From: Freddy Paul Date: Thu, 2 Jan 2020 11:56:05 -0800 Subject: [PATCH 1/3] Changes for multiple ROCm installation 1. Set version to 2.10.1 2. Add CMAKE_INSTALL_PREFIX to neccessary places 3. Cleanup, fix rpath, use prefix in install.sh --- CMakeLists.txt | 29 ++++++++++++++++++++++++++--- install.sh | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a68b2836c..48df16c13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(AMDGPU_TARGETS gfx900;gfx906;gfx908 CACHE STRING "List of specific machine t find_package(ROCM REQUIRED PATHS - /opt/rocm) + /opt/rocm $CMAKE_INSTALL_PREFIX) include(ROCMInstallTargets) include(ROCMPackageConfigHelpers) @@ -67,7 +67,10 @@ rocm_setup_version(VERSION "2.7.0") list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hip - /opt/rocm/hcc) + /opt/rocm/hcc + $CMAKE_INSTALL_PREFIX + $CMAKE_INSTALL_PREFIX/hip + $CMAKE_INSTALL_PREFIX/hcc) find_package(hip REQUIRED) message(STATUS "HIP compiler: ${HIP_COMPILER}") @@ -150,7 +153,7 @@ if("${HIP_COMPILER}" MATCHES "clang") target_compile_options(rccl PRIVATE --amdgpu-target=${target} PRIVATE -fgpu-rdc) endforeach() target_link_libraries(rccl PRIVATE -fgpu-rdc) - target_include_directories(rccl PRIVATE /opt/rocm/hsa/include) + target_include_directories(rccl PRIVATE /opt/rocm/hsa/include $CMAKE_INSTALL_PREFIX/hsa/include) endif() if("${HIP_COMPILER}" MATCHES "hcc") @@ -170,6 +173,26 @@ else() target_link_libraries(rccl PUBLIC hip::hip_hcc ${hcc_LIBRARIES} numa) endif() +## Set the VERSION and SOVERSION values +set (LIB_VERSION_MAJOR 1 ) +set (LIB_VERSION_MINOR 0 ) +if ( ${ROCM_PATCH_VERSION} ) + set (LIB_VERSION_PATCH ${ROCM_PATCH_VERSION} ) +else() + set (LIB_VERSION_PATCH 0 ) +endif() + +set ( LIB_VERSION_STRING "${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH}" ) +set_property ( TARGET rccl PROPERTY VERSION "${LIB_VERSION_STRING}" ) +set_property ( TARGET rccl PROPERTY SOVERSION "${LIB_VERSION_MAJOR}" ) + +## Linker Flags +## Add --enable-new-dtags to generate DT_RUNPATH +set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags" ) + +set ( CMAKE_SKIP_BUILD_RPATH TRUE ) +set ( CMAKE_INSTALL_RPATH "${ROCM_RPATH}" ) + rocm_install_targets(TARGETS rccl PREFIX diff --git a/install.sh b/install.sh index 05a2a02c1..301b230cc 100755 --- a/install.sh +++ b/install.sh @@ -80,7 +80,7 @@ while true; do esac done -rocm_path=/opt/rocm/bin +rocm_path=$install_prefix/bin # ################################################# # prep From ef647a9ec191f0a4aea013697a458f0bd4a2d2cd Mon Sep 17 00:00:00 2001 From: Freddy Paul Date: Thu, 2 Jan 2020 14:45:40 -0800 Subject: [PATCH 2/3] Changes for multiple ROCm installation 1. Set soversion to match release version 2. Add CMAKE_INSTALL_PREFIX to neccessary places 3. Cleanup, fix rpath, use prefix in install.sh --- CMakeLists.txt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48df16c13..ca5a8d1de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,18 +173,8 @@ else() target_link_libraries(rccl PUBLIC hip::hip_hcc ${hcc_LIBRARIES} numa) endif() -## Set the VERSION and SOVERSION values -set (LIB_VERSION_MAJOR 1 ) -set (LIB_VERSION_MINOR 0 ) -if ( ${ROCM_PATCH_VERSION} ) - set (LIB_VERSION_PATCH ${ROCM_PATCH_VERSION} ) -else() - set (LIB_VERSION_PATCH 0 ) -endif() - -set ( LIB_VERSION_STRING "${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH}" ) -set_property ( TARGET rccl PROPERTY VERSION "${LIB_VERSION_STRING}" ) -set_property ( TARGET rccl PROPERTY SOVERSION "${LIB_VERSION_MAJOR}" ) +#Setup librccl.so version +rocm_set_soversion(rccl "2.7") ## Linker Flags ## Add --enable-new-dtags to generate DT_RUNPATH From 00532ccdbc7f5cec7bbc2df03c8175cba2ef7b83 Mon Sep 17 00:00:00 2001 From: Freddy Paul Date: Fri, 3 Jan 2020 00:45:55 -0800 Subject: [PATCH 3/3] Changes for multiple ROCm installation 1. Set soversion to match release version 2. Add CMAKE_INSTALL_PREFIX to neccessary places 3. Cleanup, fix rpath, use prefix in install.sh --- CMakeLists.txt | 18 ++++-------------- install.sh | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca5a8d1de..b946053e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(AMDGPU_TARGETS gfx900;gfx906;gfx908 CACHE STRING "List of specific machine t find_package(ROCM REQUIRED PATHS - /opt/rocm $CMAKE_INSTALL_PREFIX) + /opt/rocm) include(ROCMInstallTargets) include(ROCMPackageConfigHelpers) @@ -67,10 +67,7 @@ rocm_setup_version(VERSION "2.7.0") list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hip - /opt/rocm/hcc - $CMAKE_INSTALL_PREFIX - $CMAKE_INSTALL_PREFIX/hip - $CMAKE_INSTALL_PREFIX/hcc) + /opt/rocm/hcc) find_package(hip REQUIRED) message(STATUS "HIP compiler: ${HIP_COMPILER}") @@ -153,7 +150,7 @@ if("${HIP_COMPILER}" MATCHES "clang") target_compile_options(rccl PRIVATE --amdgpu-target=${target} PRIVATE -fgpu-rdc) endforeach() target_link_libraries(rccl PRIVATE -fgpu-rdc) - target_include_directories(rccl PRIVATE /opt/rocm/hsa/include $CMAKE_INSTALL_PREFIX/hsa/include) + target_include_directories(rccl PRIVATE /opt/rocm/hsa/include) endif() if("${HIP_COMPILER}" MATCHES "hcc") @@ -174,14 +171,7 @@ else() endif() #Setup librccl.so version -rocm_set_soversion(rccl "2.7") - -## Linker Flags -## Add --enable-new-dtags to generate DT_RUNPATH -set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags" ) - -set ( CMAKE_SKIP_BUILD_RPATH TRUE ) -set ( CMAKE_INSTALL_RPATH "${ROCM_RPATH}" ) +rocm_set_soversion(rccl "1.0") rocm_install_targets(TARGETS rccl diff --git a/install.sh b/install.sh index 301b230cc..05a2a02c1 100755 --- a/install.sh +++ b/install.sh @@ -80,7 +80,7 @@ while true; do esac done -rocm_path=$install_prefix/bin +rocm_path=/opt/rocm/bin # ################################################# # prep