Skip to content

Commit

Permalink
try to add rpath nvidia python
Browse files Browse the repository at this point in the history
  • Loading branch information
minhthuc2502 committed Oct 29, 2024
1 parent 383d063 commit 4ed37d0
Showing 1 changed file with 9 additions and 0 deletions.
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 @@ -51,6 +52,14 @@ def _maybe_add_library_root(lib_name):
elif sys.platform == "win32":
cflags = ["/std:c++17", "/d2FH4-"]
package_data["ctranslate2"] = ["*.dll"]
else:
CUDA_RPATHS=[
'$ORIGIN/../nvidia/cublas/lib',
'$ORIGIN/../nvidia/cuda_runtime/lib',
'$ORIGIN/../nvidia/cudnn/lib',
]
CUDA_RPATHS= ';'.join(map(str, CUDA_RPATHS))
ldflags.append("-Wl,-rpath," + CUDA_RPATHS + "/lib")

ctranslate2_module = Extension(
"ctranslate2._ext",
Expand Down

0 comments on commit 4ed37d0

Please sign in to comment.