]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
Make sure that multiarch is well supported
authorMathieu Baudier <redacted>
Tue, 21 Jan 2025 06:49:29 +0000 (07:49 +0100)
committerMathieu Baudier <redacted>
Tue, 21 Jan 2025 06:49:29 +0000 (07:49 +0100)
debian/control
debian/libggml-cpu.install
debian/rules

index cb373d15a794b17eff030a51d770c07b7350e90e..38759801db5dd4b793104305280d5457122c614d 100644 (file)
@@ -3,7 +3,7 @@ Section: science
 Priority: optional
 Maintainer: Mathieu Baudier <mbaudier@argeo.org>
 Build-Depends: debhelper-compat (= 13), pkg-config, cmake-data, cmake, cpio, git, patchelf,
-       libopenblas-openmp-dev, libopenblas64-openmp-dev, libvulkan-dev, glslc
+       libopenblas-openmp-dev, libopenblas64-openmp-dev [amd64 arm64], libvulkan-dev, glslc
 Standards-Version: 4.5.1
 Homepage: https://github.com/ggerganov
 Rules-Requires-Root: binary-targets
@@ -52,7 +52,7 @@ Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends},
  libggml,
 # GGML shows warning that it uses OpenMP if default OpenBLAS (pthread) is used.
- libopenblas0-openmp, libopenblas64-0-openmp,
+ libopenblas0-openmp, libopenblas64-0-openmp [amd64 arm64],
 Description: Tensor library for machine learning (OpenBLAS backend)
  GGML Tensor library for machine learning. (OpenBLAS backend)
 
index aa9291aa77151157d0fef9e29e6d7dba9bf2e9b4..f2f99f4dad9b9019dd59307bed3c503722048e97 100644 (file)
@@ -1 +1 @@
-/usr/lib/*/libggml-cpu-*.so
+/usr/lib/*/libggml-cpu*.so
index 0c264725ba8c31f856cac6e542c3f63395cb9cd1..82e2adbf1775f12e86348d629e8e43a875515e26 100755 (executable)
@@ -5,13 +5,28 @@
 LC_ALL := C.UTF-8
 export LC_ALL
 
+# multiarch
 include /usr/share/dpkg/architecture.mk
 
-DEB_BUILD_OPTIONS ?= parallel=8
-
 build_multiarch=build/$(DEB_HOST_MULTIARCH)
 install_lib_multiarch=debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
 
+# parallelism
+DEB_BUILD_OPTIONS ?= parallel=8
+
+# ggml specific
+ifeq ($(DEB_HOST_ARCH),aarch64)
+       GGML_CPU_AARCH64 ?= ON
+else
+       GGML_CPU_AARCH64 ?= OFF
+endif
+
+ifneq ($(DEB_HOST_ARCH),i386)
+       GGML_CPU_ALL_VARIANTS ?= ON
+else
+       GGML_CPU_ALL_VARIANTS ?= OFF
+endif
+
 %:
 # Use build/ for output, so that it is in the .gitignore of upstream
        dh $@ --buildsystem=cmake --builddirectory=$(build_multiarch)
@@ -25,10 +40,11 @@ override_dh_auto_configure:
        -DGGML_STANDALONE=ON \
        -DGGML_BUILD_TESTS=OFF \
        -DGGML_BUILD_EXAMPLES=OFF \
-       \
+       -DGGML_CPU_AARCH64=$(GGML_CPU_AARCH64) \
        -DGGML_BACKEND_DL=ON \
-       -DGGML_CPU_ALL_VARIANTS=ON \
+       -DGGML_CPU_ALL_VARIANTS=$(GGML_CPU_ALL_VARIANTS) \
        -DGGML_NATIVE=OFF \
+       \
        -DGGML_RPC=ON \
        -DGGML_BLAS=ON \
        -DGGML_BLAS_VENDOR=OpenBLAS \
@@ -44,7 +60,6 @@ override_dh_auto_install:
        patchelf --set-soname $$(basename "$$file") $$file; \
                install -t $(install_lib_multiarch) $$file; \
        done
-       #install -t $(install_lib_multiarch) $(build_multiarch)/bin/libggml-*.so
 
 override_dh_dwz:
        # dwz is failing most probably because of using patchelf in order to set soname