-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (129 loc) · 5.36 KB
/
build-wheels.yml
File metadata and controls
144 lines (129 loc) · 5.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build wheels
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
# VieCut's bundled tlx uses cmake_minimum_required(VERSION 2.8) which
# CMake 4.x rejects. This env var tells CMake to accept older policies.
CMAKE_ARGS: "-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
jobs:
build-linux:
name: Linux ${{ matrix.manylinux_tag }} ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]
manylinux: ["quay.io/pypa/manylinux2014_x86_64", "manylinux_2_28"]
include:
- manylinux: "quay.io/pypa/manylinux2014_x86_64"
manylinux_tag: manylinux_2_17
before_all: >-
yum install -y epel-release &&
yum install -y hwloc-devel &&
ln -sf /opt/python/cp312-cp312/bin/python3 /usr/local/bin/python3 &&
bash {project}/scripts/build_mtkahypar.sh &&
bash {project}/scripts/build_sharedmap_mtkahypar.sh
- manylinux: manylinux_2_28
manylinux_tag: manylinux_2_28
before_all: >-
yum install -y hwloc-devel &&
bash {project}/scripts/build_mtkahypar.sh &&
bash {project}/scripts/build_sharedmap_mtkahypar.sh
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: pypa/cibuildwheel@v3.3
env:
CIBW_BUILD: "${{ matrix.python-version }}-manylinux_x86_64"
CIBW_SKIP: "cp31?t-*"
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
CIBW_BEFORE_ALL: ${{ matrix.before_all }}
CIBW_ENVIRONMENT: >-
CXX=g++
CMAKE_ARGS=-DCMAKE_POLICY_VERSION_MINIMUM=3.5
LD_LIBRARY_PATH={project}/external_repositories/HeiCut/extern/mt-kahypar-library:{project}/external_repositories/HeiCut/extern/mt-kahypar-library/tbb_lib/intel64/gcc4.8:{project}/external_repositories/SharedMap/extern/local/mt-kahypar/lib:$LD_LIBRARY_PATH
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >-
cp -r {project}/tests /tmp/_cibw_tests && pytest /tmp/_cibw_tests -v -s --tb=long && rm -rf /tmp/_cibw_tests
CIBW_REPAIR_WHEEL_COMMAND: >-
LD_LIBRARY_PATH={project}/external_repositories/HeiCut/extern/mt-kahypar-library:{project}/external_repositories/HeiCut/extern/mt-kahypar-library/tbb_lib/intel64/gcc4.8:{project}/external_repositories/SharedMap/extern/local/mt-kahypar/lib:$LD_LIBRARY_PATH
auditwheel repair -w {dest_dir} {wheel}
- uses: actions/upload-artifact@v4
with:
name: wheel-linux-${{ matrix.manylinux_tag }}-${{ matrix.python-version }}
path: wheelhouse/*.whl
build-macos-arm64:
name: macOS arm64 ${{ matrix.python-version }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
python-version: ["cp39", "cp310", "cp311", "cp312", "cp313", "cp314"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: pypa/cibuildwheel@v3.3
env:
CIBW_BUILD: "${{ matrix.python-version }}-macosx_arm64"
CIBW_SKIP: "cp31?t-*"
CIBW_BEFORE_ALL: >-
brew install libomp hwloc tbb boost &&
bash {project}/scripts/build_mtkahypar.sh &&
bash {project}/scripts/build_sharedmap_mtkahypar.sh
CIBW_ENVIRONMENT: >-
CC=clang
CXX=clang++
MACOSX_DEPLOYMENT_TARGET=14.0
OpenMP_ROOT=/opt/homebrew/opt/libomp
CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DOpenMP_ROOT=/opt/homebrew/opt/libomp"
KAHYPAR_DOWNLOAD_TBB=OFF
KAHYPAR_DOWNLOAD_BOOST=OFF
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >-
cp -r {project}/tests /tmp/_cibw_tests && pytest /tmp/_cibw_tests -v -s --tb=long && rm -rf /tmp/_cibw_tests
CIBW_REPAIR_WHEEL_COMMAND: >-
DYLD_LIBRARY_PATH={project}/external_repositories/HeiCut/extern/mt-kahypar-library:{project}/external_repositories/SharedMap/extern/local/mt-kahypar/lib:$DYLD_LIBRARY_PATH
delocate-wheel --require-archs arm64 -w {dest_dir} {wheel}
- uses: actions/upload-artifact@v4
with:
name: wheel-macos-arm64-${{ matrix.python-version }}
path: wheelhouse/*.whl
# Windows builds are disabled: the bundled C++ graph algorithm libraries
# (KaHIP, HeiStream, HyperMIS, etc.) rely on POSIX headers (sys/time.h,
# sys/mman.h, execinfo.h) that are not available on MSVC/Windows.
build-sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install build
- run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
create-release:
name: Create GitHub Release
needs: [build-linux, build-macos-arm64, build-sdist]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true