Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghwak committed Jun 19, 2020
2 parents ead3a71 + 89f66a5 commit fed4cf2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- PR #941 Regression python/cudf fix
- PR #945 Simplified benchmark --no-rmm-reinit option, updated default options
- PR #946 Install meta packages for dependencies
- PR #953 fix setting RAFT_DIR from the RAFT_PATH env var
- PR #954 Update cuGraph error handling to use RAFT

## Bug Fixes
Expand Down Expand Up @@ -98,6 +99,7 @@
- PR #923 Updated pagerank with @afender 's temp fix for double-free crash
- PR #928 Fix scikit learn test install to work with libgcc-ng 7.3
- PR 935 Merge
- PR #956 Use new gpuCI image in local build script

# cuGraph 0.13.0 (31 Mar 2020)

Expand Down
4 changes: 2 additions & 2 deletions ci/local/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DOCKER_IMAGE="gpuci/rapidsai-base:cuda10.0-ubuntu16.04-gcc5-py3.6"
DOCKER_IMAGE="gpuci/rapidsai:cuda10.0-ubuntu16.04-gcc5-py3.6"
REPO_PATH=${PWD}
RAPIDS_DIR_IN_CONTAINER="/rapids"
CPP_BUILD_DIR="cpp/build"
Expand Down Expand Up @@ -139,4 +139,4 @@ docker run --rm -it ${GPU_OPTS} \
-v "$PASSWD_FILE":/etc/passwd:ro \
-v "$GROUP_FILE":/etc/group:ro \
--cap-add=SYS_PTRACE \
"${DOCKER_IMAGE}" bash -c "${COMMAND}"
"${DOCKER_IMAGE}" bash -c "${COMMAND}"
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ endif(NOT NCCL_PATH)
if(DEFINED ENV{RAFT_PATH})
message(STATUS "RAFT_PATH environment variable detected.")
message(STATUS "RAFT_DIR set to $ENV{RAFT_PATH}")
set(RAFT_DIR ENV{RAFT_PATH})
set(RAFT_DIR "$ENV{RAFT_PATH}")

ExternalProject_Add(raft
DOWNLOAD_COMMAND ""
Expand Down
58 changes: 42 additions & 16 deletions python/setuputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import sys
import warnings

from pathlib import Path


def get_environment_option(name):
ENV_VARIABLE = os.environ.get(name, False)
Expand Down Expand Up @@ -73,6 +75,8 @@ def use_raft_package(raft_path, cpp_build_path,
"""
Function to use the python code in RAFT in package.raft
- If RAFT symlink already exists, don't change anything. Use setup.py clean
if you want to change RAFT location.
- Uses RAFT located in $RAFT_PATH if $RAFT_PATH exists.
- Otherwise it will look for RAFT in the libcugraph build folder,
located either in the default location ../cpp/build or in
Expand All @@ -86,38 +90,55 @@ def use_raft_package(raft_path, cpp_build_path,
Path to the C++ include folder of RAFT
"""

if not raft_path:
if os.path.islink('cugraph/raft'):
raft_path = os.path.realpath('cugraph/raft')
# walk up two dirs from `python/raft`
raft_path = os.path.join(raft_path, '..', '..')
print("-- Using existing RAFT folder")
elif isinstance(raft_path, (str, os.PathLike)):
print('-- Using RAFT_PATH argument')
elif os.environ.get('RAFT_PATH', False) is not False:
raft_path = str(os.environ['RAFT_PATH'])
print('-- Using RAFT_PATH environment variable')
else:
raft_path, raft_cloned = \
clone_repo_if_needed('raft', cpp_build_path,
git_info_file=git_info_file)
raft_path = os.path.join('../', raft_path)

else:
print("-- Using RAFT_PATH variable, RAFT found at " +
str(os.environ['RAFT_PATH']))
raft_path = os.environ['RAFT_PATH']
raft_path = os.path.realpath(raft_path)
print('-- RAFT found at: ' + str(raft_path))

try:
os.symlink('../' + raft_path + 'python/raft', 'cugraph/raft')
os.symlink(
os.path.join(raft_path, 'python/raft'),
os.path.join('cugraph/raft')
)
except FileExistsError:
os.remove('cugraph/raft')
os.symlink('../' + raft_path + 'python/raft', 'cugraph/raft')
os.remove(os.path.join('cugraph/raft'))
os.symlink(
os.path.join(raft_path, 'python/raft'),
os.path.join('cugraph/raft')
)

return raft_path + 'cpp/include'
return os.path.join(raft_path, 'cpp/include')


def clone_repo_if_needed(name, cpp_build_path,
git_info_file='../cpp/cmake/Dependencies.cmake'):
if cpp_build_path:
cpp_build_path = '../' + cpp_build_path
else:
cpp_build_path = '../cpp/build/'
def clone_repo_if_needed(name, cpp_build_path=None,
git_info_file=None):
if git_info_file is None:
git_info_file = _get_repo_path() + '/cpp/CMakeLists.txt'

if cpp_build_path is None or cpp_build_path is False:
cpp_build_path = _get_repo_path() + '/cpp/build/'

repo_cloned = get_submodule_dependency(name,
cpp_build_path=cpp_build_path,
git_info_file=git_info_file)

if repo_cloned:
repo_path = '_external_repositories/' + name + '/'
repo_path = (
_get_repo_path() + '/python/_external_repositories/' + name + '/')
else:
repo_path = os.path.join(cpp_build_path, name + '/src/' + name + '/')

Expand Down Expand Up @@ -257,3 +278,8 @@ def get_repo_cmake_info(names, file_path):
results[name] = res

return results


def _get_repo_path():
python_dir = Path(__file__).resolve()
return str(python_dir.parent.parent.absolute())

0 comments on commit fed4cf2

Please sign in to comment.