|
8 | 8 | runs-on: ${{ matrix.os }} |
9 | 9 | strategy: |
10 | 10 | matrix: |
11 | | - os: [ubuntu-latest, windows-latest, macos-15-intel, macos-latest] |
12 | | - include: |
13 | | - - os: macos-15-intel |
14 | | - c_compiler: gcc-15 |
15 | | - - os: macos-latest |
16 | | - c_compiler: gcc-15 |
| 11 | + os: |
| 12 | + - ubuntu-latest |
| 13 | + - windows-latest |
| 14 | + - macos-15-intel |
| 15 | + - macos-15 |
17 | 16 |
|
18 | 17 | steps: |
19 | 18 | - uses: actions/checkout@v4 |
20 | 19 |
|
21 | | - # Used to host cibuildwheel |
22 | 20 | - uses: actions/setup-python@v5 |
23 | 21 | with: |
24 | 22 | python-version: "3.11" |
25 | 23 |
|
26 | | - - name: Install gcc on macOS |
27 | | - if: runner.os == 'macOS' |
28 | | - run: brew install gcc@15 |
29 | | - |
30 | 24 | - name: Install libomp on macOS |
31 | 25 | if: runner.os == 'macOS' |
32 | 26 | run: brew install libomp |
33 | 27 |
|
| 28 | + - name: Export libomp paths on macOS |
| 29 | + if: runner.os == 'macOS' |
| 30 | + run: | |
| 31 | + echo "LIBOMP_PREFIX=$(brew --prefix libomp)" >> "$GITHUB_ENV" |
| 32 | +
|
34 | 33 | - name: Install cibuildwheel |
35 | 34 | run: python -m pip install cibuildwheel |
36 | 35 |
|
37 | 36 | - name: Build wheels |
38 | 37 | env: |
39 | | - CIBW_ENVIRONMENT_MACOS: CC=gcc-15 MACOSX_DEPLOYMENT_TARGET=26.0 |
| 38 | + CIBW_ENVIRONMENT_LINUX: >- |
| 39 | + CFLAGS=-fopenmp |
| 40 | + CXXFLAGS=-fopenmp |
| 41 | + LDFLAGS=-fopenmp |
| 42 | + CIBW_ENVIRONMENT_WINDOWS: >- |
| 43 | + CL=/openmp |
| 44 | + CIBW_ENVIRONMENT_MACOS: >- |
| 45 | + CC=clang |
| 46 | + CXX=clang++ |
| 47 | + MACOSX_DEPLOYMENT_TARGET=15.0 |
| 48 | + CPPFLAGS=-I${{ env.LIBOMP_PREFIX }}/include |
| 49 | + CFLAGS=-Xpreprocessor\ -fopenmp |
| 50 | + CXXFLAGS=-Xpreprocessor\ -fopenmp |
| 51 | + LDFLAGS=-L${{ env.LIBOMP_PREFIX }}/lib\ -Wl,-rpath,${{ env.LIBOMP_PREFIX }}/lib\ -lomp |
40 | 52 | run: python -m cibuildwheel --output-dir wheelhouse |
41 | 53 |
|
42 | | - - name: Test on all platforms except MacOS |
| 54 | + - name: Test on all platforms except macOS |
43 | 55 | if: runner.os != 'macOS' |
44 | 56 | run: | |
45 | 57 | python -m pip install -r REQUIREMENTS.txt |
46 | 58 | python -m pip install -e . |
47 | 59 | python -m pip install -r REQUIREMENTS-DEV.txt |
48 | 60 | pytest -v |
49 | 61 |
|
50 | | - - name: Test on MacOS |
| 62 | + - name: Test on macOS |
51 | 63 | if: runner.os == 'macOS' |
52 | 64 | env: |
53 | | - CC: gcc-15 |
| 65 | + CC: clang |
| 66 | + CXX: clang++ |
| 67 | + MACOSX_DEPLOYMENT_TARGET: "15.0" |
| 68 | + CPPFLAGS: -I${{ env.LIBOMP_PREFIX }}/include |
| 69 | + CFLAGS: -Xpreprocessor -fopenmp |
| 70 | + CXXFLAGS: -Xpreprocessor -fopenmp |
| 71 | + LDFLAGS: -L${{ env.LIBOMP_PREFIX }}/lib -Wl,-rpath,${{ env.LIBOMP_PREFIX }}/lib -lomp |
54 | 72 | run: | |
55 | 73 | python -m pip install -r REQUIREMENTS.txt |
56 | 74 | python -m pip install -e . |
|
0 commit comments