Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for multiple ROCm installation #164

Merged
merged 3 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
paulfreddy marked this conversation as resolved.
Show resolved Hide resolved

include(ROCMInstallTargets)
include(ROCMPackageConfigHelpers)
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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")
Expand All @@ -170,6 +173,26 @@ else()
target_link_libraries(rccl PUBLIC hip::hip_hcc ${hcc_LIBRARIES} numa)
endif()

## Set the VERSION and SOVERSION values
paulfreddy marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ while true; do
esac
done

rocm_path=/opt/rocm/bin
rocm_path=$install_prefix/bin
gilbertlee-amd marked this conversation as resolved.
Show resolved Hide resolved

# #################################################
# prep
Expand Down