]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
docker : add GGML_CPU_ARM_ARCH arg to select ARM architecture to build for (#11419)
authorDiego Devesa <redacted>
Sat, 25 Jan 2025 16:22:41 +0000 (17:22 +0100)
committerGitHub <redacted>
Sat, 25 Jan 2025 16:22:41 +0000 (17:22 +0100)
.devops/cpu.Dockerfile

index ab0e951bc77cb2f03a2ebfddc8d087e5894a3f5e..522ee8147d63a9e595dcd7c4d71d246705739e4a 100644 (file)
@@ -4,6 +4,8 @@ FROM ubuntu:$UBUNTU_VERSION AS build
 
 ARG TARGETARCH
 
+ARG GGML_CPU_ARM_ARCH=armv8-a
+
 RUN apt-get update && \
     apt-get install -y build-essential git cmake libcurl4-openssl-dev
 
@@ -12,9 +14,12 @@ WORKDIR /app
 COPY . .
 
 RUN if [ "$TARGETARCH" = "amd64" ]; then \
-        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON; \
+        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
+    elif [ "$TARGETARCH" = "arm64" ]; then \
+        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=${GGML_CPU_ARM_ARCH}; \
     else \
-        cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON; \
+        echo "Unsupported architecture"; \
+        exit 1; \
     fi && \
     cmake --build build -j $(nproc)