Skip to content

macOS wheels: support macOS 12+ on Apple Silicon - #165

Merged
eriknw merged 2 commits into
GraphBLAS:mainfrom
eriknw:macos-deployment-target
Nov 26, 2026
Merged

eriknw merged 2 commits into
GraphBLAS:mainfrom
eriknw:macos-deployment-target

Conversation

@eriknw

@eriknw eriknw commented Nov 25, 2026

Copy link
Copy Markdown
Member

Summary

Since 10.5.1.1 the Apple Silicon wheels are tagged macosx_15_0_arm64, so pip install suitesparse-graphblas on an M1/M2/M3 Mac running macOS 12, 13 or 14 downloads the sdist and tries to compile GraphBLAS. The tag was never a choice. wheels.yml set MACOSX_DEPLOYMENT_TARGET from the minos of Homebrew's libomp. Homebrew builds libomp for the runner's macOS, and that became 15 when the arm64 job moved to macos-15.

 wheels.yml, "Install tools (macOS)"
-  brew reinstall libomp                       # built for the runner's macOS (15)
-  MACOSX_DEPLOYMENT_TARGET = minos of that libomp
+  micromamba: conda-forge llvm-openmp=23.1.6  # minos 11.0; scikit-learn does the same
+  MACOSX_DEPLOYMENT_TARGET = matrix.macos_deployment_target
+    arm64:  12.0                              # as SciPy and scikit-learn
+    x86_64: 14.0                              # unchanged
 suitesparse.sh
-  BREW_LIBOMP=1: -I/-L $(brew --prefix libomp)
+  LIBOMP_PREFIX: -I/-L, plus an rpath (conda-forge's libomp is @rpath/libomp.dylib)
+  BREW_LIBOMP=1 still means Homebrew's libomp

The second commit logs the llvm-openmp build string and its minos in the job log, since the pin is on the version only.

Evidence

  • Before: PyPI 10.5.2.0 has macosx_15_0_arm64 and macosx_14_0_x86_64 wheels. 10.5.1.0 and earlier had macosx_14_0_arm64.
  • After, in a local build (macOS arm64): with the target at 12.0, libgraphblas has minos 12.0, delocate keeps the macosx_12_0_arm64 tag, and the wheel's tests pass with the bundled libomp (OpenMP on, 18 threads).
  • Guard: delocate 0.13 refuses to build a wheel when a bundled library needs a newer macOS than the target. A newer libomp can't slip in under a 12.0 tag.
  • Not yet run: the wheel on a real macOS 12 to 14 Mac. GitHub no longer has runners that old.

Merge Danger

Door: two-way for the repo, since a revert restores Homebrew's libomp. A release is different: once a macosx_12_0_arm64 wheel is on PyPI, pip on macOS 12 to 14 installs it instead of the sdist. If it were broken there, the fix would be a yank or a post release.

Blast Radius: macOS wheels.

Every macOS wheel, on both arches, bundles conda-forge's OpenMP runtime instead of Homebrew's. Linux, Windows, Pyodide and conda-forge packages are unaffected.

The wheels bundle libomp, so they can't support an older macOS than it
does, and wheels.yml took the deployment target from Homebrew's libomp,
which is built for the runner's macOS.  Since the arm64 job moved to
macos-15, the arm64 wheels have needed macOS 15 (macosx_15_0_arm64 from
10.5.1.1), and pip on macOS 12 to 14 arm64 builds the sdist instead.

Take llvm-openmp from conda-forge (it supports macOS 11.0 and later)
through micromamba, as scikit-learn does, and pin the deployment target
per job: 12.0 on arm64, as SciPy and scikit-learn use, and 14.0, as now,
on x86_64.  suitesparse.sh takes the libomp prefix in LIBOMP_PREFIX
(BREW_LIBOMP=1 still means Homebrew's) and adds an rpath to it, since
conda-forge's libomp has the install name @rpath/libomp.dylib.
The pin is on the version only, so print the package list, which has
the build string, next to the library's minimum macOS.
@eriknw

eriknw commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

I'm happy to defer build things to agents who are better at it than I am. Merging.

@eriknw
eriknw merged commit 1186d27 into GraphBLAS:main Nov 26, 2026
33 checks passed
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.

1 participant