From d266f57c22daa9725a33747a6d14bbb50dbbd9a9 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Tue, 20 Feb 2024 15:59:57 -0500 Subject: [PATCH] Use new M1 runner to build arm64 Mac OS wheels natively --- .github/workflows/wheels.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5bd9b6c1c..1b576983c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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: | @@ -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: