Files
matlab-launcher/matlab.sh
T
2026-09-30 19:11:28 -05:00

39 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Context
# matlab ships with shitty outdated qt and c++ libraries and it breaks on
# anything from the current decade.
# this fixes it by making your pc fall back on the normal libraries.
#
# also we're gonna do this in a user-owned folder because that just seems like
# a good idea
# Installation:
# sudo mkdir -p /opt/MATLAB
# sudo chown -R $USER:$USER /opt/MATLAB
#
# wget https://www.mathworks.com/mpm/glnxa64/mpm
# ./mpm install --release=R2026a --destination=/opt/MATLAB/R2026a --products MATLAB Simulink
#
# cd /opt/MATLAB/R2026a/bin/glnxa64
# mkdir exclude
# mv libfreetype.so* exclude/
#
# cd /opt/MATLAB/R2026a/sys/os/glnxa64
# mkdir exclude
# mv libstdc++.so.6* exclude/
# after installing, run this script to launch matlab
QT_QPA_PLATFORM=xcb
PATH=/opt/MATLAB/R2026a/bin:$PATH
exec matlab -licmode onlinelicensing
# ACHTUNG! GNOME Users et al.
# This even if the installation works, launching the program may not.
# if you see an error similar to this:
# dbus[27716]: D-Bus library appears to be incorrectly set up: see the manual page for dbus-uuidgen to correct this issue. (Failed to open "/mathworks/devel/bat/B3p1/build/3p/install/15160996/glnxa64/dbus/var/lib/dbus/machine-id": No such file or directory; Failed to open "/etc/machine-id": No such file or directory)
# you likely need to run the following command as root:
# dbus-uuidgen --ensure=/etc/machine-id