Skip to content

Commit 402ea93

Browse files
authored
Install Intel version of MATLAB on Apple silicon prior to R2023b (#71)
* Install Intel version on Apple silicon prior to R2023b * Add release job parameter * Use array as matrix param * Reference correct job * Give the intel on arm job a unique name * Install rosetta if necessary * Clean up order of operations * Replace >= with ! <
1 parent 39491fe commit 402ea93

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.circleci/test-deploy.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ integration-tests: &integration-tests
1313
orb-tools/pack,
1414
integration-test-install,
1515
integration-test-install-release,
16+
integration-test-install-release-macos-intel-on-arm,
1617
integration-test-run-command,
1718
integration-test-run-tests
1819
]
@@ -60,14 +61,16 @@ jobs:
6061
parameters:
6162
executor:
6263
type: executor
64+
release:
65+
type: string
6366
executor: <<parameters.executor>>
6467
steps:
6568
- checkout
6669
- matlab/install:
67-
release: "R2023bU1"
70+
release: <<parameters.release>>
6871
no-output-timeout: 30m
6972
- matlab/run-command:
70-
command: "assert(strcmp(version('-release'),'2023b') && strcmp(version('-description'),'Update 1'))"
73+
command: "exp='<<parameters.release>>'; assert(strcmp(version('-release'),exp(2:6)))"
7174

7275
integration-test-run-command:
7376
parameters:
@@ -466,6 +469,12 @@ workflows:
466469
matrix:
467470
parameters:
468471
executor: [linux, windows, macos, macos-arm]
472+
release: [R2023bU1]
473+
474+
- integration-test-install-release:
475+
name: integration-test-install-release-macos-intel-on-arm
476+
executor: macos-arm
477+
release: R2023aU1
469478

470479
- integration-test-run-command:
471480
matrix:

src/scripts/install.sh

+11-6
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,16 @@ if [[ $os = Linux ]]; then
5757
wget \
5858
unzip \
5959
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 /"
60+
elif [[ $os = Darwin && $arch = arm64 ]]; then
61+
if [[ $mpmrelease < "r2023b" ]]; then
62+
# install Rosetta 2
63+
sudoIfAvailable -c "softwareupdate --install-rosetta --agree-to-license"
64+
else
65+
# install Java runtime
66+
jdkpkg="$tmpdir/jdk.pkg"
67+
curl -sfL https://corretto.aws/downloads/latest/amazon-corretto-8-aarch64-macos-jdk.pkg -o $jdkpkg
68+
sudoIfAvailable -c "installer -pkg $jdkpkg -target /"
69+
fi
6570
fi
6671

6772
# set os specific options
@@ -72,7 +77,7 @@ if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
7277
mpmdir=$(cygpath "$mpmdir")
7378
batchdir=$(cygpath "$batchdir")
7479
elif [[ $os = Darwin ]]; then
75-
if [[ $arch == arm64 ]]; then
80+
if [[ $arch = arm64 && ! $mpmrelease < "r2023b" ]]; then
7681
mwarch="maca64"
7782
else
7883
mwarch="maci64"

0 commit comments

Comments
 (0)