Skip to content

Commit 7499b7a

Browse files
committed
ci: fix macOS build (no OpenMP)
1 parent b6ad770 commit 7499b7a

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

.github/workflows/workflow.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pycpet"
7-
version = "0.0.3"
7+
version = "0.0.4"
88
authors = [
99
{ name="Pujan Ajmera", email="ajmerapujan@gmail.com" },
1010
]

0 commit comments

Comments
 (0)