Skip to content

Commit 2aaa5d7

Browse files
build: macos x86_64 wheels using macos-13 runner (#332)
* build: try to get universal builds working * try setting environment variables through GITHUB_ENV * expand vars, don't use += * try separate x86_64 build for macos * try macos-13 runner * use same cibw for everything * add macos-13 to build matrix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1ddd884 commit 2aaa5d7

File tree

3 files changed

+16
-36
lines changed

3 files changed

+16
-36
lines changed

.github/workflows/ci.yml

+7-17
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
strategy:
8484
fail-fast: false
8585
matrix:
86-
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
86+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
8787
python: [313]
8888
arch: [auto64]
8989

@@ -96,6 +96,12 @@ jobs:
9696
if: runner.os == 'macOS'
9797
run: |
9898
brew install make automake swig mpfr boost libtool
99+
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
100+
echo "CPPFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CPPFLAGS" >> "$GITHUB_ENV"
101+
echo "CXXFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CXXFLAGS" >> "$GITHUB_ENV"
102+
echo "CFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CFLAGS" >> "$GITHUB_ENV"
103+
echo "LDFLAGS=-L/opt/homebrew/lib $LDFLAGS" >> "$GITHUB_ENV"
104+
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
99105
100106
- name: Clone gmp
101107
if: runner.os == 'macOS'
@@ -106,8 +112,6 @@ jobs:
106112

107113
- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET
108114
if: runner.os == 'macOS'
109-
env:
110-
MACOSX_DEPLOYMENT_TARGET: 11.0
111115
working-directory: gmp-6.3
112116
run: |
113117
brew install texinfo
@@ -121,20 +125,6 @@ jobs:
121125
make install
122126
123127
- uses: pypa/[email protected]
124-
if: runner.os == 'macOS'
125-
name: "pypa/[email protected] (macos)"
126-
env:
127-
CIBW_ARCHS: ${{ matrix.arch }}
128-
CIBW_BUILD: cp${{ matrix.python }}-*
129-
CIBW_BUILD_VERBOSITY: 2
130-
MACOSX_DEPLOYMENT_TARGET: 11.0
131-
CPPFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
132-
CXXFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
133-
CFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
134-
LDFLAGS: -L/opt/homebrew/lib
135-
136-
- uses: pypa/[email protected]
137-
if: runner.os != 'macOS'
138128
env:
139129
CIBW_ARCHS: ${{ matrix.arch }}
140130
CIBW_BUILD: cp${{ matrix.python }}-*

.github/workflows/wheels.yml

+7-17
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
python: [39, 310, 311, 312, 313]
36-
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
36+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13]
3737
arch: [auto64]
3838

3939
steps:
@@ -45,6 +45,12 @@ jobs:
4545
if: runner.os == 'macOS'
4646
run: |
4747
brew install make automake swig mpfr boost libtool
48+
echo "PATH=/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" >> "$GITHUB_ENV"
49+
echo "CPPFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CPPFLAGS" >> "$GITHUB_ENV"
50+
echo "CXXFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CXXFLAGS" >> "$GITHUB_ENV"
51+
echo "CFLAGS=-I/opt/homebrew/include -L/opt/homebrew/lib $CFLAGS" >> "$GITHUB_ENV"
52+
echo "LDFLAGS=-L/opt/homebrew/lib $LDFLAGS" >> "$GITHUB_ENV"
53+
echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
4854
4955
- name: Clone gmp
5056
if: runner.os == 'macOS'
@@ -55,8 +61,6 @@ jobs:
5561

5662
- name: Build gmp from source for MACOSX_DEPLOYMENT_TARGET
5763
if: runner.os == 'macOS'
58-
env:
59-
MACOSX_DEPLOYMENT_TARGET: 11.0
6064
working-directory: gmp-6.3
6165
run: |
6266
export PATH="/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
@@ -71,20 +75,6 @@ jobs:
7175
make install
7276
7377
- uses: pypa/[email protected]
74-
if: runner.os == 'macOS'
75-
name: "pypa/[email protected] (macos)"
76-
env:
77-
CIBW_ARCHS: ${{ matrix.arch }}
78-
CIBW_BUILD: cp${{ matrix.python }}-*
79-
CIBW_BUILD_VERBOSITY: 2
80-
MACOSX_DEPLOYMENT_TARGET: 11.0
81-
CPPFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
82-
CXXFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
83-
CFLAGS: -I/opt/homebrew/include -L/opt/homebrew/lib
84-
LDFLAGS: -L/opt/homebrew/lib
85-
86-
- uses: pypa/[email protected]
87-
if: runner.os != 'macOS'
8878
env:
8979
CIBW_ARCHS: ${{ matrix.arch }}
9080
CIBW_BUILD: cp${{ matrix.python }}-*

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def build_extensions(self):
123123
"./configure",
124124
f"--fastjet-config={FASTJET}/fastjet-config",
125125
f'CXX={env["CXX"]}',
126-
"CXXFLAGS="
127-
+ env.get("CXXFLAGS", "-O3 -Bstatic -Bdynamic -std=c++17"),
126+
"CXXFLAGS=-O3 -Bstatic -Bdynamic -std=c++17 "
127+
+ env.get("CXXFLAGS", ""),
128128
f'LDFLAGS={env["LDFLAGS"]}',
129129
],
130130
cwd=FASTJET_CONTRIB,

0 commit comments

Comments
 (0)