Skip to content

Commit

Permalink
splitting into two workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Feb 14, 2025
1 parent a8766d4 commit 87277c7
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@ on: [push, pull_request]
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build_wheels_unix:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
os: [ubuntu-22.04, windows-2022]
# python-version: [3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.8, pypy3.9, pypy3.10, pypy3.11, pypy3.12, pypy3.13]
include:
- os: ubuntu-22.04
toolchain: gcc
arch_flags: "-march=x86-64" # probably -march=x86-64_v2 is safe
cuda_flags: "-march=x86-64"
- os: macos-13
toolchain: llvm
arch_flags: "-mcpu=apple-m3"
cuda_flags: "-mcpu=apple-m3"
- os: windows-2022
toolchain: llvm
arch_flags: "-march=x86-64-v2" # Windows11 requires avx2 so this should be fine
cuda_flags: "/arch:SSE2"
toolchain: msvc-2019
arch_flags: "/arch:SSE2" # Windows11 requires avx2 so this should be fine
steps:
- uses: actions/checkout@v4
- name: Setup Cpp
Expand All @@ -41,25 +35,19 @@ jobs:
vcpkg: false
cppcheck: false
clangtidy: false
- name: Install cuda
uses: Jimver/[email protected]
with:
cuda: '11.4.0'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Build finufft wheels
shell: bash
run: |
python -m pip wheel python/finufft/ --wheel-dir=wheelhouse \
-C cmake.define.CMAKE_BUILD_TYPE=Release \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} \
-C cmake.define.FINUFFT_USE_DUCC0=OFF \
-C cmake.define.CMAKE_GENERATOR=Ninja \
-C cmake.define.CMAKE_GENERATOR_PLATFORM=
rm -rf build
- name: install gcc10 on Linux
if: runner.os == 'Linux'
- name: use gcc-10 on linux
if: matrix.os == 'ubuntu-22.04'
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60
Expand All @@ -72,35 +60,16 @@ jobs:
sudo update-alternatives --set c++ /usr/bin/g++
echo "gcc version: $(cc --version)"
echo "g++ version: $(c++ --version)"
- name: install msvc on windows
if: runner.os == 'Windows'
uses: aminya/setup-cpp@v1
with:
compiler: msvc-2019
vcvarsall: false
cmake: true
ninja: true
vcpkg: false
cppcheck: false
clangtidy: false
- name: Install cuda
if: runner.os != 'macOS' # Skip this step on macOS
uses: Jimver/[email protected]
with:
cuda: '11.4.0'
- name: Build cufinufft wheels
if: runner.os != 'macOS' # Skip this step on macOS
shell: bash
run: |
CC=gcc-10 CXX=g++-10 \
python -m pip wheel python/cufinufft/ --wheel-dir=wheelhouse \
-C cmake.define.CMAKE_BUILD_TYPE=Release \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.cuda_flags }} \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} \
-C cmake.define.FINUFFT_USE_DUCC0=OFF \
-C cmake.define.CMAKE_GENERATOR=Ninja \
-C cmake.define.CMAKE_GENERATOR_PLATFORM= \
-C cmake.define.FINUFFT_CUDA_ARCHITECTURES=all-major
rm -rf build
- name: Delete unnecessary wheels
run: |
rm -f wheelhouse/*numpy*.whl
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/build_finufft_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and test Python wheels

# testing only should be commented out in the final version
on: [push, pull_request]
# this is the release version
#on:
# push:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
# python-version: [3.8, 3.9, 3.10, 3.11, 3.12, 3.13, pypy3.8, pypy3.9, pypy3.10, pypy3.11, pypy3.12, pypy3.13]
include:
- os: ubuntu-22.04
toolchain: gcc
arch_flags: "-march=x86-64" # probably -march=x86-64_v2 is safe
- os: macos-13
toolchain: llvm
arch_flags: "-mcpu=apple-m3"
- os: windows-2022
toolchain: llvm
arch_flags: "-march=x86-64-v2" # Windows11 requires avx2 so this should be fine
steps:
- uses: actions/checkout@v4
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.toolchain }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
vcpkg: false
cppcheck: false
clangtidy: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Build finufft wheels
shell: bash
run: |
python -m pip wheel python/finufft/ --wheel-dir=wheelhouse \
-C cmake.define.CMAKE_BUILD_TYPE=Release \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} \
-C cmake.define.FINUFFT_USE_DUCC0=OFF \
-C cmake.define.CMAKE_GENERATOR=Ninja \
-C cmake.define.CMAKE_GENERATOR_PLATFORM=
- name: Delete unnecessary wheels
run: |
rm -f wheelhouse/*numpy*.whl
rm -f wheelhouse/*packaging*.whl
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

0 comments on commit 87277c7

Please sign in to comment.