Skip to content

Commit

Permalink
Fix CasADi libs workaround for macOS wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Aug 28, 2024
1 parent ac6c450 commit 76e12c2
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ jobs:
- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.12.0 https://github.com/pybind/pybind11.git -c advice.detachedHead=false

- name: Set macOS-specific environment variables
run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV

- name: Install cibuildwheel
run: python -m pip install cibuildwheel

Expand Down Expand Up @@ -243,16 +240,11 @@ jobs:
python scripts/install_KLU_Sundials.py
python -m cibuildwheel --output-dir wheelhouse
env:
# 10.13 for Intel (macos-12), 11.0 for Apple Silicon (macos-13, macos-14, and macos-latest)
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '11.0' || '10.13' }}
CIBW_ARCHS_MACOS: auto
CIBW_BEFORE_BUILD: python -m pip install cmake casadi setuptools wheel delocate
CIBW_REPAIR_WHEEL_COMMAND: |
if [[ $(uname -m) == "x86_64" ]]; then
delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
elif [[ $(uname -m) == "arm64" ]]; then
# Use higher macOS target for now: https://github.com/casadi/casadi/issues/3698
delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel} --require-target-macos-version 11.1
for file in {dest_dir}/*.whl; do mv "$file" "${file//macosx_11_1/macosx_11_0}"; done
fi
CIBW_REPAIR_WHEEL_COMMAND: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
CIBW_TEST_EXTRAS: "all,dev,jax"
CIBW_TEST_COMMAND: |
set -e -x
Expand Down

0 comments on commit 76e12c2

Please sign in to comment.