-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into 388-cmake-build-onl…
…y-static-by-default
- Loading branch information
Showing
18 changed files
with
466 additions
and
1,001 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.