Error building how to deploy demo

The recent API change breaks the example in tvm/apps/howto_deploy If you try to make the project with the current setup you get several warnings such as:


’DCHECK_NE’ macro redefined [-Wmacro-redefined]

#define DCHECK_NE(x, y) CHECK((x) != (y))

Other involved macros are DCHECK_EQ, DCHECK_GE, DCHECK_LE, etc. The error is to symbols not found, so its probably due to name changes:

Undefined symbols for architecture x86_64:
  "tvm::runtime::detail::LogFatal::GetEntry()", referenced from:
      Verify(tvm::runtime::Module, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in cpp_deploy-56717f.o
      tvm::runtime::TVMPODValue_::operator tvm::runtime::Module() const in cpp_deploy-56717f.o
      DeployGraphExecutor() in cpp_deploy-56717f.o
      tvm::runtime::detail::LogFatal::LogFatal(char const*, int) in cpp_deploy-56717f.o
      tvm::runtime::ArgTypeCode2Str(int) in cpp_deploy-56717f.o
      tvm::runtime::GetCustomTypeName(unsigned char) in libtvm_runtime_pack.o
      tvm::runtime::TVMRetValue::operator std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >() const in libtvm_runtime_pack.o
  "tvm::runtime::Backtrace()", referenced from:
      tvm::runtime::detail::LogFatal::Entry::Finalize() in cpp_deploy-56717f.o
      tvm::runtime::detail::LogFatal::Entry::Finalize() in libtvm_runtime_pack.o
      std::__1::__function::__func<TVMFuncCreateFromCFunc::$_1, std::__1::allocator<TVMFuncCreateFromCFunc::$_1>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) in libtvm_runtime_pack.o
      std::__1::__function::__func<TVMFuncCreateFromCFunc::$_2, std::__1::allocator<TVMFuncCreateFromCFunc::$_2>, void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&) in libtvm_runtime_pack.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/cpp_deploy_pack] Error 1

Will spend some time looking for the missing/changed names, but if anyone has seen this and has a solution, please let me know.


Hi @alopez_13, thanks for reporting!

The GetEntry method is defined in src/runtime/ Would you like to check if this method exist? Thanks a lot!

Oh I see. Would you like to add an include item in

#include "../../src/runtime/"
1 Like

Adding the include got rid of the error. Thanks!

The warnings are due to re-definitions of the macros. Not a show stopper.

would you like to send a PR for the fix? Thanks a lot!

Sure, it’s a minor fix. I haven’t fixed the duplicate macro definitions, but the build is successful and it gives the expected result. I’ll track the duplicate macros later.

1 Like