Skip to content
Snippets Groups Projects
Commit c285ea1a authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Fixed linking of "libxxx.so" in approxhpvm.py

parent 9e5b04e6
No related branches found
No related tags found
No related merge requests found
......@@ -111,10 +111,16 @@ def link_hpvm_rt(src_file: PathLike, target_file: PathLike) -> List[str]:
def link_binary(src_file: PathLike, target_file: PathLike) -> List[str]:
def drop_suffix(libname: str):
import re
match = re.match(r"lib(.*)\.so", libname)
return libname if match is None else match.group(1)
linker_dir_flags = []
for path in TRT_LINK_DIRS:
linker_dir_flags.extend([f"-L{path}", f"-Wl,-rpath={path}"])
linker_lib_flags = [f"-l{lib}" for lib in TRT_LINK_LIBS]
linker_lib_flags = [f"-l{drop_suffix(lib)}" for lib in TRT_LINK_LIBS]
return [
str(LLVM_BUILD_BIN / "clang++"), str(src_file), str(TRT_PATH), "-o", str(target_file),
*linker_dir_flags, *linker_lib_flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment