mlc-llm icon indicating copy to clipboard operation
mlc-llm copied to clipboard

[Bug] tvn_runtime.h not being generated when building Android

Open tobrun opened this issue 2 years ago • 0 comments

When doing a fresh checkout of the repository, walking through the required steps to build Android. I'm unable to make a successful build because of the following issue:

/home/tobrun/ws/mlc-llm/android/MLCChat/app/src/main/jni/org_apache_tvm_native_c_api.cc:25:10: fatal error: 'tvm_runtime.h' file not found
#include "tvm_runtime.h"
         ^~~~~~~~~~~~~~~
1 error generated.

It seems the file is not generated anymore by the native build process (while I have seen an older sample codebase that had this file). By manually adding the following file:

#define DMLC_USE_LOGGING_LIBRARY <tvm/runtime/logging.h>
#define TVM_USE_LIBBACKTRACE 0

#include <dlfcn.h>
#include <dmlc/logging.h>
#include <dmlc/thread_local.h>
#include <tvm/runtime/c_runtime_api.h>

to app/src/main/jni/tvm_runtime.h, I was able to resolve the issue.

tobrun avatar Jun 09 '23 08:06 tobrun