mlc-ai / mlc-llm

Universal LLM Deployment Engine with ML Compilation
https://llm.mlc.ai/
Apache License 2.0
18.63k stars 1.51k forks source link

How to build the "cpp" dir for android ? #216

Closed huanyingjun closed 1 year ago

huanyingjun commented 1 year ago

Dear How to build the "cpp" dir as a stand alone executable bin for Android ?

Thanks

Wanger-SJTU commented 1 year ago

you could try this to build cli itf

mkdir build && cd build
cmake .. -DCMAKE_SYSTEM_NAME="Android" -DCMAKE_C_COMPILER=$NDK_CC -DCMAKE_CXX_COMPILER=$NDC_CXX -DANDROID_TOOLCHAIN_ROOT=$ANDROID_TOOLCHAIN_ROOT -DANDROID_NATIVE_API_LEVEL=29 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-29 -DANDROID_ABI=arm64-v8a
junrushao commented 1 year ago

Please refer to this documentation for details: https://mlc.ai/mlc-llm/docs/tutorials/runtime/android.html