ligo-ex ligo-ds
  Richardson Lab Data Science Log  Not logged in ELOG logo
Message ID: 8     Entry time: Tue Feb 27 18:00:01 2024
Author: Pooyan 
Type: HowTo 
Category: Scripts/Programs 
Subject: Install Matlab add-ons 
SIS requires two Matlab toolboxes (Parallel computing and Symbolic math), but a simple add-on installation by user fails due to not having write permission on " /usr/local/MATLAB/".
Theoretically, one can install the toolbox only on their own home directory; but changing the installation directory in settings didn't solve the problem. (Matlab still asking for write permission)
I tried giving user the appropriate access using the "setfacl". although all permissions are granted to the user, Matlab still complains about not having write permission.
Using a root access user works on a local machine, but fails in this situation due to X11 not being forwarded when run by super user. The add-ons can only be installed using the GUI, there is no easy CLI command for that.

Fix:
Used the fix on this blog [https://danct12.github.io/Fix-X11-Forwarding-sudo/] to add the current user's SSH session authentication to the root's .Xauth file.

$ echo $DISPLAY
$ xauth list $DISPLAY
$ sudo xauth add chimay/unix:12 MIT-MAGIC-COOKIE-1 c9acf72143c05334f58f**********220

after this, the user can run matlab as super user, "sudo matlab", and use the GUI. This should be done by a user that has sudo access.
This process seems to install the toolboxes for all users, so there shouldn't be any need of doing this by others.

ELOG V3.1.3-7933898