How do I install the Matlab MCR in Ubuntu 14.04 without "killing" Unity?

1k views Asked by At

Background: I have created an Ubuntu VirtualBox from LAPP stack and added the Ubuntu desktop (Unity: sudo apt-get install ubuntu-desktop). Now I am attempting to install the MCR without loosing Unity.

  • Download MCR zip and extract to MCR_SOURCE
  • Go to my folder that contains the files: cd /media/sf_shared/MCR_ SOURCE
  • Change installer_input.txt file:

    destinationFolder=/opt/MCR
    agreeToLicense=yes
    outputFile=/opt/install.log
    mode=silent
    product.MATLAB
    product.MATLAB_Builder_JA
    # Note: To find out the required toolboxes >> start Matlab >> run your code and find out which toolboxes were used with: license('inuse')
    
  • Install MCR: sudo ./install -inputFile /media/sf_shared/MCR_SOURCE/installer_input.txt >> success
  • Restart Ubuntu >> test whether Ubuntu’s Unity still exists >> everything is fine
  • Attention the next step will “ kill ” your Ubuntu desktop configuration!!! (i.e. copy your hardisk, anything you must do to recover quickly) – now configure: sudo gedit /etc/environment

    LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
    XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"
    # Note: X11/app-defaults folder has not been created during installation
    
  • Restart Ubuntu >> Unity is gone, recovery attempts such as deleting the above lines do not recover Unity; reinstalling the Ubuntu desktop does not help either.

I have tried an alternative route with exporting the variables, which also "kills" Unity. By the way this affects all users.

Any ideas?

1

There are 1 answers

0
Wolfi On

It is not necessary to register these environment variables in /etc/environment, which means that the Unity sidebar will not be affected.

Instead register the environment variables temporarily either as local user or via sudo -i:

export LD_LIBRARY_PATH="/opt/MCR/v84/runtime/glnxa64:/opt/MCR/v84/bin/glnxa64:/opt/MCR/v84/sys/os/glnxa64:${LD_LIBRARY_PATH}"
export XAPPLRESDIR="/opt/MCR/v84/X11/app-defaults"

Now it is possible to run Matlab Apps without "killing" Ubuntu's desktop. For instance to run the Java compiled makesqr.m file.

java -classpath "/opt/MCR/v84/toolbox/javabuilder/jar/javabuilder.jar:/media/sf_shared/for_testing/makesqr.jar" makesqr.Class1 5

The Java package makesqr was created using Matlab's JavaBuilder tutorial. This was done on my Windows 7 machine, which runs Matlab R2014b.

Please ensure that the owner and permissions of the /opt/MCR and /media/sf_shared/for_testing folders are set correctly (see here for details).