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


root #./install


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}/ ./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}/ 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/ /usr/local/MATLAB/R2022a/bin/glnxa64/

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 This can be verified by launching the MATLABWindow application directly:

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

./MATLABWindow: error while loading shared libraries: 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/ to the install's glnxa64 path as, as elogind provides all the methods needed by the install:

root #ln -s /lib64/ /path/to/matlabInstallFiles/bin/glnxa64/
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/ /usr/local/MATLAB/R2023a/bin/glnxa64/

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/ /usr/local/MATLAB/R2023a/bin/glnxa64/

Failed to begin installer " 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