fix: build libcustom_calls for arm64 only on macOS#2908
Closed
michaelxer wants to merge 1 commit into
Closed
Conversation
Fixes PennyLaneAI#2907 Add to linker args for the libcustom_calls extension on macOS. Previously, the extension was built as a universal2 binary (supporting both arm64 and x86_64), causing the wheel to be incorrectly tagged as universal2. This change ensures the library is built only for the local architecture (arm64 on Apple Silicon), matching all other binary artifacts in the Catalyst build. This eliminates the need for the rename step during wheel publishing and removes unused x86 code. Co-authored-by: Codex <codex@openai.com>
Contributor
|
Thank you for your interest in the project! Unfortunately the PR doesn't follow our stated policy and will have to be closed. |
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.
Summary
Fixes #2907
Add
-arch arm64to linker args for thelibcustom_callsextension on macOS. Previously, the extension was built as a universal2 binary (supporting both arm64 and x86_64), causing the wheel to be incorrectly tagged as universal2.Changes
extra_link_args=["-arch", "arm64"]to the macOSlibcustom_callsextensionImpact
Before:
libcustom_callsbuilt as universal2 → wheel tagged asmacosx_14_0_universal2After:
libcustom_callsbuilt for arm64 only → wheel tagged asmacosx_14_0_arm64This matches all other binary artifacts in the Catalyst build and eliminates:
Test plan
make wheelpython -m zipfile -l dist/*.whl | grep macosxfile frontend/catalyst/utils/libcustom_calls.sodelocate-wheel --require-archs=arm64without warningsNotes
This is a minimal, targeted fix. The change only affects the linker args for the
libcustom_callsextension on macOS. Other extensions (CMake-built) are already architecture-specific.