Skip to content

Commit

Permalink
Merge pull request #4 from hic-infra/matlab_runtime
Browse files Browse the repository at this point in the history
MATLAB Runtime
  • Loading branch information
AaronJackson authored Mar 2, 2023
2 parents 2c10e17 + e56fba4 commit 765e0e9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/matlab_runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash


# Installs a MATLAB runtime when the environment variable
# MATLAB_RUNTIME is set to a runtime download URL (as a zip file).
#
# e.g. for MATLAB 2020a
# MATLAB_RUNTIME=https://ssd.mathworks.com/supportfiles/downloads/R2020b/Release/8/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2020b_Update_8_glnxa64.zip
#
# These links can be found here:
# https://uk.mathworks.com/products/compiler/matlab-runtime.html

set -eu

name=$(echo "${MATLAB_RUNTIME}" | awk -F'/' '{ print $NF }')
echo "Installing MATLAB runtime: ${name}"

curl "${MATLAB_RUNTIME}" --output "/tmp/${name}"

mkdir -p "/tmp/matlab_runtime"
unzip "/tmp/${name}" -d "/tmp/matlab_runtime"
rm "/tmp/${name}"

pushd "/tmp/matlab_runtime"
sudo ./install \
-agreeToLicense yes \
-mode silent
popd

rm -rf "/tmp/matlab_runtime"

0 comments on commit 765e0e9

Please sign in to comment.