Skip to content

Fix macOS x86_64 wheel build by preferring Conda OpenMP runtime#2

Closed
RAMitchell wants to merge 1 commit intopr-12086-basefrom
pr-12086-ci-fix
Closed

Fix macOS x86_64 wheel build by preferring Conda OpenMP runtime#2
RAMitchell wants to merge 1 commit intopr-12086-basefrom
pr-12086-ci-fix

Conversation

@RAMitchell
Copy link
Copy Markdown
Owner

Summary

This fixes the macOS x86_64 wheel CI failure seen in PR dmlc#12086.

The failing job was:

  • Build macOS wheel (macosx_x86_64)

delocate failed while repairing the wheel because libxgboost.dylib picked up Homebrew LLVM's libunwind.1.0.dylib, and that dependency requires macOS 14.0 even though the wheel target is macOS 10.15.

Root Cause

On the macOS Intel runner, the wheel build was resolving OpenMP through Homebrew. That in turn introduced a dependency on Homebrew LLVM's libunwind, which caused wheel repair to fail with:

delocate.libsana.DelocationError: Library dependencies do not satisfy target MacOS version 10.15:
.../libunwind.1.0.dylib has a minimum target of 14.0

Fix

This PR makes the macOS wheel build prefer Conda's llvm-openmp runtime instead of relying on Homebrew's OpenMP path:

  • install llvm-openmp in the Conda environment during macOS wheel builds
  • add CMAKE_PREFIX_PATH=$CONDA_PREFIX for the wheel build
  • update FindOpenMPMacOS.cmake to prefer $CONDA_PREFIX/lib/libomp.dylib when available
  • keep the Conda lib directory ahead of Homebrew in the macOS runtime search path

This avoids pulling Homebrew LLVM's libunwind into the wheel repair step and preserves the existing macOS 10.15 deployment target.

Why not bump the deployment target?

A simpler workaround would be to raise the Intel macOS wheel target from 10.15 to 14.0, but that would be a significant compatibility drop for macOS x86_64 users. This change keeps the current support target intact and fixes the dependency resolution instead.

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