예제 #1
0
from setuptools import setup, find_packages, Command
from setuptools.extension import Extension
from setuputils import use_raft_package, get_environment_option

try:
    from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:
    from setuptools.command.build_ext import build_ext

import versioneer
from distutils.sysconfig import get_python_lib

CYTHON_FILES = ['pylibcugraph/**/*.pyx']

UCX_HOME = get_environment_option("UCX_HOME")
CUDA_HOME = get_environment_option('CUDA_HOME')
CONDA_PREFIX = get_environment_option('CONDA_PREFIX')

conda_lib_dir = os.path.normpath(sys.prefix) + '/lib'
conda_include_dir = os.path.normpath(sys.prefix) + '/include'

if CONDA_PREFIX:
    conda_include_dir = CONDA_PREFIX + '/include'
    conda_lib_dir = CONDA_PREFIX + '/lib'

if not UCX_HOME:
    UCX_HOME = CONDA_PREFIX if CONDA_PREFIX else os.sys.prefix

ucx_include_dir = os.path.join(UCX_HOME, "include")
ucx_lib_dir = os.path.join(UCX_HOME, "lib")
예제 #2
0
if "--singlegpu" in sys.argv:
    from Cython.Build import cythonize
    from setuptools.command.build_ext import build_ext
else:
    try:
        from Cython.Distutils.build_ext import new_build_ext as build_ext
    except ImportError:
        from setuptools.command.build_ext import build_ext

install_requires = ['numba', 'cython']

##############################################################################
# - Print of build options used by setup.py  --------------------------------

cuda_home = get_environment_option("CUDA_HOME")
libcuml_path = get_environment_option('CUML_BUILD_PATH')
raft_path = get_environment_option('RAFT_PATH')

clean_artifacts = get_cli_option('clean')
single_gpu_build = get_cli_option('--singlegpu')

##############################################################################
# - Dependencies include and lib folder setup --------------------------------

if not cuda_home:
    nvcc_path = shutil.which('nvcc')
    if (not nvcc_path):
        raise FileNotFoundError("nvcc not found.")

    cuda_home = str(Path(nvcc_path).parent.parent)
예제 #3
0
from setuptools.extension import Extension
from setuputils import clean_folder
from setuputils import get_environment_option
from setuputils import get_cli_option

try:
    from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:
    from setuptools.command.build_ext import build_ext

##############################################################################
# - Dependencies include and lib folder setup --------------------------------

install_requires = ['cython']

cuda_home = get_environment_option("CUDA_HOME")

clean_artifacts = get_cli_option('clean')
single_gpu_build = get_cli_option('--singlegpu')

if not cuda_home:
    cuda_home = (
        os.popen('echo "$(dirname $(dirname $(which nvcc)))"').read().strip())
    print("-- Using nvcc to detect CUDA, found at " + str(cuda_home))
cuda_include_dir = os.path.join(cuda_home, "include")
cuda_lib_dir = os.path.join(cuda_home, "lib64")

##############################################################################
# - Clean target -------------------------------------------------------------

if clean_artifacts:
예제 #4
0
파일: setup.py 프로젝트: mattf/cugraph
    CUDA_HOME = os.path.dirname(os.path.dirname(path_to_cuda_gdb))

if not os.path.isdir(CUDA_HOME):
    raise OSError(
        "Invalid CUDA_HOME: " "directory does not exist: {CUDA_HOME}"
    )

cuda_include_dir = os.path.join(CUDA_HOME, "include")

if (os.environ.get('CONDA_PREFIX', None)):
    conda_prefix = os.environ.get('CONDA_PREFIX')
    conda_include_dir = conda_prefix + '/include'
    conda_lib_dir = conda_prefix + '/lib'

# Optional location of C++ build folder that can be configured by the user
libcugraph_path = get_environment_option('CUGRAPH_BUILD_PATH')
# Optional location of RAFT that can be confugred by the user
raft_path = get_environment_option('RAFT_PATH')

# FIXME: This could clone RAFT, even if it's not needed (eg. running --clean).
raft_include_dir = use_raft_package(raft_path, libcugraph_path,
                                    git_info_file='../cpp/CMakeLists.txt')


class CleanCommand(Command):
    """Custom clean command to tidy up the project root."""
    user_options = [('all', None, None), ]

    def initialize_options(self):
        self.all = None