TVM C++ deployment failed

Hi there,

I tried to deploy the TVM with C/C++ API based on Deploy TVM Module using C++ API. I have followed the guide to build up TVM and run the ./run_example.sh to create the lib file with *.so in it. But when I tried to run cpp_deploy_normal and cpp_deploy_pack with the linked libtvm_runtime.so, I came across an error:

[12:37:10] cpp_deploy.cc:79: Verify dynamic loading from test_addone_dll.so
[12:37:10] cpp_deploy.cc:71: Finish verification...
[12:37:10] cpp_deploy.cc:83: Verify load function from system lib
terminate called after throwing an instance of 'tvm::runtime::InternalError'
  what():  [12:37:10] cpp_deploy.cc:36:
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (f != nullptr) is false:
Stack trace:
  0: Verify(tvm::runtime::Module, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
  1: DeploySingleOp()
  2: main
  3: __libc_start_main
        at ../csu/libc-start.c:308
  4: _start
  5: 0xffffffffffffffff

It seems like there is something wrong with the DeploySingleOp() with the wrong Verify(mod_syslib, "add_one_sys"). I then checked if “add_one_sys” existed after I make lib/cpp_deploy_normal, which showed that it did exist with lib/test_addone_sys.o. So I think it might probably something wrong with tvm::runtime::Registry::Get("runtime.SystemLib") or so. Does anyone have an idea how to solve it?

Many thanks!

Could you show the symbols in the lib/test_addone_sys.o?

Eg: nm lib/test_addone_sys.o, it should get with addonesys defined

0000000000000000 T addonesys
00000000000001c0 t addonesys_compute_
0000000000000110 W __extendhfsf2
0000000000000000 r .LCPI1_0
0000000000000000 r .LCPI1_1
0000000000000000 W __truncsfhf2
                 U TVMAPISetLastError
                 U TVMBackendRegisterSystemLibSymbol
0000000000000775 V __tvm_main__
0000000000000000 V __tvm_module_ctx
0000000000000360 t __tvm_module_startup