Skip to content

Commit

Permalink
Merge pull request #4 from dantegd/use_rapids_cmake
Browse files Browse the repository at this point in the history
Update setuputils to deduce cugraph minor/major version from cmakelists to allow dynamic pinning of RAFT
  • Loading branch information
robertmaynard authored May 19, 2021
2 parents e1b817c + a854c21 commit df668d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ function(find_and_configure_raft)
endfunction()

set(CUGRAPH_MIN_VERSION_raft "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00")
set(CUGRAPH_BRANCH_VERSION_raft "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}")


# Change pinned tag and fork here to test a commit in CI
# To use a different RAFT locally, set the CMake variable
# RPM_raft_SOURCE=/path/to/local/raft
find_and_configure_raft(VERSION ${CUGRAPH_MIN_VERSION_raft}
FORK rapidsai
PINNED_TAG branch-21.06
PINNED_TAG branch-${CUGRAPH_BRANCH_VERSION_raft}
)

10 changes: 10 additions & 0 deletions python/setuputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ def get_repo_cmake_info(names, file_path):
tag = re.findall(r'\s.*PINNED_TAG.*', s)
tag = tag[-1].split()[-1]
results[name] = [repo, tag]
if tag == 'branch-${CUGRAPH_BRANCH_VERSION_raft}':
loc = _get_repo_path() + '/cpp/CMakeLists.txt'
with open(loc) as f:
cmakelists = f.read()
tag = re.findall(r'\s.*project\(CUGRAPH VERSION.*', cmakelists)
print(tag)
tag = tag[-1].split()[2].split('.')
tag = 'branch-{}.{}'.format(tag[0], tag[1])

results[name] = [repo, tag]

return results

Expand Down

0 comments on commit df668d2

Please sign in to comment.