Skip to content

Commit 01bde8f

Browse files
committed
Clean up common functionality
1 parent 7b4e269 commit 01bde8f

File tree

3 files changed

+251
-264
lines changed

3 files changed

+251
-264
lines changed

python/tvm/_ffi/libinfo.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"""Library information."""
1818
import sys
1919
import os
20+
from pathlib import Path
21+
22+
23+
REPO_ROOT = Path(__file__).resolve().parent.parent.parent.parent
2024

2125

2226
def split_env_var(env_var, split):
@@ -68,6 +72,10 @@ def get_dll_directories():
6872
dll_path.append(os.path.join(ffi_dir, ".."))
6973
# Default cmake build directory
7074
dll_path.append(os.path.join(source_dir, "build"))
75+
76+
# Other possible build directories
77+
dll_path += list(REPO_ROOT.glob("build-*"))
78+
7179
dll_path.append(os.path.join(source_dir, "build", "Release"))
7280
# Default make build directory
7381
dll_path.append(os.path.join(source_dir, "lib"))
@@ -98,6 +106,10 @@ def find_lib_path(name=None, search_path=None, optional=False):
98106
use_runtime = os.environ.get("TVM_USE_RUNTIME_LIB", False)
99107
dll_path = get_dll_directories()
100108

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+
101113
if search_path is not None:
102114
if isinstance(search_path, list):
103115
dll_path = dll_path + search_path

0 commit comments

Comments
 (0)