the installer crashes as follows:
$ ./install
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to launch web window with error: Unable to launch the MATLABWindow application. The exit code was: 127
[1] 1409378 IOT instruction (core dumped) ./install
To find out why MATLABWindow
is crashing, run it manually to get detailed information.
$ ./bin/glnxa64/MATLABWindow
bin/glnxa64/MATLABWindow: symbol lookup error: /usr/lib/libcairo.so.2: undefined symbol: FT_Get_Color_Glyph_Layer
FT_Get_Color_Glyph_Layer
is a symbol of freetype2, which indicates a library incompatibility between the MATLAB application and the Arch Linux packages. [6]
To fix this, put aside MATLAB's libfreetype.so*
.
$ rm ./bin/glnxa64/libfreetype.so*
You can also use LD_PRELOAD
environment variable to force MATLAB use Arch Linux's libfreetype without removing the lib file.
$ export LD_PRELOAD=/lib64/libfreetype.so
$ ./install
Similarly, if the error is caused by undefined symbol: g_log_structured...
, put aside MATLAB's libglib-2.0.so*
. If the error is caused by path to/libstdc++.so.6: version
CXXABI_1.3.9' not found (required by somelibrary), put aside MATLAB's
libstdc++.so.6`.
$ rm ./bin/glnxa64/../../sys/os/glnxa64/libstdc++.so*
$ rm ./bin/glnxa64/libstdc++.so*
Make the folder manually (as root), and take ownership. The path is typically /usr/local/MATLAB
# mkdir -p /path/to/MATLAB/R20XXx
# chown -R $LOGNAME: /path/to/MATLAB/R20XXx
创建符号链接:可以临时sudo chown -R $LOGNAME: /usr/local/bin
, 然后 sudo chown -R root:root /usr/local/bin
/usr/share/applications/matlab.desktop
[Desktop Entry]
Type=Application
Terminal=false
MimeType=text/x-matlab
Exec=env LD_PRELOAD="/usr/lib64/libfreetype.so.6" /usr/local/MATLAB/R2023a/bin/matlab -desktop -useStartupFolderPref
Name=MATLAB
Icon=matlab
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
无法在当前系统配置中打开此文件
问题原因同 Q1
cd <matlab_root>
mv ./bin/glnxa64/libfreetype.so.6 ./bin/glnxa64/libfreetype.so.6.old
mv ./bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6 ./bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6.ol
If you are getting some weird error that does not happen elsewhere, you can find all the external libraries Matlab is linking to by running the following command.
find /usr/local/MATLAB/R2022b -name "*.so*" -exec ldd {} \; 2>/dev/null | grep 'not found' | sort -u | sed -r 's/^\s+(\[S+.so](http://s+.so/)).*$/\1/'
通过以上命令可以检查链接库错误,并针对解决。
pacman -Qi gtk2
sudo pacman -S gtk2
https://wiki.archlinux.org/title/MATLAB