Failed to build android_rpc

Hi, I use the latest TVM source code to build android_rpc according to the guide tvm/apps/android_rpc at main · apache/tvm · GitHub, but failed to build android_rpc, see below error:

make: Entering directory `/home/test/work/tvm/apps/android_rpc/app/src/main/jni'
[arm64-v8a] Compile++      : tvm4j_runtime_packed <= org_apache_tvm_native_c_api.cc
[arm64-v8a] SharedLibrary  : libtvm4j_runtime_packed.so
/home/test/work/tvm/apps/android_rpc/app/src/main/obj/local/arm64-v8a/objs/tvm4j_runtime_packed/org_apache_tvm_native_c_api.o: In function `tvm::runtime::DenseMapNode::ListNode::GetNextEmpty(tvm::runtime::DenseMapNode const*, unsigned char*, tvm::runtime::DenseMapNode::ListNode*) const':
/home/test/work/tvm/apps/android_rpc/app/src/main/jni/../../../../../../include/tvm/runtime/container/map.h:1039: undefined reference to `tvm::runtime::DenseMapNode::kNextProbeLocation'
/home/test/work/tvm/apps/android_rpc/app/src/main/jni/../../../../../../include/tvm/runtime/container/map.h:1039: undefined reference to `tvm::runtime::DenseMapNode::kNextProbeLocation'
/home/test/work/tvm/apps/android_rpc/app/src/main/obj/local/arm64-v8a/objs/tvm4j_runtime_packed/org_apache_tvm_native_c_api.o: In function `tvm::runtime::DenseMapNode::ListNode::MoveToNext(tvm::runtime::DenseMapNode const*, unsigned char)':
/home/test/work/tvm/apps/android_rpc/app/src/main/jni/../../../../../../include/tvm/runtime/container/map.h:1016: undefined reference to `tvm::runtime::DenseMapNode::kNextProbeLocation'
/home/test/work/tvm/apps/android_rpc/app/src/main/jni/../../../../../../include/tvm/runtime/container/map.h:1016: undefined reference to `tvm::runtime::DenseMapNode::kNextProbeLocation'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/test/work/tvm/apps/android_rpc/app/src/main/obj/local/arm64-v8a/libtvm4j_runtime_packed.so] Error 1
make: Leaving directory `/home/test/work/tvm/apps/android_rpc/app/src/main/jni'
:app:buildJni FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:buildJni'.
> Process 'command 'sh'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 32s

Could you please tell me how to solve it ?

Hi I have the same problem. and I found it is caused by missing

#include “…/src/runtime/container.cc”

at apps/android_rpc/app/src/main/jni/tvm_runtime.h

I also created a PR to solve it.

1 Like