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

[REVIEW] Add RMM_INCLUDE and RMM_LIBRARY options to allow linking to non-conda RMM #13

Merged
merged 2 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## New Features

## Improvements
- PR #13: Add RMM_INCLUDE and RMM_LIBRARY options to allow linking to non-conda RMM

## Bug Fixes

Expand Down
24 changes: 21 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ set(CMAKE_CUDA_FLAGS

include(cmake/Dependencies.cmake)

###################################################################################################
# - RMM -------------------------------------------------------------------------------------------

find_path(RMM_INCLUDE "rmm"
HINTS "$ENV{RMM_ROOT}/include")

find_library(RMM_LIBRARY "rmm"
HINTS "$ENV{RMM_ROOT}/lib" "$ENV{RMM_ROOT}/build")

message(STATUS "RMM: RMM_LIBRARY set to ${RMM_LIBRARY}")
message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}")

add_library(rmm SHARED IMPORTED ${RMM_LIBRARY})
if(RMM_INCLUDE AND RMM_LIBRARY)
set_target_properties(rmm PROPERTIES IMPORTED_LOCATION ${RMM_LIBRARY})
endif(RMM_INCLUDE AND RMM_LIBRARY)

##############################################################################
# - include paths ------------------------------------------------------------

Expand All @@ -170,10 +187,11 @@ set(RAFT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE STRING

set(RAFT_INCLUDE_DIRECTORIES
${RAFT_INCLUDE_DIR}
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
"${RMM_INCLUDE}")

if(DEFINED ENV{CONDA_PREFIX})
message(STATUS "Using RMM installation froM $ENV{CONDA_PREFIX}")
message(STATUS "Using RMM installation from $ENV{CONDA_PREFIX}")
list(APPEND RAFT_INCLUDE_DIRECTORIES $ENV{CONDA_PREFIX}/include)
endif(DEFINED ENV{CONDA_PREFIX})

Expand All @@ -187,7 +205,7 @@ set(RAFT_LINK_LIBRARIES
${CUDA_cusparse_LIBRARY}
rmm)

set(RAFT_LINK_DIRECTORIES "")
set(RAFT_LINK_DIRECTORIES "${RMM_LIBRARY}")

if(DEFINED ENV{CONDA_PREFIX})
list(APPEND RAFT_LINK_DIRECTORIES $ENV{CONDA_PREFIX}/lib)
Expand Down