From a8a846d36697ae63d9973b0b30d5ba13b9e89c85 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Wed, 17 Mar 2021 11:41:41 -0500 Subject: [PATCH] Fix setup.py to work in a non-conda environment setup (#733) This PR introduces fixes to `setup.py` which were necessary to build rmm successfully in an `nvidia-devel` container or a non-conda environment setup. Authors: - GALI PREM SAGAR (@galipremsagar) Approvers: - Keith Kraus (@kkraus14) URL: https://github.com/rapidsai/rmm/pull/733 --- python/setup.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/python/setup.py b/python/setup.py index 32e7b837f..7de5e0513 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,4 +1,5 @@ -# Copyright (c) 2019-2020, NVIDIA CORPORATION. +# Copyright (c) 2019-2021, NVIDIA CORPORATION. + import filecmp import glob import os @@ -20,7 +21,9 @@ def get_cuda_version_from_header(cuda_include_dir): cuda_version = None - with open(os.path.join(cuda_include_dir, "cuda.h"), "r") as f: + with open( + os.path.join(cuda_include_dir, "cuda.h"), "r", encoding="utf-8" + ) as f: for line in f.readlines(): if re.search(r"#define CUDA_VERSION ", line) is not None: cuda_version = line @@ -109,7 +112,11 @@ def get_cuda_version_from_header(cuda_include_dir): cuda_include_dir, ] -library_dirs = [get_python_lib(), os.path.join(os.sys.prefix, "lib")] +library_dirs = [ + get_python_lib(), + os.path.join(os.sys.prefix, "lib"), + cuda_lib_dir, +] # lib: extensions = cythonize(