-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
273 changed files
with
13,124 additions
and
8,465 deletions.
There are no files selected for viewing
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,103 @@ | ||
name: Build wheels | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-12, macos-14, windows-latest] | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Get CCCL wrapper for MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
run: | | ||
git clone https://github.com/swig/cccl cccl-repo | ||
- name: Install FFTW | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get install -y libfftw3-dev | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
brew install fftw | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
vcpkg install fftw3:x64-windows | ||
fi | ||
- name: Configure installation | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
export CFLAGS="-O3 -ffast-math -Wpedantic -Wall" | ||
./configure --enable-openmp --enable-avx --enable-python --with-gnu-ld | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
export CC=gcc-13 | ||
export CFLAGS="-O3 -ffast-math -Wpedantic -Wall" | ||
export CPPFLAGS="-I$(brew --prefix)/include" | ||
export LDFLAGS="-L$(brew --prefix)/lib" | ||
if [ "$RUNNER_ARCH" == "ARM64" ]; then | ||
# NEON instructions are not yet supported, so no SIMD in this | ||
# case | ||
./configure --enable-openmp --enable-python --with-gnu-ld | ||
else | ||
./configure --enable-openmp --enable-avx --enable-python --with-gnu-ld | ||
fi | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
export PATH=./cccl-repo:$PATH | ||
export CC=cccl | ||
export LD=cccl | ||
export CFLAGS="/O2 /fp:fast /FS /GL" | ||
export CPPFLAGS="-IC:\vcpkg\installed\x64-windows\include" | ||
export LDFLAGS="-LC:\vcpkg\installed\x64-windows\lib" | ||
./configure --enable-openmp --enable-avx --enable-python --enable-msvc-underscore-patch | ||
fi | ||
- name: Compile and run the test suite | ||
run: | | ||
if [ "$RUNNER_OS" == "macOS" ]; then | ||
make -j && make check | ||
fi | ||
# On Linux, the library has to be compiled and the test suite must be | ||
# executed later inside the container. On Windows, the test suite is | ||
# not executed for now. | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.17.0 | ||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" | ||
CIBW_SKIP: "cp36-* cp37-* cp38-* pp37-* pp38-* *-manylinux_i686 *-musllinux_i686 *-win32*" | ||
CIBW_CACHE_PATH: "./cibw_cache" | ||
CIBW_ENVIRONMENT_MACOS: CC=gcc-13 | ||
CIBW_ENVIRONMENT_LINUX: CC='gcc' CFLAGS='-O3 -ffast-math -Wpedantic -Wall' LIBS='-lgomp' | ||
# On Linux, we need to install the dependencies and configure the | ||
# installation again, this time inside the container. | ||
CIBW_BEFORE_ALL_LINUX: "yum install -y fftw-devel || apk add --upgrade fftw-dev || apt-get install -y libfftw3-dev && make clean && ./configure --enable-openmp --enable-avx --enable-python --with-gnu-ld && make -j && make check" | ||
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: 'delvewheel repair --add-path C:\vcpkg\installed\x64-windows\bin -w {dest_dir} {wheel}' | ||
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" | ||
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux_2_28" | ||
|
||
with: | ||
package-dir: . | ||
output-dir: wheelhouse | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl |
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
Oops, something went wrong.