Matlab

From Gentoo Wiki
Jump to:navigation Jump to:search

This guide explains how to install and run MathWorks Matlab on Gentoo.

Mounting the installation media

ISO file

root #modprobe loop
root #mkdir -p /mnt/iso
root #mount -o loop matlab.iso /mnt/iso
root #cd /mnt/iso

Optical disk

root #mkdir -p /mnt/cdrom
root #mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
root #cd /mnt/cdrom

Installing

root #./install

Troubleshooting

Blank window while using xmonad/awesome/dwm

Set the WM name to "LG3D"

e.g. xmonad:

FILE ~/.xmonad/xmonad.hs
main =
    xmonad $ defaultConfig {
      startupHook = setWMName "LG3D"
    }

Install gui not show up

This may happen on R2023b. Try

root #LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/${your_gcc_version}/libstdc++.so ./install

If matlab's gui not show up as well, you can also try to use

user $LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/${your_gcc_version}/libstdc++.so matlab

Warning `GLIBCXX_3.4.29' not found

This warning vanishes after linking the current library. For example:

root #ln -sf /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/libstdc++.so.6.0.30 /usr/local/MATLAB/R2022a/bin/glnxa64/libstdc++.so.6

Installer not launching on openrc systems

Matlab versions from 2021a include a new installer that assumes systemd is present. The resulting error is:

root #./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] 342 IOT instruction ../../install

This can be caused by more than one assumed library being missing, but in particular if you are running openrc as your init system it will fail because of a missing libsystemd.so.0. This can be verified by launching the MATLABWindow application directly:

root #./path/to/matlabInstallFiles/bin/glnxa64/MATLABWindow

./MATLABWindow: error while loading shared libraries: libsystemd.so.0: cannot open shared object file: No such file or directory

If this is indeed the library causing the fault it can be solved by symlinking /lib64/libelogind.so.0 to the install's glnxa64 path as libsystemd.so.0, as elogind provides all the methods needed by the install:

root #ln -s /lib64/libelogind.so.0 /path/to/matlabInstallFiles/bin/glnxa64/libsystemd.so.0
root #/path/to/matlabInstallFiles/install

Failed to load module "canberra-gtk-module"

This warning vanishes after linking the libcanberra module. For example:

root #ln -s /usr/lib64/gtk-2.0/modules/libcanberra-gtk-module.so /usr/local/MATLAB/R2023a/bin/glnxa64/libcanberra-gtk-module.so

Failed to load module "appmenu-gtk-module"

This warning vanishes after linking the libappmenu-gtk module. For example:

root #ln -s /usr/lib64/gtk-2.0/modules/libappmenu-gtk-module.so /usr/local/MATLAB/R2023a/bin/glnxa64/libcanberra-gtk-module.so

Failed to begin installer "libexpat.so.1: file too short"

root #unzip -X -K matlab_R2024a_glnxa64

See also

  • GNU Octave — a free and open-source computing environment and high-level interactive programming language, that is primarily intended for numerical computations.

External resources