* Make sure that the symlink {{ic|bin/glnx64/libstdc++.so.6}} is pointing to the correct version of {{ic|libstdc++.so}} (which is also in the same directory)

+

* Make sure that the symlink {{ic|bin/glnx64/libstdc++.so.6}} is pointing to the correct version of {{ic|libstdc++.so.xx}} (which is also in the same directory and has numbers where 'xx' is). By default, it may be pointing to an older (and nonexistent) version (different value for 'xx').

* Make sure the device you're installing from is not mounted as {{ic|noexec}}

* Make sure the device you're installing from is not mounted as {{ic|noexec}}

Line 79:

Line 79:

The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get a MAC address for activation, while new Arch Linux setups do not have a network interface called eth0 (systemd uses [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names]).

The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get a MAC address for activation, while new Arch Linux setups do not have a network interface called eth0 (systemd uses [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names]).

−

To fix this [[rename network interfaces|change the name of the interface]].

+

The optimal solution is to create a dummy network interface named eth0 with the MAC address of the network device in use (wireless or wired) when you activated MATLAB. First, get that MAC address using {{ic|ip link}} Next, create the following file:

+

+

{{hc|/etc/systemd/system/matlab.licensing.service|<nowiki>

+

[Unit]

+

Description=Dummy network interface for MATLAB

+

Requires=systemd-modules-load.service

+

+

[Service]

+

Type=oneshot

+

ExecStart=/sbin/ip link set dev dummy0 name eth0

+

ExecStart=/sbin/ip link set dev eth0 address 00:00:00:00:00:00

+

+

[Install]

+

WantedBy=multi-user.target

+

</nowiki>

+

}}

+

+

Replace 00:00:00:00:00:00 with your MAC address.

+

+

Then make the script run on boot:

+

+

# systemctl enable matlab.licensing

+

+

Finally, set the dummy module to load on boot by creating the following file:

+

+

{{hc|/etc/modules-load.d/dummy.conf|<nowiki>dummy</nowiki>

+

}}

+

+

==== Rename Interfaces ====

+

+

A less preferable option is to [[rename network interfaces|change the name of the interface]].

The machine id should now be different than 000000000000 and you should be able to install and activate MATLAB without problems.

The machine id should now be different than 000000000000 and you should be able to install and activate MATLAB without problems.

Revision as of 23:23, 12 January 2014

MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built-in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java.

-nosplash is a flag preventing the splash screen from showing and taking up a temporary space in your task bar.

env -u _JAVA_OPTIONS prevents the creation of a .java.log-file in your home directory by unsetting $_JAVA_OPTIONS. Java prints all options set this way to stdout, and matlab treats everything in stdout as error worth a log.

-r '...' executes matlab code on startup:

cd('%d') This changes the working directory of matlab to the opened file’s directory.

edit '%f' This spawns an editor tab for the file.

You can also put this .desktop file in the ~/Desktop directory to create a shortcut.

Install supported compiler

In order for Matlab to work with C code (needed for simulink) it is necessarry to install a supported compiler. Install gcc44AUR from the AUR.

Then edit ${MATLAB}/bin/mexopts.sh and replace all occurances of CC='gcc' with CC='gcc-4.4' and CXX='g++' with CXX='g++-4.4'. Afterwards run

mex -setup

in Matlab and select the mexopts.sh file.

Troubleshooting

As one installs Matlab, it might complain that it cannot find a package, for the most part just look at the package name and then install it with Pacman, or in the case of x86_64 there are some libraries only in AUR.

Install-Time Library Errors

Make sure that the symlink bin/glnx64/libstdc++.so.6 is pointing to the correct version of libstdc++.so.xx (which is also in the same directory and has numbers where 'xx' is). By default, it may be pointing to an older (and nonexistent) version (different value for 'xx').

Make sure the device you're installing from is not mounted as noexec

If you downloaded the files from Mathworks' website, make sure they are not on an NTFS or FAT partition, because that can mess up the symlinks. Ext4 or Ext3 should work.

License: invalid machine id

The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get a MAC address for activation, while new Arch Linux setups do not have a network interface called eth0 (systemd uses Predictable Network Interface Names).

The optimal solution is to create a dummy network interface named eth0 with the MAC address of the network device in use (wireless or wired) when you activated MATLAB. First, get that MAC address using ip link Next, create the following file:

Rename Interfaces

The machine id should now be different than 000000000000 and you should be able to install and activate MATLAB without problems.

Resolving start warnings/errors

Even if all needed libraries are installed, Matlab when starting can still report some missing libraries. This is resolved by symbolic linking of needed libraries to directories that Matlab checks at start-up. For example, if Matlab triggers error/warning about missing /lib64/libc.so.6 library, this can be resolved by:

# ln -s /lib/libc.so.6 /lib64

Matlab R2011b with an up-to-date Arch Linux (as of March 12, 2012) fails on startup with the familiar "Failure loading desktop class." A solution is to point Matlab to the system JVM (confirmed to work with the jdk7-openjdk package):

export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre

MATLAB crashes when displaying graphics

To identify this error, start MATLAB with

LIBGL_DEBUG=verbose matlab

from the terminal and try to collect OpenGL information with opengl info from the MATLAB command prompt. If it crashes again and there is an output line like

libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6:
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))

then the problem is that MATLAB uses its own GNU C++ library, which is an older version than the up-to-date version on your Archlinux system. Make MATLAB use the current C++ library for your system by

With the NVIDIA card all it required to start working was to copy the libGLU.so from the Matlab installed library ${MATLAB}/sys/opengl/lib/glnx86/libGLU.so to /usr/lib directory. Note that in x86_64 this might be a different directory.