Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
cmake get_nvshmem.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
chuangz0 committed Nov 17, 2023
1 parent cf273c4 commit fa6325a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cud
option(BUILD_TESTS "Configure CMake to build tests" ON)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF)
option(BUILD_WITH_NVSHMEM "Enable nvshmem integration" OFF)
option(WHOLEGRAPH_EXCLUDE_NVSHMEM_FROM_ALL "Exclude nvshmem targets from wholeGraph's 'all' target" ON)

##############################################################################
# - Set options based on user defined one -----------------------------------
set(_ctk_static_suffix "")
Expand Down Expand Up @@ -292,7 +294,7 @@ set(PROGRAM_PERMISSIONS_DEFAULT

set(WHOLEGRAPH_INSTALL_LIBS wholegraph)
if(BUILD_WITH_NVSHMEM)
list(APPEND WHOLEGRAPH_INSTALL_LIBS nvshmem_wholememory_bootstrap )
list(APPEND WHOLEGRAPH_INSTALL_LIBS nvshmem_wholememory_bootstrap nvshmem_host)
endif()

install(
Expand Down
18 changes: 11 additions & 7 deletions cpp/cmake/thirdparty/get_nvshmem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ set(USE_NVSHMEM_VERSION_BRANCH 3)
function(find_and_configure_nvshmem)


set(NVSHMEM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
set(oneValueArgs VERSION VERSION_BRANCH EXCLUDE_FROM_ALL INSTALL_DIR)
cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN} )


rapids_cpm_find(nvshmem ${USE_NVSHMEM_VERSION}
rapids_cpm_find(nvshmem ${PKG_VERSION}
GLOBAL_TARGETS nvshmem::nvshmem nvshmem::nvshmem_device nvshmem::nvshmem_host
BUILD_EXPORT_SET wholegraph-exports
INSTALL_EXPORT_SET wholegraph-exports
EXCLUDE_FROM_ALL TRUE
EXCLUDE_FROM_ALL ${PKG_EXCLUDE_FROM_ALL}
CPM_ARGS
URL https://developer.download.nvidia.cn/compute/redist/nvshmem/${USE_NVSHMEM_VERSION}/source/nvshmem_src_${USE_NVSHMEM_VERSION}-${USE_NVSHMEM_VERSION_BRANCH}.txz
URL https://developer.download.nvidia.cn/compute/redist/nvshmem/${PKG_VERSION}/source/nvshmem_src_${PKG_VERSION}-${PKG_VERSION_BRANCH}.txz
OPTIONS
"NVSHMEM_IBGDA_SUPPORT ON"
"NVSHMEM_IBDEVX_SUPPORT ON"
"NVSHMEM_BUILD_EXAMPLES OFF"
"NVSHMEM_BUILD_TESTS OFF"
"NVSHMEM_PREFIX ${NVSHMEM_INSTALL_DIR}"
"NVSHMEM_PREFIX ${PKG_INSTALL_DIR}"
)


Expand All @@ -49,4 +49,8 @@ function(find_and_configure_nvshmem)
endfunction()


find_and_configure_nvshmem()
find_and_configure_nvshmem(VERSION ${USE_NVSHMEM_VERSION}
VERSION_BRANCH ${USE_NVSHMEM_VERSION_BRANCH}
EXCLUDE_FROM_ALL ${WHOLEGRAPH_EXCLUDE_NVSHMEM_FROM_ALL}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
)
2 changes: 1 addition & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function(ConfigureTestInternal TEST_NAME)
endif()

add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})

set_tests_properties(${TEST_NAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
install(
TARGETS ${TEST_NAME}
COMPONENT testing
Expand Down

0 comments on commit fa6325a

Please sign in to comment.