danbev commited on
Commit
b0f4066
·
unverified ·
1 Parent(s): 95a0dbf

whisper.android.java : update build with ggml source changes (#2942)

Browse files

* whisper.android.java : update build with ggml source changes

This commit updates the whisper.android.java build to include the
new ggml source files and directories. The gradle build configuration is
also updated to include the aliyun maven repository.

examples/whisper.android.java/app/src/main/jni/whisper/CMakeLists.txt CHANGED
@@ -2,15 +2,21 @@ cmake_minimum_required(VERSION 3.10)
2
 
3
  project(whisper.cpp)
4
 
5
- set(CMAKE_CXX_STANDARD 11)
6
  set(WHISPER_LIB_DIR ${CMAKE_SOURCE_DIR}/../../../../../../../)
7
 
8
  set(SOURCE_FILES
9
  ${WHISPER_LIB_DIR}/ggml/src/ggml.c
10
- ${WHISPER_LIB_DIR}/ggml/src/ggml-aarch64.c
 
 
 
 
11
  ${WHISPER_LIB_DIR}/ggml/src/ggml-alloc.c
12
  ${WHISPER_LIB_DIR}/ggml/src/ggml-backend.cpp
 
13
  ${WHISPER_LIB_DIR}/ggml/src/ggml-quants.c
 
14
  ${WHISPER_LIB_DIR}/src/whisper.cpp
15
  ${CMAKE_SOURCE_DIR}/jni.c
16
  )
@@ -25,6 +31,7 @@ function(build_library target_name)
25
  )
26
 
27
  target_link_libraries(${target_name} ${LOG_LIB} android)
 
28
 
29
  if (${target_name} STREQUAL "whisper_v8fp16_va")
30
  target_compile_options(${target_name} PRIVATE -march=armv8.2-a+fp16)
@@ -57,3 +64,4 @@ include_directories(${WHISPER_LIB_DIR}/src)
57
  include_directories(${WHISPER_LIB_DIR}/include)
58
  include_directories(${WHISPER_LIB_DIR}/ggml/include)
59
  include_directories(${WHISPER_LIB_DIR}/ggml/src)
 
 
2
 
3
  project(whisper.cpp)
4
 
5
+ set(CMAKE_CXX_STANDARD 17)
6
  set(WHISPER_LIB_DIR ${CMAKE_SOURCE_DIR}/../../../../../../../)
7
 
8
  set(SOURCE_FILES
9
  ${WHISPER_LIB_DIR}/ggml/src/ggml.c
10
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.c
11
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-aarch64.cpp
12
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-traits.cpp
13
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu-quants.c
14
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-cpu/ggml-cpu.cpp
15
  ${WHISPER_LIB_DIR}/ggml/src/ggml-alloc.c
16
  ${WHISPER_LIB_DIR}/ggml/src/ggml-backend.cpp
17
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-backend-reg.cpp
18
  ${WHISPER_LIB_DIR}/ggml/src/ggml-quants.c
19
+ ${WHISPER_LIB_DIR}/ggml/src/ggml-threading.cpp
20
  ${WHISPER_LIB_DIR}/src/whisper.cpp
21
  ${CMAKE_SOURCE_DIR}/jni.c
22
  )
 
31
  )
32
 
33
  target_link_libraries(${target_name} ${LOG_LIB} android)
34
+ target_compile_definitions(${target_name} PUBLIC GGML_USE_CPU)
35
 
36
  if (${target_name} STREQUAL "whisper_v8fp16_va")
37
  target_compile_options(${target_name} PRIVATE -march=armv8.2-a+fp16)
 
64
  include_directories(${WHISPER_LIB_DIR}/include)
65
  include_directories(${WHISPER_LIB_DIR}/ggml/include)
66
  include_directories(${WHISPER_LIB_DIR}/ggml/src)
67
+ include_directories(${WHISPER_LIB_DIR}/ggml/src/ggml-cpu)
examples/whisper.android.java/build.gradle CHANGED
@@ -16,9 +16,10 @@ allprojects {
16
  repositories {
17
  google()
18
  jcenter()
 
19
  }
20
  }
21
 
22
  task clean(type: Delete) {
23
  delete rootProject.buildDir
24
- }
 
16
  repositories {
17
  google()
18
  jcenter()
19
+ maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
20
  }
21
  }
22
 
23
  task clean(type: Delete) {
24
  delete rootProject.buildDir
25
+ }
examples/whisper.android.java/gradlew CHANGED
File without changes