Skip to content

Commit

Permalink
Fix android not building on root llama.cpp repo
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Oct 18, 2023
1 parent a1417e3 commit fb902f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 1 addition & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ android {
applicationId "com.danemadsen.maid"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 23
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -94,9 +94,6 @@ android {

externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ABI=arm64-v8a", "-DANDROID_PLATFORM=android-23"
abiFilters 'arm64-v8a', 'x86_64'
cFlags "-march=armv8.4a+dotprod"
path "../../src/CMakeLists.txt"
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
cmake_minimum_required(VERSION 3.10)

set(BUILD_SHARED_LIBS ON)

if(ANDROID)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID_ARM_NEON=TRUE -DANDROID_TOOLCHAIN=clang -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID_ARM_NEON=TRUE -DANDROID_TOOLCHAIN=clang -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23")
endif()

add_subdirectory(./llama.cpp)
add_subdirectory(./butler)
2 changes: 1 addition & 1 deletion src/llama.cpp
Submodule llama.cpp updated 4 files
+44 −3 ggml-metal.m
+162 −1 ggml-metal.metal
+23 −52 ggml-opencl.cpp
+0 −18 llama.cpp

0 comments on commit fb902f8

Please sign in to comment.