Skip to content

Commit

Permalink
Install Intel version of MATLAB on Apple silicon prior to R2023b (#71)
Browse files Browse the repository at this point in the history
* 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 ! <
  • Loading branch information
mcafaro authored May 8, 2024
1 parent 39491fe commit 402ea93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
13 changes: 11 additions & 2 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ integration-tests: &integration-tests
orb-tools/pack,
integration-test-install,
integration-test-install-release,
integration-test-install-release-macos-intel-on-arm,
integration-test-run-command,
integration-test-run-tests
]
Expand Down Expand Up @@ -60,14 +61,16 @@ jobs:
parameters:
executor:
type: executor
release:
type: string
executor: <<parameters.executor>>
steps:
- checkout
- matlab/install:
release: "R2023bU1"
release: <<parameters.release>>
no-output-timeout: 30m
- matlab/run-command:
command: "assert(strcmp(version('-release'),'2023b') && strcmp(version('-description'),'Update 1'))"
command: "exp='<<parameters.release>>'; assert(strcmp(version('-release'),exp(2:6)))"

integration-test-run-command:
parameters:
Expand Down Expand Up @@ -466,6 +469,12 @@ workflows:
matrix:
parameters:
executor: [linux, windows, macos, macos-arm]
release: [R2023bU1]

- integration-test-install-release:
name: integration-test-install-release-macos-intel-on-arm
executor: macos-arm
release: R2023aU1

- integration-test-run-command:
matrix:
Expand Down
17 changes: 11 additions & 6 deletions src/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ if [[ $os = Linux ]]; then
wget \
unzip \
ca-certificates"
elif [[ $os = Darwin && $arch == arm64 ]]; then
# install Java runtime
jdkpkg="$tmpdir/jdk.pkg"
curl -sfL https://corretto.aws/downloads/latest/amazon-corretto-8-aarch64-macos-jdk.pkg -o $jdkpkg
sudoIfAvailable -c "installer -pkg $jdkpkg -target /"
elif [[ $os = Darwin && $arch = arm64 ]]; then
if [[ $mpmrelease < "r2023b" ]]; then
# install Rosetta 2
sudoIfAvailable -c "softwareupdate --install-rosetta --agree-to-license"
else
# install Java runtime
jdkpkg="$tmpdir/jdk.pkg"
curl -sfL https://corretto.aws/downloads/latest/amazon-corretto-8-aarch64-macos-jdk.pkg -o $jdkpkg
sudoIfAvailable -c "installer -pkg $jdkpkg -target /"
fi
fi

# set os specific options
Expand All @@ -72,7 +77,7 @@ if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
mpmdir=$(cygpath "$mpmdir")
batchdir=$(cygpath "$batchdir")
elif [[ $os = Darwin ]]; then
if [[ $arch == arm64 ]]; then
if [[ $arch = arm64 && ! $mpmrelease < "r2023b" ]]; then
mwarch="maca64"
else
mwarch="maci64"
Expand Down

0 comments on commit 402ea93

Please sign in to comment.