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
()
| 35 | |
| 36 | |
| 37 | def 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 | |
| 59 | def find_libtvm_runtime() -> str: |
no test coverage detected
searching dependent graphs…