This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new cf081d9929 [BugFix][CPP] Fix cpp deploy bug (#15773)
cf081d9929 is described below
commit cf081d992992b191ebad4256f7a915b2c7368185
Author: HinGwenWoong <[email protected]>
AuthorDate: Thu Sep 28 09:28:40 2023 +0800
[BugFix][CPP] Fix cpp deploy bug (#15773)
## Motivation
Fix bug when using `apps/howto_deploy/run_example.sh`, it will cause `core
dumped`

After fixed, all test pass.

## Modification
Add runtime for `tvm.build`
---
apps/howto_deploy/prepare_test_libs.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/apps/howto_deploy/prepare_test_libs.py
b/apps/howto_deploy/prepare_test_libs.py
index f5afc5bf67..45d7c0abd9 100644
--- a/apps/howto_deploy/prepare_test_libs.py
+++ b/apps/howto_deploy/prepare_test_libs.py
@@ -33,7 +33,13 @@ def prepare_test_libs(base_path):
fadd_dylib.export_library(dylib_path)
# Compile library in system library mode
- fadd_syslib = tvm.build(s, [A, B], "llvm", name="addonesys")
+ fadd_syslib = tvm.build(
+ s,
+ [A, B],
+ "llvm",
+ name="addonesys",
+ runtime=relay.backend.Runtime("cpp", {"system-lib": True}),
+ )
syslib_path = os.path.join(base_path, "test_addone_sys.o")
fadd_syslib.save(syslib_path)