Skip to content

Commit 838d77d

Browse files
authored
Add Apple Silicon support (#68)
* Add Apple Silicon support * Add macos-arm to test matrix * Use R2023bU1 for install release test * Use latest Xcode version * Keep Intel on Xcode 15.1 * Install Java runtime on Apple Silicon * Use variable to store arch * Update ubuntu image to non-deprecated version * Download JDK to temp dir instead of pwd
1 parent 1b7c944 commit 838d77d

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

.circleci/test-deploy.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ integration-tests: &integration-tests
2020
executors:
2121
linux: &linux-executor
2222
machine:
23-
image: ubuntu-2204:2022.07.1
23+
image: ubuntu-2204:2024.01.1
2424
macos:
2525
macos:
2626
xcode: 15.1.0
2727
resource_class: macos.x86.medium.gen2
28+
macos-arm:
29+
macos:
30+
xcode: 15.3.0
31+
resource_class: macos.m1.medium.gen1
2832
windows:
2933
win/default
3034

@@ -60,10 +64,10 @@ jobs:
6064
steps:
6165
- checkout
6266
- matlab/install:
63-
release: "R2021bU3"
67+
release: "R2023bU1"
6468
no-output-timeout: 30m
6569
- matlab/run-command:
66-
command: "assert(strcmp(version('-release'),'2021b'))"
70+
command: "assert(strcmp(version('-release'),'2023b') && strcmp(version('-description'),'Update 1'))"
6771

6872
integration-test-run-command:
6973
parameters:
@@ -456,27 +460,27 @@ workflows:
456460
- integration-test-install:
457461
matrix:
458462
parameters:
459-
executor: [linux, windows, macos]
463+
executor: [linux, windows, macos, macos-arm]
460464

461465
- integration-test-install-release:
462466
matrix:
463467
parameters:
464-
executor: [linux, windows, macos]
468+
executor: [linux, windows, macos, macos-arm]
465469

466470
- integration-test-run-command:
467471
matrix:
468472
parameters:
469-
executor: [linux, windows, macos]
473+
executor: [linux, windows, macos, macos-arm]
470474

471475
- integration-test-run-tests:
472476
matrix:
473477
parameters:
474-
executor: [linux, windows, macos]
478+
executor: [linux, windows, macos, macos-arm]
475479

476480
- integration-test-run-build:
477481
matrix:
478482
parameters:
479-
executor: [linux, windows, macos]
483+
executor: [linux, windows, macos, macos-arm]
480484

481485
- orb-tools/pack:
482486
filters: *filters

src/scripts/install.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ set -o pipefail
1111

1212
sudoIfAvailable() {
1313
if [[ -x $(command -v sudo) ]]; then
14-
sudo -E bash "$@"
14+
sudo -E bash "$@"
1515
else
16-
bash "$@"
16+
bash "$@"
1717
fi
1818
}
1919

@@ -24,6 +24,7 @@ downloadAndRun() {
2424
}
2525

2626
os=$(uname)
27+
arch=$(uname -m)
2728
binext=""
2829
tmpdir=$(dirname "$(mktemp -u)")
2930
rootdir="$tmpdir/matlab_root"
@@ -56,6 +57,11 @@ if [[ $os = Linux ]]; then
5657
wget \
5758
unzip \
5859
ca-certificates"
60+
elif [[ $os = Darwin && $arch == arm64 ]]; then
61+
# install Java runtime
62+
jdkpkg="$tmpdir/jdk.pkg"
63+
curl -sfL https://corretto.aws/downloads/latest/amazon-corretto-8-aarch64-macos-jdk.pkg -o $jdkpkg
64+
sudoIfAvailable -c "installer -pkg $jdkpkg -target /"
5965
fi
6066

6167
# set os specific options
@@ -66,7 +72,11 @@ if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
6672
mpmdir=$(cygpath "$mpmdir")
6773
batchdir=$(cygpath "$batchdir")
6874
elif [[ $os = Darwin ]]; then
69-
mwarch="maci64"
75+
if [[ $arch == arm64 ]]; then
76+
mwarch="maca64"
77+
else
78+
mwarch="maci64"
79+
fi
7080
rootdir="$rootdir/MATLAB.app"
7181
sudoIfAvailable -c "launchctl limit maxfiles 65536 200000" # g3185941
7282
else

0 commit comments

Comments
 (0)