From 3a5239e6bf46986c8579eabcdff5cf5891a58b9a Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Fri, 8 Nov 2024 09:27:04 -0800 Subject: [PATCH] Set macos min version for all architectures (#7579) --- scripts/build_darwin.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/build_darwin.sh b/scripts/build_darwin.sh index f00cbe84..fd370f48 100755 --- a/scripts/build_darwin.sh +++ b/scripts/build_darwin.sh @@ -6,17 +6,18 @@ set -e mkdir -p dist +# These require Xcode v13 or older to target MacOS v11 +# If installed to an alternate location use the following to enable +# export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk +# export DEVELOPER_DIR=/Applications/Xcode_12.5.1.app/Contents/Developer +export CGO_CFLAGS=-mmacosx-version-min=11.3 +export CGO_CXXFLAGS=-mmacosx-version-min=11.3 +export CGO_LDFLAGS=-mmacosx-version-min=11.3 + for TARGETARCH in arm64 amd64; do echo "Building Go runner darwin $TARGETARCH" rm -rf llama/build GOOS=darwin ARCH=$TARGETARCH GOARCH=$TARGETARCH make -C llama -j 8 - # These require Xcode v13 or older to target MacOS v11 - # If installed to an alternate location use the following to enable - # export SDKROOT=/Applications/Xcode_12.5.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk - # export DEVELOPER_DIR=/Applications/Xcode_12.5.1.app/Contents/Developer - export CGO_CFLAGS=-mmacosx-version-min=11.3 - export CGO_CXXFLAGS=-mmacosx-version-min=11.3 - export CGO_LDFLAGS=-mmacosx-version-min=11.3 CGO_ENABLED=1 GOOS=darwin GOARCH=$TARGETARCH go build -trimpath -o dist/ollama-darwin-$TARGETARCH CGO_ENABLED=1 GOOS=darwin GOARCH=$TARGETARCH go build -trimpath -cover -o dist/ollama-darwin-$TARGETARCH-cov done