1818 include :
1919 - target : darwin-aarch64
2020 runner : macos-latest
21+ # Intel macOS: cross-compile on the plentiful arm runner (macos-13
22+ # Intel runners are deprecated and queue-starved). The binary can't be
23+ # run on the arm host, so its runtime smoke test is skipped.
2124 - target : darwin-x86_64
22- runner : macos-13
25+ runner : macos-latest
26+ osx_arch : x86_64
27+ zig_target : x86_64-macos
28+ skip_run : " true"
2329 - target : linux-x86_64
2430 runner : ubuntu-latest
2531 - target : linux-aarch64
@@ -84,10 +90,14 @@ jobs:
8490 - name : Build llama.cpp static libraries
8591 if : steps.cache_llama.outputs.cache-hit != 'true'
8692 run : |
93+ # Cross-compile flag for Intel macOS built on an arm runner.
94+ OSX_ARCH_FLAG=""
95+ if [ -n "${{ matrix.osx_arch }}" ]; then OSX_ARCH_FLAG="-DCMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }}"; fi
8796 if [ "$(uname -s)" = "Darwin" ]; then
8897 cmake -S lib/llama.cpp -B lib/llama.cpp/build \
8998 -DCMAKE_BUILD_TYPE=Release \
9099 -DBUILD_SHARED_LIBS=OFF \
100+ $OSX_ARCH_FLAG \
91101 -DGGML_METAL=ON \
92102 -DGGML_BLAS=ON \
93103 -DLLAMA_BUILD_TESTS=OFF \
@@ -110,9 +120,16 @@ jobs:
110120 cmake --build lib/llama.cpp/build -j
111121
112122 - name : Build release
113- run : zig build --release=fast
123+ run : |
124+ if [ -n "${{ matrix.zig_target }}" ]; then
125+ zig build --release=fast -Dtarget=${{ matrix.zig_target }}
126+ else
127+ zig build --release=fast
128+ fi
114129
115130 - name : Smoke test (incl. real embeddings)
131+ # Skip for a cross-compiled binary that can't run on this host.
132+ if : ${{ matrix.skip_run != 'true' }}
116133 run : |
117134 set -eux
118135 ./zig-out/bin/memxt init
0 commit comments