Abrarul8541 commited on
Commit
77afceb
·
verified ·
1 Parent(s): 0556399

Phase 3: native llama.cpp build (pinned tag, CPU, arm64)

Browse files
Files changed (1) hide show
  1. app/src/main/cpp/CMakeLists.txt +22 -0
app/src/main/cpp/CMakeLists.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.22.1)
2
+ project(modularai_llama LANGUAGES C CXX)
3
+
4
+ include(FetchContent)
5
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
6
+ set(LLAMA_BUILD_COMMON OFF CACHE BOOL "" FORCE)
7
+ set(LLAMA_BUILD_TESTS OFF CACHE BOOL "" FORCE)
8
+ set(LLAMA_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
9
+ set(LLAMA_BUILD_SERVER OFF CACHE BOOL "" FORCE)
10
+ set(LLAMA_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
11
+ set(LLAMA_CURL OFF CACHE BOOL "" FORCE)
12
+ set(GGML_OPENMP OFF CACHE BOOL "" FORCE)
13
+ set(GGML_NATIVE OFF CACHE BOOL "" FORCE)
14
+
15
+ # Pinned release tag. If CI reports an API mismatch in llama_jni.cpp, bump the tag and the calls together.
16
+ FetchContent_Declare(llama
17
+ GIT_REPOSITORY https://github.com/ggml-org/llama.cpp
18
+ GIT_TAG b6000)
19
+ FetchContent_MakeAvailable(llama)
20
+
21
+ add_library(modularai_llama SHARED llama_jni.cpp)
22
+ target_link_libraries(modularai_llama PRIVATE llama android log)