... assuming that licensing is sorted out

This assumes that your usage of MATLAB is permitted by your University's MATLAB license, and that you are going to use it on a NeCTAR virtual in the appropriate availability zone.  Read this page for more details.

THIS IS A WORK IN PROGRESS ...

Building a MATLAB volume for use on QRIScloud

This is the procedure I used for installing MATLAB. You will need a NeCTAR project with a volume storage quota of 20Gb, because a typical Linux OS + MATLAB installation will not fit into a default NeCTAR instance's ephemeral disc.  So we need to create the system image as a persistent volume which can then be shared with UQ staff.

(The other approach would be to use a regular instance, and put the MATLAB installation on the 2nd ephemeral disc.  But the problem with that is the 2nd ephemeral disc cannot be snapshotted or cloned ... )

  1. Examine the official MATLAB support matrix for 64bit Linux.  This should advise you on what version of Linux you need to use for each version of MATLAB ... and vice versa.
  2. Contact the UQ ITS help desk, and request a MATLAB File Installation Key (FIK):
    • They will want to know where you want to use Matlab. 
    • Tell them that you want to use it on a QRIScloud virtual machine.
    • If you need a specific version of MATLAB, include this in the email.  (FIKs are apparently version specific.)
  3. ITS should send you an FIK and a license file, and possibly other instructions / information.  Save the key and the file, and read the other information carefully.  (What they say should be definitive ... )
  4. Obtain a copy of the MATLAB installer:
    • Login to the website run by the UQ Software Licensing group.  This requires a valid UQ Staff or RHD username and password.
    • Select MATLAB in the initial screen, and proceed though the screens on what is available, and licensing.  (Read the latter before you click to agree!!)
    • When you get to the download menu, select and download the 64bit Linux installer for the MATLAB release you need to use; i.e. the one you got the FIK for:
      • The image is typically ~6Gb, which might cause problems with old web browsers that don't support HTML 5.  (If you are still using such a browser, you may need to install a "download manager"; see the README file.)
      • The downloads are (currently) ISO formatted DVD images.  I'll explain how to deal with that below ...
      • Save the downloaded image to your desktop / laptop for now.
    • There is also a README file ("IMPORTANT INFORMATION ABOUT ...").  The README I saw (version 1.1 dated 2011) was largely incorrect, though it does give the tip that you might need to install a "download manager" ... if you are using an old web browser.
  5. Create a fresh NeCTAR instance in the Qld availability zone:
    • It is recommended that you pick a 64-bit Linux image that is "supported" for your MATLAB installer ... according to the MATLAB support matrix.
    • If you need instructions on how to create a NeCTAR instance, I recommend you read Kim Olsson's "Beginners Guide to QRIScloud".
  6. SSH to the instance (allowing extra time for it to complete its first-time intialization work ...) and do any initial setup that you need to.
  7. You will need to enable X11 to run MATLAB interactively, so read these instructions on how to do that.
  8. Install Matlab's "supported compilers" on the virtual instance:
    • A Java 7 JDK.  Mathworks recommend Oracle Java, but I recommend installing OpenJDK 7 from your distro's package manager.  That way you will pick up Java security updates whenever you install OS updates.  (Note also that a separate Java installation may be necessary to get the MATLAB installer to work on a NeCTAR instance.)
    • The gcc/g++ compilers (4.7.x).
    • The gfortran compiler (4.7.x).
  9. Install the Linux "windowing" libraries needed to run MATLAB in GUI mode.  The easy way is to just install Gnome (or equivalent); e.g.
    • On Ubuntu, run "sudo apt-get install gnome-core".
    Note that this is needed to run the MATLAB install script ... unless you run it in non-GUI mode.
  10. Check filespace requirements for the installation:
    • You will need ~6Gb to hold the files that MATLAB installs, and a further ~6.5Gb to hold the installer ISO.
    • Run "df -kh" to see how much disk space is available ... and where.
    • On a typical (small) NeCTAR virtual, it is probably best to put BOTH the installer ISO and the MATLAB installation on the 30Gb ephemeral disc.
    • The following assumes that there is enough space to put the installer ISO into /tmp, and the installation into /usr/local (the default installation directory is "/usr/local/MATLAB/R....")
  11. From your desktop / laptop, "push" the ISO file to the virtual.  Modify the following to use the appropriate path to the ISO file, ISO filename, and IP address for your virtual:

    scp /home/xxxx/Downloads/R2013b_UNIX.iso ubuntu@nnn.nnn.nnn.nnn:/tmp
  12. In order to access the ISO, you need to mount it as a local file system.  (In other situations, you may have the option of writing it onto a DVD or a memory stick ... but AFAIK that won't work with the NeCTAR cloud.)

    sudo mkdir /media/iso
    sudo mount -o loop /tmp/R2013b_UNIX.iso /media/iso
  13. Copy the MATLAB license file to "/etc/matlab/license.lic" and make it read-only.
  14. Launch the MATLAB installer by running:

    sudo /media/iso/install
  15. In the installer dialogs:
    • Select "Install without using the Internet".
    • Read and accept the license.
    • Select "I have the File Installation Key for my license", and copy-paste the key provided to you into the text box.
    • Change the MATLAB installation location if necessary
    • Enter the pathname to the license file; i.e. "/etc/matlab/license.lic".
    • Finally ... click the Install button.
  16. The installer should now run to completion.
  17. Once you are satisfied that the install has worked, you can unmount the installer ISO and delete it; e.g.

    sudo umount /media/iso
    rm /mnt/R2013b_UNIX.iso