You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On macOS systems (particularly Apple Silicon), the backend build fails when using the LLVM Clang compiler installed via Homebrew (/opt/homebrew/opt/llvm/bin/clang++), due to compatibility issues with Apple's system frameworks.
Problem
When compiling whisper.cpp, the build process triggers thousands of warnings and eventually fails with fatal errors, particularly in ggml-blas.cpp, related to Clang's interpretation of Apple framework headers:
warning: type nullability specifier ‘_Nullable’ is a Clang extension [-Wnullability-extension]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
These warnings originate from system headers like CoreGraphics and CoreVideo, which rely on Clang extensions that Apple Clang supports, but Homebrew LLVM Clang does not.
Solution
Switching back to the default Apple Clang compiler (i.e. clang and clang++ from the Xcode toolchain) resolves the issue.
Suggestion
Default to Apple Clang on macOS in the build_whisper.sh script.
The text was updated successfully, but these errors were encountered:
Hi! @r-huijts
To force the use of Apple’s Xcode toolchain clang on macOS, you can add a little “OS check” at the top of your build_whisper.sh that overrides CC/CXX to point at /usr/bin/clang and /usr/bin/clang++ (or use xcrun to locate them). Here’s a concrete patch:
--- a/build_whisper.sh
+++ b/build_whisper.sh
@@ -1,6 +1,15 @@
#!/usr/bin/env bash
set -e
+
+# On macOS, force Apple Clang (not Homebrew LLVM)
+if [[ "$(uname)" == "Darwin" ]]; then
+ echo "macOS detected – switching to Xcode Clang"
+ # Prefer xcrun if available, fallback to /usr/bin
+ export CC="$(xcrun --find clang 2>/dev/null || echo /usr/bin/clang)"
+ export CXX="$(xcrun --find clang++ 2>/dev/null || echo /usr/bin/clang++)"
+ echo " CC -> $CC"
+ echo " CXX -> $CXX"
+fi
+
# … rest of your build script …
Summary
On macOS systems (particularly Apple Silicon), the backend build fails when using the LLVM Clang compiler installed via Homebrew (
/opt/homebrew/opt/llvm/bin/clang++
), due to compatibility issues with Apple's system frameworks.Problem
When compiling
whisper.cpp
, the build process triggers thousands of warnings and eventually fails with fatal errors, particularly inggml-blas.cpp
, related to Clang's interpretation of Apple framework headers:warning: type nullability specifier ‘_Nullable’ is a Clang extension [-Wnullability-extension]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
These warnings originate from system headers like
CoreGraphics
andCoreVideo
, which rely on Clang extensions that Apple Clang supports, but Homebrew LLVM Clang does not.Solution
Switching back to the default Apple Clang compiler (i.e.
clang
andclang++
from the Xcode toolchain) resolves the issue.Suggestion
build_whisper.sh
script.The text was updated successfully, but these errors were encountered: