Skip to content

fix: build libcustom_calls for arm64 only on macOS#2908

Closed
michaelxer wants to merge 1 commit into
PennyLaneAI:mainfrom
michaelxer:fix-platform-tag-macos-wheels
Closed

fix: build libcustom_calls for arm64 only on macOS#2908
michaelxer wants to merge 1 commit into
PennyLaneAI:mainfrom
michaelxer:fix-platform-tag-macos-wheels

Conversation

@michaelxer
Copy link
Copy Markdown

@michaelxer michaelxer commented Jun 3, 2026

Summary

Fixes #2907

Add -arch arm64 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.

Changes

  • setup.py — Added extra_link_args=["-arch", "arm64"] to the macOS libcustom_calls extension

Impact

Before: libcustom_calls built as universal2 → wheel tagged as macosx_14_0_universal2

After: libcustom_calls built for arm64 only → wheel tagged as macosx_14_0_arm64

This matches all other binary artifacts in the Catalyst build and eliminates:

  • The rename step during wheel publishing
  • Unused x86 code in the library

Test plan

  • Build wheel on macOS arm64: make wheel
  • Verify wheel tag: python -m zipfile -l dist/*.whl | grep macosx
  • Verify library architecture: file frontend/catalyst/utils/libcustom_calls.so
  • Run delocate-wheel --require-archs=arm64 without warnings

Notes

This is a minimal, targeted fix. The change only affects the linker args for the libcustom_calls extension on macOS. Other extensions (CMake-built) are already architecture-specific.


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>
@github-actions github-actions Bot added the external PRs where the author is not a part of PennyLane Org (or part of external contributors team) label Jun 3, 2026
@dime10
Copy link
Copy Markdown
Contributor

dime10 commented Jun 3, 2026

Thank you for your interest in the project! Unfortunately the PR doesn't follow our stated policy and will have to be closed.

@dime10 dime10 closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PRs where the author is not a part of PennyLane Org (or part of external contributors team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix platform tag for macOS wheels

2 participants