-
Notifications
You must be signed in to change notification settings - Fork 20
Fix MacOS local builds #1500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix MacOS local builds #1500
Conversation
|
|
||
| # macos specific config | ||
| build:macos --macos_minimum_os=11.3 | ||
| build:macos --define using_clang=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically one could compile with GCC on macOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean frankly the correct thing to do is to replace the using clang flag we added here with a detection of the compiler type from within Bazel and select based off that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using_clang is simply bumping up bracket-depth here
Enzyme-JAX/src/enzyme_ad/jax/BUILD
Line 22 in f5cf0aa
| define_values = {"using_clang": "true"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default toolchain on mac is clang
"default" != "only option possible" (although perhaps that's what XLA wants you to believe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vimarsh6739 so higher level question, what are you trying to do with this here?
macos as a build clearly works since CI says it builds.
if the goal is to make it easier to build, I would replace the using_clang variable with an autodetection within bazel that determins if clang is being used, and adds the template copt automatically (so no one needs to manually specify using clang).
Currently, MacOS builds of Enzyme-JAX fail without setting these options in bazelrc. Apple clang 17.0.0 defaults to using
-mmacosx-version-min=10.11, which doesn't play well withxlawhich needs atleast version10.13.The
using_clangdefinition is to increase bracket depth for TransformOps (we have more than 256 patterns, and Apple clang again has a max depth of 256).