vadkos12 commited on
Commit
5779403
·
verified ·
1 Parent(s): f6bc5f2

Create build_llama.sh

Browse files
Files changed (1) hide show
  1. build_llama.sh +29 -0
build_llama.sh ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ echo ">>> build_llama.sh starting at $(date)"
4
+
5
+ if [ ! -d "llama.cpp" ]; then
6
+ git clone https://github.com/ggml-org/llama.cpp
7
+ fi
8
+ cd llama.cpp
9
+ git fetch --all --prune
10
+ git checkout master || true
11
+ git pull --ff-only || true
12
+
13
+ BUILD_DIR="build"
14
+ mkdir -p "${BUILD_DIR}"
15
+ echo "Running cmake..."
16
+ cmake -S . -B "${BUILD_DIR}" -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=ON || {
17
+ echo "cmake configuration failed"
18
+ exit 2
19
+ }
20
+
21
+ echo "Building (this can take many minutes)..."
22
+ cmake --build "${BUILD_DIR}" --config Release --parallel $(nproc) || {
23
+ echo "cmake build failed"
24
+ exit 3
25
+ }
26
+
27
+ echo "Build finished. Binaries should be in ${BUILD_DIR}/bin"
28
+ ls -la "${BUILD_DIR}/bin" || true
29
+ echo ">>> build_llama.sh finished at $(date)"