Matlab (opens new window) is a computing environment developed by MatWorks for efficient matrix manipulations and other handy computing tools.
- An unmanaged iaas or blue machine where you have root access.
- Installation of X2Go server on this machine.
- Access to Matlab software binaries for Linux from your organizaton.
- Access to a Matlab license for the users in your lab.
Download the Matlab software on your local computer (client).
For NTNU users, log into NTNU's software repository for Matlab (opens new window), choose your desired version in the top right corner and download on your local computer. We recommend that you skip the latest version (alpha) and choose one of the stable versions (e.g. 2019b) to ensure a reliable installation.
Transfer Matlab to your preferred folder in your lab machine (for example
Unpack the zip file in your folder.
sudo apt install unzip libnss3
Unzip Matlab installer:
Make all files in folder executables:
chmod -R 777 <matlab-folder>(e.g. /mnt/scratch/matlab/). This is a simple fix for you to be able to run the files within subfolders as required by Matlab.
# Activate license
For NTNU users, the exact content of this files is described in NTNU's repository for Matlab (opens new window).
- Create a file named
license.datwith your license information. The content of this file is dependent on your organizations license. The example below will need you to replace
<key2>with an url-address and strings provided by your host institutions license page.:
SERVER <license-server-address> <key1> <key2> USE_SERVER
Make sure you add a new/empty line after "USE_SERVER".
The below steps require the code to be run in
xterm started from X2GO on the machine holding the Matlab files downloaded in the above steps.
Prepare target directory:
mkdir -p /mnt/work/software/matlab_r2019b mkdir -p /mnt/scratch/tmp
Go to your Matlab installation folder (e.g. /mnt/scratch/software/matlab_r2019b) and run the installer:
bash ./install -downloadFolder /mnt/scratch/software/matlab_r2019b -tmpdir /mnt/scratch/tmp -destinationFolder /mnt/work/software/matlab_r2019b
During the installation choose:
Use a File Installation Key
I have the File Installation Key for my licenseand enter the key (these are found on you software repository)
Follow the installer and choose the packages you want.
When the installer asks for your product activation, choose the
non internetoption and provide the location of the
license.datfile previously generated.
If successful, your should see
product activation message.
- If you're fine with command lines, run
Matlabdirectly in your shell.
- If you prefer Matlab's graphical interface, run
Matlabin your terminal (
xterm) started in X2GO.or with full path e.g.:
/usr/bin/xterm -e matlab
/usr/bin/xterm -e /mnt/work/software/matlab2019b/bin/matlab
With a little bit of luck, it's now time to celebrate with fresh coffee running your favourite test code on the fresh Matlab. If not, here's some of our known issues:
# Why can't Matlab find the packages I choose to install?
One known issue is that sometimes the latest Matlab version compiled by some universities do miss some packages. Try to install a slightly older version. Contact us for assistance if this do not work.
# Can I install the code without sudo?
No, not in an easy way. Thus, either we have to install on
home machines, or your can install these yourself on unmanaged iaas and blue machines where you get root. Contact us if you need Matlab on your home machine.
# My product activation do not seem to work?
We need to open for traffic from your lab to your organization's license server. Contact us for network openings.
# Why is live editor not working?
If Matlab complains that Live editor is unable to run in the current system configuration it is important to check if libnss3 is installed.
dpkg -s libnss3 # If not installed run sudo apt install libnss3
# Why is my Matlab installation stuck?
If the installation was progressing and then stuck at some point it is important to check
df -h. In some cases
/tmp directory may get filled up. We usually recommend
setting alternative tmp before running install:
mkdir -p /mnt/scratch/tmp export TMP=/mnt/scratch/tmp export TEMP_DIR=/mnt/scratch/tmp