Skip to content

Commit 5cecc8a

Browse files
committed
llama : set GGML_NATIVE=OFF and add -mcpu=apple-a12
This commit sets GGML_NATIVE=OFF and adds -mcpu=apple-a12 to the C and C++ flags for the iOS simulator, iOS device, and macOS builds. This is an attempt to avoid native compilation and also find a suitable target architecture with regards to features tha the CPU supports.
1 parent 14d48be commit 5cecc8a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build-xcframework.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ COMMON_CMAKE_ARGS=(
120120
-DGGML_BLAS_DEFAULT=${GGML_BLAS_DEFAULT}
121121
-DGGML_METAL=${GGML_METAL}
122122
-DGGML_METAL_USE_BF16=${GGML_METAL_USE_BF16}
123+
-DGGML_NATIVE=OFF
123124
)
124125

125126
# Build for iOS simulator
@@ -131,6 +132,8 @@ cmake -B build-ios-sim -G Xcode \
131132
-DCMAKE_OSX_SYSROOT=iphonesimulator \
132133
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
133134
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=iphonesimulator \
135+
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
136+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
134137
-S .
135138
cmake --build build-ios-sim --config Release
136139

@@ -141,6 +144,8 @@ cmake -B build-ios-device -G Xcode \
141144
-DCMAKE_OSX_SYSROOT=iphoneos \
142145
-DCMAKE_OSX_ARCHITECTURES="arm64" \
143146
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=iphoneos \
147+
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
148+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
144149
-S .
145150
cmake --build build-ios-device --config Release
146151

@@ -150,6 +155,8 @@ cmake -B build-macos -G Xcode \
150155
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOS_MIN_OS_VERSION} \
151156
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
152157
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
158+
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
159+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
153160
-S .
154161
cmake --build build-macos --config Release
155162

0 commit comments

Comments
 (0)