|
| 1 | +name: Build and test Python wheels |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_wheels_unix: |
| 7 | + name: Build wheels on ${{ matrix.os }} |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, macos-13] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Build wheels |
| 17 | + |
| 18 | + with: |
| 19 | + package-dir: 'python/finufft' |
| 20 | + env: |
| 21 | + CIBW_BEFORE_ALL_MACOS: brew install gcc@14 fftw |
| 22 | + CIBW_ARCHS_MACOS: "x86_64" |
| 23 | + # Need following versions of GCC for compatibility with fftw |
| 24 | + # installed by homebrew. Similarly, we set the macOS version |
| 25 | + # for compatibility with those libraries. |
| 26 | + CIBW_ENVIRONMENT_MACOS: > |
| 27 | + CC=gcc-14 |
| 28 | + CXX=g++-14 |
| 29 | + MACOSX_DEPLOYMENT_TARGET=13 |
| 30 | +
|
| 31 | + - uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: cibw-wheels-${{ matrix.os }} |
| 34 | + path: ./wheelhouse/*.whl |
| 35 | + |
| 36 | + build_wheels_macos_arm64: |
| 37 | + name: Build wheels on macos-14 |
| 38 | + runs-on: macos-14 |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Build wheels |
| 44 | + |
| 45 | + with: |
| 46 | + package-dir: 'python/finufft' |
| 47 | + env: |
| 48 | + CIBW_ARCHS_MACOS: "arm64" |
| 49 | + # Make sure to install the ARM64-specific versions of FFTW and GCC. |
| 50 | + # Perhaps this is done automatically on the macos-14 image. We should |
| 51 | + # look into this further. |
| 52 | + CIBW_BEFORE_ALL_MACOS: | |
| 53 | + pkg=$(brew fetch --force --bottle-tag=arm64_ventura fftw | grep 'Downloaded to' | cut -d' ' -f3) |
| 54 | + brew install $pkg |
| 55 | + pkg=$(brew fetch --force --bottle-tag=arm64_ventura gcc | grep 'Downloaded to' | cut -d' ' -f3) |
| 56 | + brew install $pkg |
| 57 | + CIBW_ENVIRONMENT_MACOS: > |
| 58 | + CC=gcc-14 |
| 59 | + CXX=g++-14 |
| 60 | + MACOSX_DEPLOYMENT_TARGET=14 |
| 61 | +
|
| 62 | + - uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: cibw-wheels-macos-arm64 |
| 65 | + path: ./wheelhouse/*.whl |
| 66 | + |
| 67 | + build_wheels_win: |
| 68 | + name: Build wheels on windows |
| 69 | + runs-on: windows-latest |
| 70 | + |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + |
| 74 | + - name: Install dependencies |
| 75 | + run: | |
| 76 | + # Here we install the mingw64 versions of gcc and FFTW that we will |
| 77 | + # use to compile the library. We also need pkg-config so that cmake |
| 78 | + # can easily find FFTW when configurating the build. |
| 79 | + c:\msys64\usr\bin\pacman.exe -Sy --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-fftw mingw-w64-x86_64-pkgconf |
| 80 | + # This particular install of mingw64 *is not* in the path by default |
| 81 | + # (another one at c:\mingw64 is, however), so we add it to the path. |
| 82 | + echo "c:\msys64\mingw64\bin;" >> $env:GITHUB_PATH |
| 83 | +
|
| 84 | + - name: Build wheels |
| 85 | + |
| 86 | + with: |
| 87 | + package-dir: 'python/finufft' |
| 88 | + env: |
| 89 | + # This is required to force cmake to avoid using MSVC (the default). |
| 90 | + # By setting the generator to Ninja, cmake will pick gcc (mingw64) |
| 91 | + # as the compiler. |
| 92 | + CIBW_CONFIG_SETTINGS: "cmake.args='-G Ninja'" |
| 93 | + |
| 94 | + - uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: cibw-wheels-windows |
| 97 | + path: ./wheelhouse/*.whl |
0 commit comments