Arch Linux Wayland 安装 MATLAB

Sat, Nov 2, 2024heziahArch LinuxMATLAB

Q1: Unable to launch the MATLABWindow application

bash
$ ./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
bash
$ ./bin/glnxa64/MATLABWindow

bin/glnxa64/MATLABWindow: symbol lookup error: /usr/lib/libcairo.so.2: undefined symbol: FT_Get_Color_Glyph_Layer
bash
$ rm ./bin/glnxa64/libfreetype.so*
bash
$ export LD_PRELOAD=/lib64/libfreetype.so
$ ./install
bash
$ rm ./bin/glnxa64/../../sys/os/glnxa64/libstdc++.so*
$ rm ./bin/glnxa64/libstdc++.so*

Q2: GUI installer is unable to create the target folder when installing as user

plain
# mkdir -p /path/to/MATLAB/R20XXx
# chown -R $LOGNAME: /path/to/MATLAB/R20XXx

Q3: 创建 /usr/share/applications/matlab.desktop

bash
[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

Q4: Unable to open this file in the current system configuration.

bash
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
bash
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/'

Q5: gtk2

bash
pacman -Qi gtk2
sudo pacman -S gtk2

参考链接

https://ww2.mathworks.cn/matlabcentral/answers/1815470-matlab-live-editor-unable-to-open-this-file-in-the-current-system-configuration

https://wiki.archlinux.org/title/MATLAB

https://blog.csdn.net/lxyoucan/article/details/127980952

https://juejin.cn/post/7230860299984273467