Skip to content

Commit ef824ad

Browse files
Lunderbergpfk-beta
authored andcommitted
[VTA] Search for libvta_fsim.so in $TVM_LIBRARY_PATH (apache#10278)
This adds `$TVM_LIBRARY_PATH` to the search directory of `vta.libinfo.find_libvta`, matching the behavior of `tvm._ffi.libinfo.find_lib_path`.
1 parent 4c5f94e commit ef824ad

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

vta/python/vta/libinfo.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,17 @@ def find_libvta(lib_vta, optional=False):
5959
Enable error check
6060
"""
6161
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
62-
lib_search = [
63-
os.path.join(
62+
tvm_library_path = os.environ.get("TVM_LIBRARY_PATH", None)
63+
if tvm_library_path is None:
64+
tvm_library_path = os.path.join(
6465
curr_path,
65-
"..",
66-
"..",
67-
"..",
66+
os.pardir,
67+
os.pardir,
68+
os.pardir,
6869
"build",
6970
)
70-
]
71-
lib_search += [os.path.join(get_vta_hw_path(), "build")]
71+
72+
lib_search = [tvm_library_path, os.path.join(get_vta_hw_path(), "build")]
7273
lib_name = _get_lib_name(lib_vta)
7374
lib_path = [os.path.join(x, lib_name) for x in lib_search]
7475
lib_found = [x for x in lib_path if os.path.exists(x)]

0 commit comments

Comments
 (0)