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

try to add rpath nvidia python #1811

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
9 changes: 9 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob
import os
import sys
import site

import pybind11

Expand Down Expand Up @@ -43,6 +44,7 @@ def _maybe_add_library_root(lib_name):

cflags = ["-std=c++17", "-fvisibility=hidden"]
ldflags = []
rpaths = []
package_data = {}
if sys.platform == "darwin":
# std::visit requires macOS 10.14
Expand All @@ -51,6 +53,12 @@ def _maybe_add_library_root(lib_name):
elif sys.platform == "win32":
cflags = ["/std:c++17", "/d2FH4-"]
package_data["ctranslate2"] = ["*.dll"]
else:
rpaths=[
'$ORIGIN/../nvidia/cublas/lib',
'$ORIGIN/../nvidia/cuda_runtime/lib',
'$ORIGIN/../nvidia/cudnn/lib',
]

ctranslate2_module = Extension(
"ctranslate2._ext",
Expand All @@ -60,6 +68,7 @@ def _maybe_add_library_root(lib_name):
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=["ctranslate2"],
runtime_library_dirs=rpaths
)

ParallelCompile("CMAKE_BUILD_PARALLEL_LEVEL").install()
Expand Down
Loading