File size: 871 Bytes
7e25742
dd27783
 
7e25742
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Optional: build llama-cpp-python from source in Docker (e.g. custom patches / non-x86_64).
# Dockerfile installs the official v0.3.19 cp312 linux_x86_64 release wheel from GitHub — no upload needed.
# Requires Docker. Output: ./dist/*.whl
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
mkdir -p "$ROOT/dist"
docker run --rm -v "$ROOT/dist:/out" python:3.12-slim-bookworm bash -c '
  set -e
  apt-get update && apt-get install -y --no-install-recommends cmake ninja-build build-essential ca-certificates
  pip install --no-cache-dir --upgrade pip wheel setuptools
  export CMAKE_ARGS="-DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_SERVER=OFF -DCMAKE_BUILD_TYPE=Release"
  export FORCE_CMAKE=1
  export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
  pip wheel --no-cache-dir -w /out "llama-cpp-python==0.3.19"
  ls -la /out/
'