#!/usr/bin/env bash set -euo pipefail export DEBIAN_FRONTEND=noninteractive cd "$(dirname "$0")/.." export OMP_NUM_THREADS="${THREADS:-12}" MKL_NUM_THREADS="${THREADS:-12}" apt-get update -qq apt-get install -y git cmake build-essential libcurl4-openssl-dev python3-venv mkdir -p logs source output if [ ! -d llama.cpp/.git ]; then git clone https://github.com/ggml-org/llama.cpp; fi cd llama.cpp git checkout 836d571 if git apply --check ../kolibri1-llama.cpp.patch; then git apply ../kolibri1-llama.cpp.patch else git apply --reverse --check ../kolibri1-llama.cpp.patch fi git rev-parse HEAD > ../logs/llama-revision.txt python3 -m venv ../venv --system-site-packages source ../venv/bin/activate pip install -r requirements.txt -r ../requirements.txt cmake -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=OFF cmake --build build -j "${THREADS:-12}" --target llama-quantize llama-cli llama-server llama-gguf-split echo 'SETUP-DONE: CPU build with community Kolibri architecture support'