Skip to content

Commit 0f681e4

Browse files
committed
llama : suppress warnings
This commit suppresses the warnings and reduces the output from the build commands. The motivation for this is that currrently there is so much output that it makes it hard to see the actual errors/issues.
1 parent 5cecc8a commit 0f681e4

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

build-xcframework.sh

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ GGML_METAL=ON
1313
GGML_METAL_EMBED_LIBRARY=ON
1414
GGML_BLAS_DEFAULT=ON
1515
GGML_METAL_USE_BF16=ON
16+
GGML_OPENMP=OFF
17+
18+
COMMON_C_FLAGS="-Wno-macro-redefined -Wno-shorten-64-to-32 -Wno-unused-command-line-argument"
19+
COMMON_CXX_FLAGS="-Wno-macro-redefined -Wno-shorten-64-to-32 -Wno-unused-command-line-argument"
1620

1721
check_required_tool() {
1822
local tool=$1
@@ -30,7 +34,7 @@ check_required_tool "cmake" "Please install CMake (brew install cmake)"
3034
check_required_tool "xcodebuild" "Please install Xcode and Xcode Command Line Tools (xcode-select --install)"
3135
check_required_tool "libtool" "Please install libtool which should be available with Xcode Command Line Tools (CLT). Make sure Xcode CLT is installed (xcode-select --install)"
3236

33-
set -xe
37+
set -e
3438

3539
rm -rf build-apple
3640
rm -rf build-ios-sim
@@ -121,6 +125,7 @@ COMMON_CMAKE_ARGS=(
121125
-DGGML_METAL=${GGML_METAL}
122126
-DGGML_METAL_USE_BF16=${GGML_METAL_USE_BF16}
123127
-DGGML_NATIVE=OFF
128+
-DGGML_OPENMP=${GGML_OPENMP}
124129
)
125130

126131
# Build for iOS simulator
@@ -132,10 +137,10 @@ cmake -B build-ios-sim -G Xcode \
132137
-DCMAKE_OSX_SYSROOT=iphonesimulator \
133138
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
134139
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=iphonesimulator \
135-
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
136-
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
140+
-DCMAKE_C_FLAGS="-mcpu=apple-a12 ${COMMON_C_FLAGS}" \
141+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12 ${COMMON_CXX_FLAGS}" \
137142
-S .
138-
cmake --build build-ios-sim --config Release
143+
cmake --build build-ios-sim --config Release -- -quiet
139144

140145
# Build for iOS devices
141146
cmake -B build-ios-device -G Xcode \
@@ -144,21 +149,21 @@ cmake -B build-ios-device -G Xcode \
144149
-DCMAKE_OSX_SYSROOT=iphoneos \
145150
-DCMAKE_OSX_ARCHITECTURES="arm64" \
146151
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=iphoneos \
147-
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
148-
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
152+
-DCMAKE_C_FLAGS="-mcpu=apple-a12 ${COMMON_C_FLAGS}" \
153+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12 ${COMMON_CXX_FLAGS}" \
149154
-S .
150-
cmake --build build-ios-device --config Release
155+
cmake --build build-ios-device --config Release -- -quiet
151156

152157
# Build for macOS
153158
cmake -B build-macos -G Xcode \
154159
"${COMMON_CMAKE_ARGS[@]}" \
155160
-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOS_MIN_OS_VERSION} \
156161
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
157162
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
158-
-DCMAKE_C_FLAGS="-mcpu=apple-a12" \
159-
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12" \
163+
-DCMAKE_C_FLAGS="-mcpu=apple-a12 ${COMMON_C_FLAGS}" \
164+
-DCMAKE_CXX_FLAGS="-mcpu=apple-a12 ${COMMON_CXX_FLAGS}" \
160165
-S .
161-
cmake --build build-macos --config Release
166+
cmake --build build-macos --config Release -- -quiet
162167

163168

164169
# Build for visionOS
@@ -170,10 +175,10 @@ cmake -B build-visionos -G Xcode \
170175
-DCMAKE_OSX_SYSROOT=xros \
171176
-DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
172177
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=xros \
173-
-DCMAKE_C_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1" \
174-
-DCMAKE_CXX_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1" \
178+
-DCMAKE_C_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1 ${COMMON_C_FLAGS}" \
179+
-DCMAKE_CXX_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1 ${COMMON_CXX_FLAGS}" \
175180
-S .
176-
cmake --build build-visionos --config Release
181+
cmake --build build-visionos --config Release -- -quiet
177182

178183
# Build for visionOS simulator
179184
cmake -B build-visionos-sim -G Xcode \
@@ -184,10 +189,10 @@ cmake -B build-visionos-sim -G Xcode \
184189
-DCMAKE_OSX_SYSROOT=xrsimulator \
185190
-DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
186191
-DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=xrsimulator \
187-
-DCMAKE_C_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1" \
188-
-DCMAKE_CXX_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1" \
192+
-DCMAKE_C_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1 ${COMMON_C_FLAGS}" \
193+
-DCMAKE_CXX_FLAGS="-D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short -DGGML_VISIONOS=1 ${COMMON_CXX_FLAGS}" \
189194
-S .
190-
cmake --build build-visionos-sim --config Release
195+
cmake --build build-visionos-sim --config Release -- -quiet
191196

192197
# Setup frameworks and copy binaries and headers
193198
setup_framework_structure "build-ios-sim" ${IOS_MIN_OS_VERSION}
@@ -204,7 +209,7 @@ combine_static_libraries() {
204209
local base_dir="$(pwd)"
205210

206211
# Combine all static libraries using libtool
207-
libtool -static -o "${base_dir}/${output_lib}" \
212+
libtool -static -no_warning_for_no_symbols -o "${base_dir}/${output_lib}" \
208213
"${base_dir}/${build_dir}/src/${platform}/libllama.a" \
209214
"${base_dir}/${build_dir}/ggml/src/${platform}/libggml.a" \
210215
"${base_dir}/${build_dir}/ggml/src/${platform}/libggml-base.a" \

0 commit comments

Comments
 (0)