]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Introduce mtmd support
authorMathieu Baudier <redacted>
Mon, 23 Jun 2025 12:15:36 +0000 (14:15 +0200)
committerMathieu Baudier <redacted>
Mon, 23 Jun 2025 12:27:12 +0000 (14:27 +0200)
debian/control
debian/libmtmd0-dev.install [new file with mode: 0644]
debian/libmtmd0.install [new file with mode: 0644]
debian/llama-cpp-tools.install
debian/not-installed
debian/patches/0001-improve-cmake-build.patch
debian/rules

index b6da3e1d483ec43dea7a6a90c095d3157eaf1260..a2ed121a1877b37dad8623d8dc902c5c4dc913f8 100644 (file)
@@ -26,11 +26,23 @@ Description: Inference of large language models in pure C/C++ (shared library)
  llama.cpp leverages the ggml tensor library in order to run
  large language models (LLMs) provided in the GGUF file format.
 
+Package: libmtmd0
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends},
+ libllama0
+# Explicitly conflict with Debian official
+Conflicts: llama.cpp
+Description: Inference of large language models in pure C/C++ (multimodal library)
+ mtmd provides multimodl inference.
+
 # We only distribute a few very useful tools, with stable CLI options
 Package: llama-cpp-tools
 Architecture: any
 Depends: ${misc:Depends}, ${shlibs:Depends},
- libllama0, ggml, curl
+ libllama0 (= ${binary:Version}), libmtmd0 (= ${binary:Version}), ggml, curl
 Description: Inference of large language models in pure C/C++ (tools)
  llama-cli: versatile tool wrapping most features provided by libllama.
  It typically allows one to run one-shot prompts or to "chat"
@@ -42,6 +54,8 @@ Description: Inference of large language models in pure C/C++ (tools)
  .
  llama-bench: benchmarking of large language models or
  ggml backends.
+ .
+ llama-mtmd-cli: multimodal support.
 
 Package: libllama0-dev
 Section: libdevel
@@ -51,3 +65,13 @@ Depends: ${misc:Depends},
 Description: Inference of large language models in pure C/C++ (development files)
  Development files required for building software based on the
  stable and documented llama.cpp API.
+
+Package: libmtmd0-dev
+Section: libdevel
+Architecture: any
+Depends: ${misc:Depends},
+ ggml-dev, libllama0-dev (= ${binary:Version}), libmtmd0 (= ${binary:Version})
+Description: Inference of large language models in pure C/C++ (development files)
+ Development files required for building software based on the
+ stable and documented llama.cpp API.
\ No newline at end of file
diff --git a/debian/libmtmd0-dev.install b/debian/libmtmd0-dev.install
new file mode 100644 (file)
index 0000000..f482f6d
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/include/mtmd*.h
+
+# Symbolic links
+/usr/lib/*/libmtmd.so
diff --git a/debian/libmtmd0.install b/debian/libmtmd0.install
new file mode 100644 (file)
index 0000000..8e15aa0
--- /dev/null
@@ -0,0 +1 @@
+/usr/lib/*/libmtmd.so.*
index a028e9951559ba3c126c7866d6b885f28c61cd26..eaed1f25cffafebca689f8fcee6c0035a56ffc8c 100644 (file)
@@ -6,3 +6,6 @@
 
 /usr/bin/llama-bench
 /usr/libexec/*/ggml/llama-bench
+
+/usr/bin/llama-mtmd-cli
+/usr/libexec/*/ggml/llama-mtmd-cli
index 05710147885c1efced9c47566dce43ba394525bc..c02e7addfc49a6eb00f9de4e3649fd2195f9f102 100644 (file)
@@ -1,7 +1,3 @@
-# Ignore multimodal until the mtmd approach seems stable enough
-/usr/lib/*/libmtmd.so
-/usr/include/mtmd*.h
-
 # Most executables produced are not stable enough to be distributed
 /usr/bin/llama-*
 /usr/libexec/*/ggml/llama-*
index a2a78d9b2d8669890be6870d0a554ff9733a838a..445d3ca20303c7b5ad096213611f126f8a64ec75 100644 (file)
@@ -3,9 +3,10 @@ Date: Sun, 23 Feb 2025 11:31:46 +0100
 Subject: improve-cmake-build
 
 ---
- CMakeLists.txt     | 2 +-
- src/CMakeLists.txt | 4 ++++
- 2 files changed, 5 insertions(+), 1 deletion(-)
+ CMakeLists.txt            | 2 +-
+ src/CMakeLists.txt        | 4 ++++
+ tools/mtmd/CMakeLists.txt | 4 ++++
+ 3 files changed, 9 insertions(+), 1 deletion(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index 50801cd..d2becb0 100644
@@ -33,3 +34,18 @@ index 8f9cd65..9aa905a 100644
 +      set_target_properties(llama PROPERTIES VERSION ${LLAMA_INSTALL_VERSION} SOVERSION 0)
 +    endif()
  endif()
+diff --git a/tools/mtmd/CMakeLists.txt b/tools/mtmd/CMakeLists.txt
+index 4baa15b..c330f06 100644
+--- a/tools/mtmd/CMakeLists.txt
++++ b/tools/mtmd/CMakeLists.txt
+@@ -35,6 +35,10 @@ set_target_properties(mtmd
+     PROPERTIES
+     PUBLIC_HEADER "${MTMD_PUBLIC_HEADERS}")
++if(DEFINED LLAMA_INSTALL_VERSION)
++    message(STATUS "Set mtmd shared library version to ${LLAMA_INSTALL_VERSION}")
++      set_target_properties(mtmd PROPERTIES VERSION ${LLAMA_INSTALL_VERSION} SOVERSION 0)
++endif()
+ install(TARGETS mtmd LIBRARY PUBLIC_HEADER)
+ if (NOT MSVC)
index 352d27f512b532eef58d64fed269640ddeed50a7..5730a8ddd04337a8e4a511503c06c18c8ee004b9 100755 (executable)
@@ -25,7 +25,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 override_dh_auto_configure:
        dh_auto_configure -- \
-       -DBUILD_NUMBER=$(subst 0.0.,,$(DEB_VERSION_UPSTREAM)) \
+       -DLLAMA_BUILD_NUMBER=$(subst 0.0.,,$(DEB_VERSION_UPSTREAM)) \
        -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_HOST_MULTIARCH)" \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        \