@@ -17,19 +17,34 @@ jobs:
1717
1818 steps :
1919 - uses : actions/checkout@v4
20- - uses : actions/setup-python@v5
21- with : {python-version: "3.11"}
2220
21+ # ---------- macOS: install libomp -----------------
22+ - name : Install libomp (macOS only)
23+ if : matrix.os == 'macos-latest'
24+ run : brew install libomp
25+
26+ # ---------- build wheels --------------------------
2327 - name : Build wheels
2428 uses : pypa/cibuildwheel@v2.18.1
25- with : {output-dir: wheelhouse}
26-
27- - name : Build sdist (only once, on Linux)
29+ with :
30+ output-dir : wheelhouse
31+ env :
32+ # clang needs these flags to use Homebrew’s libomp
33+ CIBW_ENVIRONMENT_MACOS : |
34+ CFLAGS="-O3 -march=native -funroll-loops -ffast-math -fPIC -Xpreprocessor -fopenmp"
35+ LDFLAGS="-lomp"
36+ CIBW_SKIP : " pp* *musllinux*"
37+
38+ # Linux job also builds an sdist once:
39+ - name : Build sdist
2840 if : matrix.os == 'ubuntu-latest'
29- run : python -m pip install --upgrade build && python -m build --sdist -o wheelhouse
41+ run : python -m pip install build && python -m build --sdist -o wheelhouse
3042
43+ # ---------- publish --------------------------------
3144 - name : Publish to PyPI
3245 uses : pypa/gh-action-pypi-publish@release/v1
33- with : {packages_dir: wheelhouse, skip_existing: true}
46+ with :
47+ packages_dir : wheelhouse
48+ skip_existing : true
3449
3550
0 commit comments