26
26
27
27
jobs :
28
28
MacOS :
29
- runs-on : macos-12
29
+ runs-on : ${{ matrix.os }}
30
30
strategy :
31
31
fail-fast : false
32
32
matrix :
33
+ # macos-12 is Intel runner, macos-14 is Apple Silicon
34
+ # https://github.com/actions/runner-images
35
+ os : [macos-12, macos-14]
33
36
CONFIG : [ON, OFF]
34
37
env :
35
38
BUILD_SHARED_LIBS : ${{ matrix.CONFIG }}
@@ -47,26 +50,49 @@ jobs:
47
50
path : ~/.ccache
48
51
# We include the commit sha in the cache key, as new cache entries are
49
52
# only created if there is no existing entry for the key yet.
50
- key : ${{ runner.os }}-ccache-${{ github.sha }}
53
+ key : ${{ runner.os }}-${{ runner.arch }}- ccache-${{ github.sha }}
51
54
# Restore any ccache cache entry, if none for
52
- # ${{ runner.os }}-ccache-${{ github.sha }} exists.
55
+ # ${{ runner.os }}-${{ runner.arch }}- ccache-${{ github.sha }} exists.
53
56
# Common prefix will be used so that ccache can be used across commits.
54
57
restore-keys : |
55
- ${{ runner.os }}-ccache
58
+ ${{ runner.os }}-${{ runner.arch }}-ccache
59
+
56
60
- name : Set up Python version
57
61
uses : actions/setup-python@v5
58
62
with :
59
- python-version : 3.8
63
+ python-version : ' 3.11'
64
+
60
65
- name : Install dependencies
61
66
run : |
62
67
brew install ccache pkg-config
63
- # Install libomp 11.1.0 from old brew bottle for catalina (10.15).
64
- # Directly installing the Ruby formula will install for the current OS
68
+
69
+ if [[ ${{ runner.arch}} == "ARM64" ]]; then
70
+ # Fix gfortran not found issue
71
+ ln -s $(which gfortran-13) /usr/local/bin/gfortran
72
+
73
+ # Default macos-14 image Xcode (version 15.0.1) linker causes build issues.
74
+ # Newer Xcode versions work, but embree recommends Apple clang <= 14 on
75
+ # arm64 to avoid possible "EXEC_BAD_INSTRUCTION" runtime exceptions:
76
+ # https://github.com/embree/embree/releases/tag/v4.3.1
77
+ sudo xcode-select -switch /Applications/Xcode_14.3.1.app
78
+ fi
79
+
80
+ # Install libomp 11.1.0 from old brew bottle for x64 catalina (10.15)
81
+ # / arm64 big sur (11.0). Directly installing the Ruby formula will
82
+ # install for the current OS.
65
83
# https://github.com/microsoft/LightGBM/issues/4229
66
- brew unlink libomp
67
- curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.catalina.bottle.tar.gz \
68
- https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
69
- brew install -f libomp-11.1.0.catalina.bottle.tar.gz
84
+ if [[ ${{ runner.arch}} == "X64" ]]; then
85
+ brew unlink libomp
86
+ # x64 catalina (10.15) bottle
87
+ export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
88
+ else # ARM64
89
+ # arm64 big_sur (11.0) bottle
90
+ export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
91
+ fi
92
+ curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.bottle.tar.gz \
93
+ https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:$LIBOMP_BOTTLE_HASH
94
+ brew install -f libomp-11.1.0.bottle.tar.gz
95
+
70
96
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
71
97
- name : Config and build
72
98
run : |
82
108
pushd build
83
109
make -j${NPROC} Open3DViewer
84
110
pushd bin
85
- zip -rv open3d-app-macosx-10_15.zip Open3D.app
111
+ zip -rv open3d-app-macosx-10_15-${{ runner.arch}} .zip Open3D.app
86
112
ccache -s
87
113
88
114
- name : Upload package
@@ -116,21 +142,58 @@ jobs:
116
142
uses : actions/upload-artifact@v4
117
143
if : ${{ env.BUILD_SHARED_LIBS == 'OFF' }}
118
144
with :
119
- name : open3d-app-macosx-10_15
120
- path : build/bin/open3d-app-macosx-10_15.zip
145
+ name : open3d-app-macosx-10_15-${{ runner.arch}}
146
+ path : build/bin/open3d-app-macosx-10_15-${{ runner.arch}}.zip
147
+ if-no-files-found : error
148
+
149
+ fuse-viewer :
150
+ name : Fuse x64 and ARM64 viewer app
151
+ runs-on : [macos-12]
152
+ needs : [MacOS]
153
+ steps :
154
+ - name : Download viewer apps
155
+ uses : actions/download-artifact@v4
156
+ with :
157
+ pattern : open3d-app-macosx-10_15-*
158
+ merge-multiple : true
159
+
160
+ - name : Fuse x64 and arm64 viewer apps
161
+ run : |
162
+ unzip open3d-app-macosx-10_15-X64.zip -d x64
163
+ unzip open3d-app-macosx-10_15-ARM64.zip -d arm64
164
+ for i in arm64/Open3D.app/Contents/MacOS/*; do
165
+ filepath=Open3D.app/Contents/MacOS/$(basename $i)
166
+ lipo -create arm64/${filepath} x64/${filepath} -output arm64/${filepath}
167
+ done
168
+ mv arm64/Open3D.app Open3D.app
169
+ zip -rv open3d-app-macosx-10_15-universal2.zip Open3D.app
170
+
171
+ - name : Upload Open3D viewer app
172
+ uses : actions/upload-artifact@v4
173
+ with :
174
+ name : open3d-app-macosx-10_15-universal2
175
+ path : open3d-app-macosx-10_15-universal2.zip
121
176
if-no-files-found : error
122
177
123
178
build-wheel :
124
179
name : Build wheel
125
- runs-on : macos-12
180
+ runs-on : ${{ matrix.os }}
126
181
strategy :
127
182
fail-fast : false
128
183
# https://github.yungao-tech.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6
129
184
matrix :
185
+ # macos-12 is Intel runner, macos-14 is Apple Silicon
186
+ # https://github.com/actions/runner-images
187
+ os : [macos-12, macos-14]
130
188
python_version : ['3.8', '3.9', '3.10', '3.11']
131
189
is_main :
132
190
- ${{ github.ref == 'refs/heads/main' }}
133
191
exclude :
192
+ # TODO: remove macos-14 excludes when https://github.com/actions/setup-python/issues/808 is fixed
193
+ - os : macos-14
194
+ python_version : ' 3.8'
195
+ - os : macos-14
196
+ python_version : ' 3.9'
134
197
- is_main : false
135
198
python_version : ' 3.8'
136
199
- is_main : false
@@ -158,12 +221,12 @@ jobs:
158
221
path : ~/.ccache
159
222
# We include the commit sha in the cache key, as new cache entries are
160
223
# only created if there is no existing entry for the key yet.
161
- key : ${{ runner.os }}-ccache-${{ github.sha }}
224
+ key : ${{ runner.os }}-${{ runner.arch }}- ccache-${{ github.sha }}
162
225
# Restore any ccache cache entry, if none for
163
- # ${{ runner.os }}-ccache-${{ github.sha }} exists.
226
+ # ${{ runner.os }}-${{ runner.arch }}- ccache-${{ github.sha }} exists.
164
227
# Common prefix will be used so that ccache can be used across commits.
165
228
restore-keys : |
166
- ${{ runner.os }}-ccache
229
+ ${{ runner.os }}-${{ runner.arch }}- ccache
167
230
168
231
- name : Set up Python
169
232
uses : actions/setup-python@v5
@@ -180,12 +243,26 @@ jobs:
180
243
cmake --version
181
244
source util/ci_utils.sh
182
245
install_python_dependencies
246
+
247
+ # Fix macos-14 arm64 runner image issues, see comments in MacOS job.
248
+ if [[ ${{ runner.arch}} == "ARM64" ]]; then
249
+ ln -s $(which gfortran-13) /usr/local/bin/gfortran
250
+ sudo xcode-select -switch /Applications/Xcode_14.3.1.app
251
+ fi
252
+
183
253
# Install libomp 11.1.0. See comment above.
254
+ if [[ ${{ runner.arch}} == "X64" ]]; then
255
+ brew unlink libomp
256
+ # x64 catalina (10.15) bottle
257
+ export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
258
+ else # ARM64
259
+ # arm64 big_sur (11.0) bottle
260
+ export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
261
+ fi
262
+ curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.bottle.tar.gz \
263
+ https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:$LIBOMP_BOTTLE_HASH
264
+ brew install -f libomp-11.1.0.bottle.tar.gz
184
265
brew install ccache
185
- brew unlink libomp
186
- curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.catalina.bottle.tar.gz \
187
- https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
188
- brew install -f libomp-11.1.0.catalina.bottle.tar.gz
189
266
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
190
267
191
268
- name : Config and build wheel
@@ -227,17 +304,97 @@ jobs:
227
304
gsutil cp build/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }} gs://open3d-releases/python-wheels/
228
305
echo "Download pip package at: https://storage.googleapis.com/open3d-releases/python-wheels/${{ env.PIP_PKG_NAME }}"
229
306
307
+ fuse-wheel :
308
+ name : Fuse universal2 wheel
309
+ runs-on : [macos-12]
310
+ needs : [build-wheel]
311
+ strategy :
312
+ fail-fast : false
313
+ # https://github.yungao-tech.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6
314
+ matrix :
315
+ python_version : ['3.10', '3.11']
316
+ is_main :
317
+ - ${{ github.ref == 'refs/heads/main' }}
318
+ exclude :
319
+ - is_main : false
320
+ python_version : ' 3.10'
321
+ steps :
322
+ - name : Set up Python
323
+ uses : actions/setup-python@v5
324
+ with :
325
+ python-version : ${{ matrix.python_version }}
326
+ - name : Download X64 wheels
327
+ uses : actions/download-artifact@v4
328
+ with :
329
+ pattern : open3d-*macosx*_x86_64.whl
330
+ path : x64_wheels
331
+ merge-multiple : true
332
+ - name : Download ARM64 wheels
333
+ uses : actions/download-artifact@v4
334
+ with :
335
+ pattern : open3d-*macosx*_arm64.whl
336
+ path : arm64_wheels
337
+ merge-multiple : true
338
+ - name : Fuse x64 and ARM64 wheels
339
+ env :
340
+ python_version : ${{ matrix.python_version }}
341
+ run : |
342
+ PYTAG="-cp$(echo ${{ env.python_version }} | tr -d '.')"
343
+ mkdir universal_wheels
344
+
345
+ pip install delocate
346
+ delocate-fuse -v x64_wheels/open3d-*${PYTAG}*.whl arm64_wheels/open3d-*${PYTAG}*.whl
347
+
348
+ # Normalize file name as delocate-fuse doesn't update it
349
+ OLD_WHL_NAME=$(basename x64_wheels/open3d-*${PYTAG}*.whl)
350
+ NEW_WHL_NAME=${OLD_WHL_NAME/x86_64/universal2}
351
+ mv x64_wheels/${OLD_WHL_NAME} universal_wheels/${NEW_WHL_NAME}
352
+
353
+ echo "PIP_PKG_NAME=$NEW_WHL_NAME" >> $GITHUB_ENV
354
+ - name : Upload merged wheels
355
+ uses : actions/upload-artifact@v4
356
+ with :
357
+ name : ${{ env.PIP_PKG_NAME }}
358
+ path : universal_wheels/${{ env.PIP_PKG_NAME }}
359
+ if-no-files-found : error
360
+
361
+ - name : GCloud CLI auth
362
+ if : ${{ github.ref == 'refs/heads/main' }}
363
+ uses : ' google-github-actions/auth@v2'
364
+ with :
365
+ project_id : ${{ secrets.GCE_PROJECT }}
366
+ credentials_json : ' ${{ secrets.GCE_SA_KEY_GPU_CI }}'
367
+ - name : GCloud CLI setup
368
+ if : ${{ github.ref == 'refs/heads/main' }}
369
+ uses : google-github-actions/setup-gcloud@v2
370
+ with :
371
+ version : ${{ env.GCE_CLI_GHA_VERSION }}
372
+ project_id : ${{ secrets.GCE_PROJECT }}
373
+
374
+ - name : Upload wheel to GCS bucket
375
+ if : ${{ github.ref == 'refs/heads/main' }}
376
+ env :
377
+ python_version : ${{ matrix.python_version }}
378
+ run : |
379
+ gsutil cp universal_wheels/${{ env.PIP_PKG_NAME }} gs://open3d-releases/python-wheels/
380
+ echo "Download pip package at: https://storage.googleapis.com/open3d-releases/python-wheels/${{ env.PIP_PKG_NAME }}"
381
+
230
382
test-wheel :
231
383
name : Test wheel
232
- runs-on : macos-12
384
+ runs-on : ${{ matrix.os }}
233
385
needs : [build-wheel]
234
386
strategy :
235
387
fail-fast : false
236
388
matrix :
389
+ os : [macos-12, macos-14]
237
390
python_version : ['3.8', '3.9', '3.10', '3.11']
238
391
is_main :
239
392
- ${{ github.ref == 'refs/heads/main' }}
240
393
exclude :
394
+ - os : macos-14
395
+ python_version : ' 3.8'
396
+ - os : macos-14
397
+ python_version : ' 3.9'
241
398
- is_main : false
242
399
python_version : ' 3.8'
243
400
- is_main : false
@@ -273,7 +430,7 @@ jobs:
273
430
python -V
274
431
source util/ci_utils.sh
275
432
pi_tag=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')")
276
- test_wheel open3d*-"$pi_tag"-*.whl
433
+ test_wheel open3d*-"$pi_tag"-*_$(uname -m) .whl
277
434
278
435
- name : Run Python unit tests (benchmarks)
279
436
run : |
@@ -286,7 +443,7 @@ jobs:
286
443
# no need to run on macOS
287
444
runs-on : ubuntu-latest
288
445
if : ${{ github.ref == 'refs/heads/main' }}
289
- needs : [build -wheel, MacOS]
446
+ needs : [fuse -wheel, MacOS]
290
447
steps :
291
448
- name : GCloud CLI auth
292
449
uses : ' google-github-actions/auth@v2'
0 commit comments