Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@
(shell "git" "-C" dir "checkout" "--quiet" "FETCH_HEAD"))
(when-not (fs/exists? (str dir "/build/common/libllama-common.a"))
(apply shell "cmake" "-S" dir "-B" (str dir "/build") "-DCMAKE_BUILD_TYPE=Release"
"-DBUILD_SHARED_LIBS=OFF" "-DGGML_OPENMP=OFF" "-DGGML_NATIVE=OFF" "-DGGML_CPU_ALL_VARIANTS=OFF"
;; position-independent: jolt build links the archives into a
;; shared object, which GNU ld refuses non-PIC code for
"-DBUILD_SHARED_LIBS=OFF" "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" "-DGGML_OPENMP=OFF" "-DGGML_NATIVE=OFF" "-DGGML_CPU_ALL_VARIANTS=OFF"
"-DLLAMA_BUILD_TESTS=OFF" "-DLLAMA_BUILD_EXAMPLES=OFF" "-DLLAMA_BUILD_TOOLS=OFF"
"-DLLAMA_BUILD_SERVER=OFF" "-DLLAMA_BUILD_APP=OFF" "-DLLAMA_CURL=OFF"
;; llama-common (the decision engine's tokenizer and batch
Expand Down Expand Up @@ -173,9 +175,13 @@
"python" "bench/clef_golden.py" dir "golden/clef"))}

binary
{:doc "build the standalone HTTP server ./lev-server (kernels and llama.cpp linked in, mlx too when native/liblev_mlx.a is built) and self-test it against golden/"
{:doc "build the standalone HTTP server ./lev-server (kernels and llama.cpp linked in; mlx when `jolt mlx` built it, else an empty archive stands in) and self-test it against golden/"
:depends [kernels llama]
:task (do (shell "jolt" "build" "-m" "lev.server" "-o" "lev-server")
:task (do ;; jolt build links every :static archive, optional or not: without
;; `jolt mlx` an empty one stands in, and lev.mlx/available? is false
(when-not (fs/exists? "native/liblev_mlx.a")
(spit "native/liblev_mlx.a" "!<arch>\n"))
(shell "jolt" "build" "-m" "lev.server" "-o" "lev-server")
;; the suite runs interpreted; the AOT build must prove itself
(shell "./lev-server" "--self-test" "--data" "data" "--golden" "golden")
(println "built: ./lev-server (run: ./lev-server --data data --port 8080)"))}
Expand Down
2 changes: 1 addition & 1 deletion native/build_llm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "$(uname -s)" in
# :static {:lib ...} entries can express
sdk=$(xcrun --show-sdk-path)
mkdir -p native/frameworks
for f in Metal Foundation MetalKit Accelerate; do
for f in Metal Foundation MetalKit Accelerate QuartzCore; do
ln -sf "$sdk/System/Library/Frameworks/$f.framework/$f.tbd" "native/frameworks/lib$f.tbd"
done
;;
Expand Down
Loading