Skip to content

Commit

Permalink
Fix setup.py to work in a non-conda environment setup (#733)
Browse files Browse the repository at this point in the history
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: #733
  • Loading branch information
galipremsagar authored Mar 17, 2021
1 parent 3826a89 commit a8a846d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# Copyright (c) 2019-2021, NVIDIA CORPORATION.

import filecmp
import glob
import os
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a8a846d

Please sign in to comment.