-cmake_minimum_required(VERSION 3.14) # for add_link_options and implicit target directories.
-
-include(GNUInstallDirs)
-include(CMakePackageConfigHelpers)
-
-# GGML dependencies
-if (NOT TARGET ggml)
-# libggml-base as external library
-find_library(GGML_BASE_LOCATION ggml-base)
-message (STATUS "Found GGML base library: ${GGML_BASE_LOCATION}")
-add_library(ggml-base SHARED IMPORTED GLOBAL)
-set_target_properties(ggml-base PROPERTIES IMPORTED_LOCATION ${GGML_BASE_LOCATION})
-
-# libggml as external library
-# defines GGML as target so that it is disabled in whisper.cpp build
-find_library(GGML_LOCATION ggml)
-message (STATUS "Found GGML library: ${GGML_LOCATION}")
-add_library(ggml SHARED IMPORTED GLOBAL)
-set_target_properties(ggml PROPERTIES IMPORTED_LOCATION ${GGML_LOCATION})
-# transitive dependency
-target_link_libraries(ggml INTERFACE ${GGML_BASE_LOCATION})
-endif()
-
-add_compile_definitions(NDEBUG)
-
-
# install common
install(DIRECTORY ${CMAKE_BINARY_DIR}/examples/ DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/whisper.cpp/common FILES_MATCHING PATTERN "libcommon*.a" )
install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ DESTINATION include/whisper.cpp/common FILES_MATCHING PATTERN "common*.h" )
Build-Depends: debhelper-compat (= 13), pkgconf,
cmake-data, cmake,
libsdl2-dev,
- ggml-dev, libggml-cpu,
+ ggml-dev,
libllama0-dev,
Standards-Version: 4.7.0
Vcs-Git: https://git.djapps.eu/pkg/ggml/sources/whisper.cpp
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}, ${shlibs:Depends},
- libggml0, libggml-cpu
+ libggml0
Description: Inference of Whisper in pure C/C++ (shared library)
The shared library provides the core of whisper.cpp
speech-to-text capabilities using a Whisper model.
/usr/bin/whisper-talk-llama
/usr/libexec/*/ggml/whisper-talk-llama
+
+/usr/bin/vad-speech-segments
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
-index e4265af..0109886 100644
+index c37a2e6..f2588b0 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
-@@ -102,16 +102,16 @@ elseif(CMAKE_JS_VERSION)
+@@ -102,17 +102,17 @@ elseif(CMAKE_JS_VERSION)
add_subdirectory(addon.node)
else()
add_subdirectory(cli)
+ #add_subdirectory(bench)
+ #add_subdirectory(server)
+ #add_subdirectory(quantize)
+ add_subdirectory(vad-speech-segments)
if (WHISPER_SDL2)
add_subdirectory(stream)
add_subdirectory(command)
endif()
endif (WHISPER_SDL2)
-@@ -119,5 +119,5 @@ else()
+@@ -120,5 +120,5 @@ else()
endif()
if (WHISPER_SDL2)
--- /dev/null
+From: Mathieu Baudier <mbaudier@argeo.org>
+Date: Tue, 11 Mar 2025 15:40:11 +0100
+Subject: use-llama-cpp-library
+
+---
+ examples/talk-llama/CMakeLists.txt | 32 ++++----------------------------
+ 1 file changed, 4 insertions(+), 28 deletions(-)
+
+diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt
+index 13ecced..f86a338 100644
+--- a/examples/talk-llama/CMakeLists.txt
++++ b/examples/talk-llama/CMakeLists.txt
+@@ -3,36 +3,12 @@ if (WHISPER_SDL2)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+ set(TARGET whisper-talk-llama)
+- add_executable(${TARGET} talk-llama.cpp
+- llama.cpp
+- llama-adapter.cpp
+- llama-arch.cpp
+- llama-batch.cpp
+- llama-chat.cpp
+- llama-context.cpp
+- llama-cparams.cpp
+- llama-grammar.cpp
+- llama-graph.cpp
+- llama-hparams.cpp
+- llama-impl.cpp
+- llama-io.cpp
+- llama-kv-cache-unified.cpp
+- llama-kv-cache-unified-iswa.cpp
+- llama-memory-recurrent.cpp
+- llama-memory-hybrid.cpp
+- llama-memory.cpp
+- llama-mmap.cpp
+- llama-model-loader.cpp
+- llama-model-saver.cpp
+- llama-model.cpp
+- llama-quant.cpp
+- llama-sampling.cpp
+- llama-vocab.cpp
+- unicode.cpp
+- unicode-data.cpp)
++ add_executable(${TARGET} talk-llama.cpp)
+ target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS})
+
+- target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
++ target_link_libraries(${TARGET} PRIVATE common common-sdl whisper llama ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
++
++ install(TARGETS ${TARGET} RUNTIME)
+
+ if(WIN32)
+ # It requires Windows 8.1 or later for PrefetchVirtualMemory
--- /dev/null
+From: Mathieu Baudier <mbaudier@argeo.org>
+Date: Tue, 11 Mar 2025 16:22:18 +0100
+Subject: load-ggml-backends-cli
+
+---
+ examples/cli/cli.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp
+index f73ed9a..4640bdd 100644
+--- a/examples/cli/cli.cpp
++++ b/examples/cli/cli.cpp
+@@ -918,6 +918,9 @@ int main(int argc, char ** argv) {
+ SetConsoleOutputCP(CP_UTF8);
+ #endif
+
++ // make sure GGML backends are loaded
++ ggml_backend_load_all();
++
+ whisper_params params;
+
+ // If the only argument starts with "@", read arguments line-by-line
+++ /dev/null
-From: Mathieu Baudier <mbaudier@argeo.org>
-Date: Mon, 27 Jan 2025 09:34:50 +0100
-Subject: load-ggml-backends
-
-Make sure GGML backends are loaded in talk-llama
----
- examples/talk-llama/talk-llama.cpp | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/examples/talk-llama/talk-llama.cpp b/examples/talk-llama/talk-llama.cpp
-index 9097c49..f12a82c 100644
---- a/examples/talk-llama/talk-llama.cpp
-+++ b/examples/talk-llama/talk-llama.cpp
-@@ -273,7 +273,10 @@ The transcript only includes text, it does not include markup like HTML and Mark
- {0}{4})";
-
- int main(int argc, char ** argv) {
-- whisper_params params;
-+ // make sure GGML backends are loaded
-+ ggml_backend_load_all();
-+
-+ whisper_params params;
-
- if (whisper_params_parse(argc, argv, params) == false) {
- return 1;
+++ /dev/null
-From: Mathieu Baudier <mbaudier@argeo.org>
-Date: Tue, 11 Mar 2025 16:22:18 +0100
-Subject: load-ggml-backends-cli
-
----
- examples/cli/cli.cpp | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/examples/cli/cli.cpp b/examples/cli/cli.cpp
-index fccfd13..732ff22 100644
---- a/examples/cli/cli.cpp
-+++ b/examples/cli/cli.cpp
-@@ -861,6 +861,9 @@ int main(int argc, char ** argv) {
- SetConsoleOutputCP(CP_UTF8);
- #endif
-
-+ // make sure GGML backends are loaded
-+ ggml_backend_load_all();
-+
- whisper_params params;
-
- // If the only argument starts with "@", read arguments line-by-line
+++ /dev/null
-From: Mathieu Baudier <mbaudier@argeo.org>
-Date: Tue, 11 Mar 2025 15:40:11 +0100
-Subject: use-llama-cpp-library
-
----
- examples/talk-llama/CMakeLists.txt | 28 ++++------------------------
- 1 file changed, 4 insertions(+), 24 deletions(-)
-
-diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt
-index 3e3971a..f86a338 100644
---- a/examples/talk-llama/CMakeLists.txt
-+++ b/examples/talk-llama/CMakeLists.txt
-@@ -3,32 +3,12 @@ if (WHISPER_SDL2)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
- set(TARGET whisper-talk-llama)
-- add_executable(${TARGET} talk-llama.cpp
-- llama.cpp
-- llama-adapter.cpp
-- llama-arch.cpp
-- llama-batch.cpp
-- llama-chat.cpp
-- llama-context.cpp
-- llama-cparams.cpp
-- llama-grammar.cpp
-- llama-graph.cpp
-- llama-hparams.cpp
-- llama-impl.cpp
-- llama-io.cpp
-- llama-kv-cache.cpp
-- llama-memory.cpp
-- llama-mmap.cpp
-- llama-model-loader.cpp
-- llama-model.cpp
-- llama-quant.cpp
-- llama-sampling.cpp
-- llama-vocab.cpp
-- unicode.cpp
-- unicode-data.cpp)
-+ add_executable(${TARGET} talk-llama.cpp)
- target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS})
-
-- target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-+ target_link_libraries(${TARGET} PRIVATE common common-sdl whisper llama ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-+
-+ install(TARGETS ${TARGET} RUNTIME)
-
- if(WIN32)
- # It requires Windows 8.1 or later for PrefetchVirtualMemory
0001-disable-some-examples.patch
-0003-load-ggml-backends.patch
-0004-use-llama-cpp-library.patch
-0004-load-ggml-backends-cli.patch
+0002-use-llama-cpp-library.patch
+0003-load-ggml-backends-cli.patch
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PROJECT_whisper.cpp_INCLUDE=debian/cmake/debian-whisper.cpp.cmake \
- -DCMAKE_BUILD_TYPE=Release \
+ \
-DBUILD_SHARED_LIBS=ON \
+ -DWHISPER_USE_SYSTEM_GGML=ON \
+ -DCMAKE_LIBRARY_PATH=/usr/libexec/$(DEB_HOST_MULTIARCH)/ggml \
+ \
-DWHISPER_BUILD_TESTS=OFF \
-DWHISPER_BUILD_EXAMPLES=ON \
-DWHISPER_FFMPEG=OFF \