[Build] Use brew clang compiler on mac#8704
Merged
Merged
Conversation
2a9cf33 to
a28d360
Compare
Contributor
Author
Contributor
Author
|
@feisuzhu thoughts on this? Anything you'd like me to check / test / modify / add / etc first, before we merge this? I think this is a first important step to being able to support building on Mac OS X Sequoia, 15.4.1., the latest/current version. |
bobcao3
approved these changes
May 5, 2025
Collaborator
bobcao3
left a comment
There was a problem hiding this comment.
This looks correct, so... let's just merge! Thanks
Contributor
Author
|
Awesome, thank you 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue: #
Brief Summary
Use brew clang compiler on mac
copilot:summary
Walkthrough
When building on latest Macs, e.g. Sequoia, the system clang is 16.0.0, or 17.0.0, depending on whether using XCode (16.0.0), or command line tools (17.0.0). Either way, the bytecode generated at python/taichi/_lib/runtime/runtime_arm64.bc is not loadable by llvm 15. Trying to load the clang-15/16 compiled runtime_arm64.bc with llvm 15 gives an error about unknown attribute (86). llvm 15 is the version of llvm used by taichi currently. therefore, building using system clang on macos sequoia prevents taichi from loading/running.
Example failure:
https://github.com/taichi-dev/taichi/actions/runs/14742813933/job/41384420135?pr=8688
To fix this, we use the clang from the brew installed llvm@15 instead. This then runs ok.
We assume in compile.py that brew has already been used earlier in the script to install llvm@15. We use brew config to locate brew, and then assume the clang path as
{HOMEBREW_PREFIX}/opt/llvm@15/bin/clang, and similarly for clang++.copilot:walkthrough