MATLAB: Is MATLAB unable to run the MATLABWindow application on Linux

ft_get_var_blend_coordinatesg_log_structuredg_log_structured_standardlibgconf-2.so.4libstdc++.so.6MATLABmatlabwindow

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

Best Answer

NOTE: In the instructions below we use the phrase "_set aside_ somelibrary.so" a couple of times, this does not mean only moving somelibrary.so itself, it means moving all files which start with somelibrary.so, so for example also somelibrary.so.1, somelibrary.so.1.0, etc. Scroll down to the bottom of this answer to see example Linux shell commands which use the * wildcard with which you can easily move all those files starting with a particular name.
Due to some library compatibility issues, MATLAB may not be able to launch MATLABWindow on your particular distribution/version of Linux. Here are some steps to detect and work around the incompatibility.
In MATLAB:
>> cd(matlabroot)
>> ! bin/glnxa64/MATLABWindow
----------------
1)
If you see:
bin/glnxa64/MATLABWindow: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
Then you should:
This is a known Ubuntu issue. As root:
# apt-get install libgconf-2-4
----------------
2)
If you see:
bin/glnxa64/MATLABWindow: symbol lookup error: _somelibrary_: undefined symbol: g_log_structured
or
bin/glnxa64/MATLABWindow: symbol lookup error: _somelibrary_: undefined symbol: g_log_structured_standard
Then you should:
Set aside MATLAB’s copy of the libglib-2.0.so library, located in <matlabroot>/cefclient/sys/os/glnxa64.
See instructions below.
----------------
3)
If you see:
bin/glnxa64/MATLABWindow: symbol lookup error: _somelibrary_: undefined symbol: FT_Get_Var_Blend_Coordinates
or
bin/glnxa64/MATLABWindow: symbol lookup error: _somelibrary_: undefined symbol: FT_Done_MM_Var
Then you should:
Set aside MATLAB’s copy of the libfreetype.so.6 library, located in <matlabroot>/bin/glnxa64.
See instructions below.
----------------
4)
If you see:
bin/glnxa64/MATLABWindow: path to/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by _somelibrary_)
Then you should:
Set aside MATLAB’s copy of the libstdc++.so.6 library, located in <matlabroot>/sys/os/glnxa64
See instructions below
----------------
5)
If you see:
A mini-browser window appears showing www.mathworks.com
Then you should:
Close the mini-browser. MATLABWindows is working.
----------------
To set aside MATLAB’s copy of the libstdc++.so.6 library (for example), please navigate to MATLAB R2017b installation location in your system and remove the “libstdc++.so.6” library file shipped with MATLAB R2017b, so that MATLAB will use the system version of that library:
<matlabroot>/sys/os/glnxa64
Note: Here <matlabroot> is the location in your system where MATLAB R2017b is installed.
Eg: ‘/usr/local/MATLAB/R2017B’.
Following are the commands to execute in linux shell to perform the above mentioned operation: (You may need root privilege)
# cd /usr/local/MATLAB/R2017b (or wherever you may have installed MATLAB)
# cd cefclient/sys/os/glnxa64 (or whichever directory is indicated in above table)
# mkdir exclude
# mv libglib-2.0.so* exclude/ (or whichever library is indicated in above table)
Related Question