Skip to content

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
blazej-bucha committed Jul 2, 2024
2 parents d3fd440 + 1d031a2 commit 4aeb9bf
Show file tree
Hide file tree
Showing 273 changed files with 13,124 additions and 8,465 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/wheels.yml
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tests/genref_run[fq]_omp
tests/genref-output
wrap/pyharm/_data_types.py
wrap/pyharm/__init__.py
wrap/pyharm/lib/*
wrap/pyharm/libcharm*.so
wrap/pyharm.egg-info
wrap/pyharm[f].egg-info
wrap/pyharmf
Expand Down
Loading

0 comments on commit 4aeb9bf

Please sign in to comment.