Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 388-cmake-build-onl…
Browse files Browse the repository at this point in the history
…y-static-by-default
  • Loading branch information
DiamonDinoia committed Jul 18, 2024
2 parents 473735b + 9d9eb4f commit 6ff8c03
Show file tree
Hide file tree
Showing 18 changed files with 466 additions and 1,001 deletions.
408 changes: 0 additions & 408 deletions .github/workflows/cygwinccompiler.py

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/generate_matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import json

matrix = {
"include": []
}

python_versions = ["3.8", "3.11"]

combinations = {
"ubuntu-22.04": {
"compiler": ["llvm", "gcc"],
"arch_flags": ["-march=native", "-march=x86-64"]
},
"windows-2022": {
"compiler": ["msvc", "llvm"],
"arch_flags": ["/arch:AVX2", "/arch:SSE2"]
},
"macos-13": {
"compiler": ["llvm", "gcc-14"],
"arch_flags": ["-march=native", "-march=x86-64"]
}
}

for platform in combinations.keys():
for python_version in python_versions:
for compiler in combinations[platform]["compiler"]:
for arch_flag in combinations[platform]["arch_flags"]:
matrix["include"].append({
"os": platform,
"python-version": python_version,
"compiler": compiler,
"arch_flags": arch_flag
})

json_str = json.dumps(matrix, ensure_ascii=False)
print(json_str)
Binary file removed .github/workflows/libvcruntime140.a
Binary file not shown.
97 changes: 97 additions & 0 deletions .github/workflows/python_build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Build and test Python wheels

on: [push, pull_request]

jobs:
build_wheels_unix:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: 'python/finufft'
env:
CIBW_BEFORE_ALL_MACOS: brew install gcc@14 fftw
CIBW_ARCHS_MACOS: "x86_64"
# Need following versions of GCC for compatibility with fftw
# installed by homebrew. Similarly, we set the macOS version
# for compatibility with those libraries.
CIBW_ENVIRONMENT_MACOS: >
CC=gcc-14
CXX=g++-14
MACOSX_DEPLOYMENT_TARGET=13
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

build_wheels_macos_arm64:
name: Build wheels on macos-14
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: 'python/finufft'
env:
CIBW_ARCHS_MACOS: "arm64"
# Make sure to install the ARM64-specific versions of FFTW and GCC.
# Perhaps this is done automatically on the macos-14 image. We should
# look into this further.
CIBW_BEFORE_ALL_MACOS: |
pkg=$(brew fetch --force --bottle-tag=arm64_ventura fftw | grep 'Downloaded to' | cut -d' ' -f3)
brew install $pkg
pkg=$(brew fetch --force --bottle-tag=arm64_ventura gcc | grep 'Downloaded to' | cut -d' ' -f3)
brew install $pkg
CIBW_ENVIRONMENT_MACOS: >
CC=gcc-14
CXX=g++-14
MACOSX_DEPLOYMENT_TARGET=14
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-macos-arm64
path: ./wheelhouse/*.whl

build_wheels_win:
name: Build wheels on windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
# Here we install the mingw64 versions of gcc and FFTW that we will
# use to compile the library. We also need pkg-config so that cmake
# can easily find FFTW when configurating the build.
c:\msys64\usr\bin\pacman.exe -Sy --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-fftw mingw-w64-x86_64-pkgconf
# This particular install of mingw64 *is not* in the path by default
# (another one at c:\mingw64 is, however), so we add it to the path.
echo "c:\msys64\mingw64\bin;" >> $env:GITHUB_PATH
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: 'python/finufft'
env:
# This is required to force cmake to avoid using MSVC (the default).
# By setting the generator to Ninja, cmake will pick gcc (mingw64)
# as the compiler.
CIBW_CONFIG_SETTINGS: "cmake.args='-G Ninja'"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-windows
path: ./wheelhouse/*.whl
54 changes: 0 additions & 54 deletions .github/workflows/python_build_win.ps1

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/python_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test python skbuild with CMake

on: [push, pull_request]

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate matrix
id: generate_matrix
run: |
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
MATRIX=$(python3 ${{ github.workspace }}/.github/workflows/generate_matrix.py)
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
build:
name: Build with Pip
runs-on: ${{ matrix.os }}
needs: prepare
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: false
ninja: false
vcpkg: false
cppcheck: false
clangtidy: false
- name: Set min macOS version and install fftw
if: runner.os == 'macOS'
run: |
brew install fftw
- name: Install fftw
if: runner.os == 'linux'
run: |
sudo apt update
sudo apt install -y libfftw3-dev
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pytest
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest
- name: Set compiler flags
run: |
echo CMAKE_ARGS="-DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }}" >> $GITHUB_ENV
shell: bash
- name: Build
run: python3 -m pip install ${{ github.workspace }}/python/finufft --verbose
- name: Test
run: python3 -m pytest ${{ github.workspace }}/python/finufft/test
9 changes: 0 additions & 9 deletions .github/workflows/python_test_win.ps1

This file was deleted.

Loading

0 comments on commit 6ff8c03

Please sign in to comment.