@@ -6,11 +6,10 @@ IMAGE_NAME="${IMAGE_NAME:-localai/cachyllama-darwin}"
66
77pushd backend/cpp/cachyllama
88
9- # Single build via ggml CPU_ALL_VARIANTS: one binary plus the per-microarch Apple/arm
10- # dylibs (apple_m1/m2_m3/m4, armv8.x) that ggml selects at runtime. GGML_METAL stays ON
11- # and --target ggml also builds ggml-metal (via add_dependencies), so the Metal GPU
12- # backend is still produced as a loadable libggml-metal.dylib.
13- make cachyllama-cpu-all && \
9+ # CachyLLaMA's ARM CPU_ALL_VARIANTS build includes SME variants that do not build
10+ # reliably across the Darwin toolchains used by backend CI. The fallback build
11+ # remains Metal-enabled on Darwin and is fully linked.
12+ make cachyllama-fallback && \
1413make cachyllama-grpc && \
1514make cachyllama-rpc-server
1615
@@ -20,24 +19,10 @@ mkdir -p build/darwin
2019mkdir -p backend-images
2120mkdir -p build/darwin/lib
2221
23- cp -rf backend/cpp/cachyllama/cachyllama-cpu-all build/darwin/
22+ cp -rf backend/cpp/cachyllama/cachyllama-fallback build/darwin/
2423cp -rf backend/cpp/cachyllama/cachyllama-grpc build/darwin/
2524cp -rf backend/cpp/cachyllama/cachyllama-rpc-server build/darwin/
2625
27- # Distribute the shared ggml/llama libraries from the CPU_ALL_VARIANTS build. Unlike the
28- # old fully-static fallback build, these have @rpath install names, so the otool loop below
29- # (which only copies deps that exist on disk) will not pick them up. The split is by suffix:
30- # - ggml emits its loadable backends (per-microarch CPU variants, metal, blas) with a .so
31- # suffix EVEN ON DARWIN. These go in the package ROOT next to the binary, because darwin
32- # run.sh execs the binary directly (no bundled ld.so) so ggml's executable-directory
33- # scan looks there.
34- # - the core libraries (libggml-base/libggml/libllama/libllama-common/libmtmd) use the
35- # platform .dylib suffix and are NEEDED deps; they go in lib/, resolved at load time via
36- # the DYLD_LIBRARY_PATH=lib that run.sh exports. -a preserves the version symlinks.
37- SHLIBS=backend/cpp/cachyllama/ggml-shared-libs
38- cp -a $SHLIBS /* .so build/darwin/
39- cp -a $SHLIBS /* .dylib build/darwin/lib/
40-
4126# Set default additional libs only for Darwin on M chips (arm64)
4227if [[ " $( uname -s) " == " Darwin" && " $( uname -m) " == " arm64" ]]; then
4328 ADDITIONAL_LIBS=${ADDITIONAL_LIBS:- $(ls / opt/ homebrew/ Cellar/ protobuf/**/ lib/ libutf8_validity* .dylib 2>/ dev/ null)}
0 commit comments