Skip to content

Conversation

@vimarsh6739
Copy link
Member

@vimarsh6739 vimarsh6739 commented Oct 21, 2025

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 with xla which needs atleast version 10.13.

The using_clang definition is to increase bracket depth for TransformOps (we have more than 256 patterns, and Apple clang again has a max depth of 256).


# macos specific config
build:macos --macos_minimum_os=11.3
build:macos --define using_clang=true
Copy link
Member

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.

Copy link
Member

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

Copy link
Member Author

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

define_values = {"using_clang": "true"},

Copy link
Member Author

@vimarsh6739 vimarsh6739 Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giordano @wsmoses What should I specify here for now then(default toolchain on mac is clang)?

Copy link
Member

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)

Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants