diff --git a/llm/generate/gen_darwin.sh b/llm/generate/gen_darwin.sh index 6184a7bf..cabd8f75 100755 --- a/llm/generate/gen_darwin.sh +++ b/llm/generate/gen_darwin.sh @@ -9,14 +9,14 @@ set -o pipefail echo "Starting darwin generate script" source $(dirname $0)/gen_common.sh init_vars -CMAKE_DEFS="-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DLLAMA_ACCELERATE=on ${CMAKE_DEFS}" +CMAKE_DEFS="-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_SYSTEM_NAME=Darwin -DLLAMA_ACCELERATE=on ${CMAKE_DEFS}" BUILD_DIR="${LLAMACPP_DIR}/build/darwin/metal" case "${GOARCH}" in "amd64") - CMAKE_DEFS="-DCMAKE_SYSTEM_NAME=Darwin -DLLAMA_METAL=off -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}" + CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLAMA_METAL=off -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off ${CMAKE_DEFS}" ;; "arm64") - CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=arm64 -DLLAMA_METAL=on -DCMAKE_OSX_ARCHITECTURES=arm64 ${CMAKE_DEFS}" + CMAKE_DEFS="-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DLLAMA_METAL=on ${CMAKE_DEFS}" ;; *) echo "GOARCH must be set" diff --git a/scripts/build_darwin.sh b/scripts/build_darwin.sh index b37f6d0e..238fba87 100755 --- a/scripts/build_darwin.sh +++ b/scripts/build_darwin.sh @@ -8,9 +8,9 @@ export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version mkdir -p dist for TARGETARCH in arm64 amd64; do + rm -rf llm/llama.cpp/build GOOS=darwin GOARCH=$TARGETARCH go generate ./... CGO_ENABLED=1 GOOS=darwin GOARCH=$TARGETARCH go build -o dist/ollama-darwin-$TARGETARCH - rm -rf llm/llama.cpp/*/build done lipo -create -output dist/ollama dist/ollama-darwin-*