From d09dbbfaea6e15e39641eecdfefccdb5ec3066f8 Mon Sep 17 00:00:00 2001 From: cgli Date: Mon, 10 Jun 2024 10:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAndroid=20NDK=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Build.yml | 4 ++-- example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 472b1114..d3bbf861 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -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 diff --git a/example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt b/example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt index 52168407..9879ddc7 100644 --- a/example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt +++ b/example/Android/LLMAssistant/app/src/main/cpp/CMakeLists.txt @@ -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(