Why is MATLAB unable to run the MATLABWindow application on Linux?

Why is MATLAB unable to run the MATLABWindow application on Linux, with the following warning?
>> simulink
Warning: MATLABWindow application failed to launch. Unable to launch the MATLABWindow application

 Accepted Answer

There are a few things that can cause MATLABWindow to not open correctly.

 

1. Missing Libraries
Under normal conditions, supported Linux distributions should have all the libraries needed in the Operating System to run MATLAB and the installer. However, for a variety of reasons, some may be missing on your computer. To ensure that you have the correct libraries installed with your supported Linux distribution, navigate into the folder the MATLAB installation is in, then the "bin" folder, and then the "glnxa64" folder. In this folder, there is an application called MATLABWindow:
>> cd(matlabroot)
>> cd bin/glnxa64
>> !./MATLABWindow -url=mathworks.com
If you launch this program with ./MATLABWindow and you are missing libraries, you will see those missing libraries appear in the error message. MATLAB and its installer ship some libraries needed by MATLABWindow. To use these, set the LD_LIBRARY_PATH environment variable using the following command in the Linux Terminal:
export LD_LIBRARY_PATH=/usr/local/MATLAB/R2023b/cefclient/sys/os/glnxa64
After setting this, run MATLABWindow again. If you still see errors about missing libraries, then use your Linux distribution's package manager to install the missing libraries (such as apt, dnf, yum, or pacman.) If you are unsure what packages include the library you are missing, use your distribution's package search to find a package that contains the library you are missing. For example, you can use Ubuntu's package search site to search for the appropriate package, and then install it with "sudo apt install <package name>". There is not a comprehensive list of every library MATLAB needs in order to function on Linux. Another approach you can take is setting up an environment variable that points to a specific library that MATLAB ships with, instead of the Operating System's. An example would be to run this command in the Linux Terminal to setup an environment variable if the library "libstdc++.so.6" is causing issues:
export LD_PRELOAD="/home/local/MATLAB/R2020b/bin/glnxa64/glibc-2.17_shim.so".
The difference between LD_PRELOAD and LD_LIBRARY_PATH is that the LD_PRELOAD points to a specific library file, while LD_LIBRARY_PATH searches a directory for various library files.
There is no exhaustive list of the libraries that MATLAB depends on from the Operating System nor which ones can be substituted with the ones that MATLAB ships with.

 

2. Permissions
Make sure the user running MATLAB has permissions to access and execute folders and files from MATLAB's installation directory.

 

3. No graphical environment
MATLABWindow is a GUI application and requires a graphical environment such as X11 or Wayland. Display forwarding is required if the computer is being remotely accessed. If you need to do a command-line only installation of MATLAB, either do a silent installation or use MATLAB Package Manager.

 

MATLAB Package Manager

 

Install MATLAB Using Silent Installation

6 Comments

I am not entirely sure about the exact content of this article in the past but I believe that strictly speaking the answer has always explicitly explained that "setting aside" meant moving more than just one file. Nevertheless based on the feedback from Dominik above as well as from some other MATLAB users, I have added a note at the top of the answer to explicitly highlight this.
How does one "set aside" libraries from an installation BD? The disc mounts as read-only (obviously). Please don't tell me I'm supposed to suffer through copying the entire disc content to local storage then run these hack workarounds before I can install R2020b.
Linux is terrible enough as it is, I don't want to band-aid my way through an install onto a "fully supported" operating system - RHEL 8
Per system requirements page: "MATLAB and Simulink have been validated on the Linux distributions listed on this page."
Edit, update: I went ahead and copied the .ISO content to a local directory, and "set aside" libcrypto and libssl per John Bollinger on 22 May 2020. The install window appears incredibly slowly, but when I get to the FIK page (i.e., nearly the very first thing), the "Next" button never enables.
Greg, as I read through it appears to me that this is an issue that shows up after installation and does not affect installation. There would therefore not be any need to set aside in read-only installation media. (There could potentially be difficulty if your admins provides an installed matlab by mounting a shared read-only device.)
Walter, my apologies - I attributed my specific situation to the comments posts from Jasper Vinkenvleugel and John Bollinger. They had the same library conflict I do, so I mistakenly assumed it was also occuring during install. For me, it is indeed happening within the install script provided for Linux distributions.
The update edit paragraph in my previous comment is the current behavior on my RHEL 8.2 system. Amusingly enough, shortly after that post, I tried running the silent install per installer_input.txt. It appears to have work beautifully (but I haven't tried to run any code to see if there are additional downstream issues).

Sign in to comment.

More Answers (1)

I had an error that was not documented on support pages at all, but was very similar to this one. It propped up after I solved issue number 2 in this thread when attempting to launch Simulink.
This solution worked for me on R2019b, but since the issue is consistent it should work with all recent MATLAB releases as well as all Linux distributions. As it turns out, there has been a problem with the Add-on Manager of MATLAB for a while now, causing these issues. Here's the solution in case you don't want to read the details. Also it is uncessary to redirect the symlinks as described on the Wiki, it is enough to exclude them from the matlabroot folder so MATLAB will use system-defaults.
Here's the process, run commands as root when prompted:
cd /usr/local/MATLAB/R2019b/cefclient/sys/so/glnxa64 # default location for this
mkdir exclude
Now enter the commands to remove the symlinks causing the errors.
mv libgio-2.0.so* exclude
mv libglib-2.0.so* exclude
mv libgmodule-2.0.so* exclude
mv libgobject-2.0.so* exclude
mv libgthread-2.0.so* exclude
Your problem should be solved. This shouldn't break anything either, since more up-to-date system defaults exist for these libs. You should also make a README file, so you know what you did and why in case you need to come back a year later or something.
I would also like to state, that I am severely disappointed in MATLAB and Mathworks. Providing a .zip file for installation on systems with very well made package management is dumb and annoying. Shipping an expensive piece of commercial software on an operating system claiming it works, while it needs workarounds is straight up outrageous.

Categories

Products

Release

R2017b

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!