diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd4be4e4c..bbcc6cd73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -285,7 +285,7 @@ jobs: run: | ./install_deps.sh mkdir build && cd build - cmake -DLLAMA_METAL_EMBED_LIBRARY=ON -DWHISPER_COREML=1 -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. + cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. CC=gcc-8 make -j $(sysctl -n hw.ncpu) ls -la @@ -352,7 +352,7 @@ jobs: run: | ./install_deps.sh mkdir build && cd build - cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} -DLLAMA_METAL=OFF .. + cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. CC=gcc-8 make -j $(sysctl -n hw.ncp) ls -la diff --git a/CMakeLists.txt b/CMakeLists.txt index 181cf35a2..3aa6b716d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,17 @@ if(NOT DEFINED NITRO_VERSION) set(NITRO_VERSION "default_version") endif() +if(APPLE) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm.*|ARM64)$") + # MacOS silicon + set(LLAMA_METAL_EMBED_LIBRARY ON) + set(WHISPER_COREML 1) + else() + # MacOS amd64 + set(LLAMA_METAL OFF) + endif() +endif() + add_compile_definitions(NITRO_VERSION="${NITRO_VERSION}") add_subdirectory(llama.cpp/examples/llava)