Skip to content

Commit

Permalink
Use new M1 runner to build arm64 Mac OS wheels natively
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Feb 20, 2024
1 parent c2d3303 commit d266f57
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ jobs:
buildplat:
- [ubuntu-latest, manylinux, x86_64]
- [macos-latest, macosx, x86_64]
- [macos-latest, macosx, arm64]
- [macos-14, macosx, arm64]
- [windows-2019, win, amd64]
python: ["cp38", "cp39", "cp310", "cp311", "cp312"]
steps:
- uses: actions/checkout@v4
- name: Install GSL (Windows / Mac OS x86_64)
uses: mamba-org/setup-micromamba@v1
if: matrix.buildplat[1] == 'win' || ( matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'x86_64' )
if: matrix.buildplat[1] == 'win' || matrix.buildplat[1] == 'macosx'
with:
environment-name: gsl
condarc: |
Expand All @@ -57,36 +57,14 @@ jobs:
echo "LIB=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "LIBPATH=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "$CONDA_PREFIX\\Library\\bin" >> $GITHUB_PATH # necessary when we don't activate the environment
- name: Set GSL environment variables (Mac OS x86_64)
if: matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'x86_64'
- name: Set GSL environment variables (Mac OS)
if: matrix.buildplat[1] == 'macosx'
shell: bash -l {0}
run: |
echo "CFLAGS=-I$CONDA_PREFIX/include" >> $GITHUB_ENV
echo "LDFLAGS=-L$CONDA_PREFIX/lib" >> $GITHUB_ENV
echo "REPAIR_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV # https://github.com/pypa/cibuildwheel/issues/816#issuecomment-916197079
echo "$CONDA_PREFIX/bin" >> $GITHUB_PATH # necessary when we don't activate the environment
- name: Install GSL (Mac OS ARM64) !HACK!
if: matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'arm64'
run: |
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/gsl-2.7-h6e638da_0.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/libblas-3.9.0-16_osxarm64_openblas.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/libcblas-3.9.0-16_osxarm64_openblas.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/libopenblas-0.3.21-openmp_hc731615_3.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran-5.0.0-11_3_0_hd922786_25.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/libgfortran5-11.3.0-hdaf2cc0_25.tar.bz2
curl -O https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-14.0.4-hd125106_0.tar.bz2
mkdir gsl
tar -xjf gsl-2.7-h6e638da_0.tar.bz2 -C gsl
tar -xjf libblas-3.9.0-16_osxarm64_openblas.tar.bz2 -C gsl
tar -xjf libcblas-3.9.0-16_osxarm64_openblas.tar.bz2 -C gsl
tar -xjf libopenblas-0.3.21-openmp_hc731615_3.tar.bz2 -C gsl
tar -xjf libgfortran-5.0.0-11_3_0_hd922786_25.tar.bz2 -C gsl
tar -xjf libgfortran5-11.3.0-hdaf2cc0_25.tar.bz2 -C gsl
tar -xjf llvm-openmp-14.0.4-hd125106_0.tar.bz2 -C gsl
rsync -azv gsl/bin/ /usr/local/bin/
rsync -azv gsl/include/ /usr/local/include/
rsync -azv gsl/lib/ /usr/local/lib/
echo "REPAIR_LIBRARY_PATH=/usr/local/lib/" >> $GITHUB_ENV # https://github.com/pypa/cibuildwheel/issues/816#issuecomment-916197079
- name: Build wheels
uses: pypa/cibuildwheel@v2.16
env:
Expand Down

0 comments on commit d266f57

Please sign in to comment.