Skip to content

Commit

Permalink
修复Android NDK编译
Browse files Browse the repository at this point in the history
  • Loading branch information
cgli authored and TylunasLi committed Jun 10, 2024
1 parent ec8a311 commit d09dbbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:

- name: Build with arm64-v8a
run: |
wget https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
wget -q https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
unzip android-ndk-r21d-linux-x86_64.zip
export NDK=$GITHUB_WORKSPACE/android-ndk-r21d
mkdir build-android
cd build-android
#ls ${NDK}/build/cmake/android.toolchain.cmake
cmake -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_CXX_FLAGS=-march=armv8.2a+dotprod ..
cmake -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_CXX_FLAGS="-I ${NDK}/sources/cxx-stl/llvm-libc++/include/experimental/filesystem -march=armv8.2a+dotprod" ..
make -j -B
cp main fastllm-main-android
Expand Down
5 changes: 5 additions & 0 deletions example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ set(PROJECT_SOURCE
../../../../../../../src/device.cpp
../../../../../../../src/model.cpp
../../../../../../../src/executor.cpp
../../../../../../../src/template.cpp
../../../../../../../src/devices/cpu/cpudevice.cpp
../../../../../../../src/devices/cpu/cpudevicebatch.cpp
../../../../../../../src/models/basellm.cpp
../../../../../../../src/models/bert.cpp
../../../../../../../src/models/chatglm.cpp
../../../../../../../src/models/deepseekv2.cpp
../../../../../../../src/models/moss.cpp
../../../../../../../src/models/llama.cpp
../../../../../../../src/models/qwen.cpp
../../../../../../../src/models/glm.cpp
../../../../../../../src/models/internlm2.cpp
../../../../../../../src/models/minicpm.cpp
../../../../../../../src/models/moe.cpp
)

include_directories(
Expand Down

0 comments on commit d09dbbf

Please sign in to comment.