|
17 | 17 | """Library information.""" |
18 | 18 | import sys |
19 | 19 | import os |
| 20 | +from pathlib import Path |
| 21 | + |
| 22 | + |
| 23 | +REPO_ROOT = Path(__file__).resolve().parent.parent.parent.parent |
20 | 24 |
|
21 | 25 |
|
22 | 26 | def split_env_var(env_var, split): |
@@ -68,6 +72,10 @@ def get_dll_directories(): |
68 | 72 | dll_path.append(os.path.join(ffi_dir, "..")) |
69 | 73 | # Default cmake build directory |
70 | 74 | dll_path.append(os.path.join(source_dir, "build")) |
| 75 | + |
| 76 | + # Other possible build directories |
| 77 | + dll_path += list(REPO_ROOT.glob("build-*")) |
| 78 | + |
71 | 79 | dll_path.append(os.path.join(source_dir, "build", "Release")) |
72 | 80 | # Default make build directory |
73 | 81 | dll_path.append(os.path.join(source_dir, "lib")) |
@@ -98,6 +106,10 @@ def find_lib_path(name=None, search_path=None, optional=False): |
98 | 106 | use_runtime = os.environ.get("TVM_USE_RUNTIME_LIB", False) |
99 | 107 | dll_path = get_dll_directories() |
100 | 108 |
|
| 109 | + manual_dll_path = os.getenv("TVM_DLL_PATH") |
| 110 | + if manual_dll_path is not None: |
| 111 | + dll_path = [manual_dll_path] + dll_path |
| 112 | + |
101 | 113 | if search_path is not None: |
102 | 114 | if isinstance(search_path, list): |
103 | 115 | dll_path = dll_path + search_path |
|
0 commit comments