MCPcopy Create free account
hub / github.com/apache/tvm / package_lib_paths

Function package_lib_paths

python/tvm/libinfo.py:37–56  ·  view source on GitHub ↗

Return search directories for TVM's shared libraries. Anchored on this file's location (``python/tvm/libinfo.py``), the list covers the wheel-install layout (``python/tvm/lib/``) and the in-tree dev build layouts (`` /build/lib/`` and `` /lib/``). ``TVM_LIBRARY_PAT

()

Source from the content-addressed store, hash-verified

35
36
37def package_lib_paths() -> list[Path]:
38 """Return search directories for TVM's shared libraries.
39
40 Anchored on this file's location (``python/tvm/libinfo.py``), the list
41 covers the wheel-install layout (``python/tvm/lib/``) and the in-tree dev
42 build layouts (``<worktree>/build/lib/`` and ``<worktree>/lib/``).
43 ``TVM_LIBRARY_PATH`` is prepended when set so it takes priority. Callers
44 pick the basenames they want (e.g. ``libtvm_runtime.so``) and the load
45 mode; this function only returns the search path.
46 """
47 pkg = _rel_top_directory() # python/tvm/
48 paths: list[Path] = []
49 if os.environ.get("TVM_LIBRARY_PATH"):
50 paths.append(Path(os.environ["TVM_LIBRARY_PATH"]))
51 paths += [
52 pkg / "lib", # wheel layout
53 _dev_top_directory() / "build" / "lib", # dev: <worktree>/build/lib
54 _dev_top_directory() / "lib", # dev: <worktree>/lib
55 ]
56 return paths
57
58
59def find_libtvm_runtime() -> str:

Callers 1

find_libtvm_runtimeFunction · 0.85

Calls 4

_rel_top_directoryFunction · 0.85
_dev_top_directoryFunction · 0.85
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…