Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Fix setup.py to work in a non-conda environment setup #733

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved
]

# lib:
extensions = cythonize(
Expand Down