https://wiki.archlinux.org/api.php?action=feedcontributions&user=Seb.belese&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:02:11ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=MATLAB&diff=251901MATLAB2013-03-25T08:12:13Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${MATLAB}/bin/mexopts.sh}} and replace CC='gcc' with CC='gcc-4.4' and CXX='g++' with CXX='g++-4.4'. Afterwards run <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux ([http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names]). Juste change the name of the interface (wireless_tools needed, or use another method [[Rename network interfaces]]):<br />
<br />
# systemctl stop NetworkManager<br />
# ifrename -i enp2s0f0 -n eth0<br />
# systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
This will be needed after each reboot. To make it permanent, disable [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names] (see [[Rename network interfaces]]):<br />
<br />
# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251900MATLAB2013-03-25T08:11:30Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${MATLAB}/bin/mexopts.sh}} and replace CC='gcc' with CC='gcc-4.4' and CXX='g++' with CXX='g++-4.4'. Afterwards run <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux ([http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names]). Juste change the name of the interface (wireless_tools needed, or use another method [[Rename network interfaces]]):<br />
<br />
# systemctl stop NetworkManager<br />
# ifrename -i enp2s0f0 -n eth0<br />
# systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
This will be needed after each reboot. To make it permanent, disable [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names] according to [[Rename network interfaces]]:<br />
<br />
# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251899MATLAB2013-03-25T08:10:44Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${MATLAB}/bin/mexopts.sh}} and replace CC='gcc' with CC='gcc-4.4' and CXX='g++' with CXX='g++-4.4'. Afterwards run <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux. Juste change the name of the interface (wireless_tools needed, or use another method [[Rename network interfaces]]):<br />
<br />
# systemctl stop NetworkManager<br />
# ifrename -i enp2s0f0 -n eth0<br />
# systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
This will be needed after each reboot. To make it permanent, disable [http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames Predictable Network Interface Names] according to [[Rename network interfaces]]:<br />
<br />
# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251523MATLAB2013-03-21T09:25:49Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${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 <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux. Juste change the name of the interface (wireless_tools needed, or use another method [https://wiki.archlinux.org/index.php/Rename_network_interfaces]):<br />
<br />
# sudo systemctl stop NetworkManager<br />
# sudo ifrename -i enp2s0f0 -n eth0<br />
# sudo systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251522MATLAB2013-03-21T09:25:34Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${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 <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux. Juste change the name of the interface (wireless_tools needed, or use another method [Rename_network_interfaces]):<br />
<br />
# sudo systemctl stop NetworkManager<br />
# sudo ifrename -i enp2s0f0 -n eth0<br />
# sudo systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251521MATLAB2013-03-21T09:25:09Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${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 <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux. Juste change the name of the interface (wireless_tools needed, or use another method described [https://wiki.archlinux.org/index.php/Rename_network_interfaces]):<br />
<br />
# sudo systemctl stop NetworkManager<br />
# sudo ifrename -i enp2s0f0 -n eth0<br />
# sudo systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251520MATLAB2013-03-21T09:03:55Z<p>Seb.belese: /* License: invalid machine id */</p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${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 <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0 to get the MAC address, while the naming is different in archlinux. Juste change the name of the interface:<br />
<br />
# sudo systemctl stop NetworkManager<br />
# sudo ifrename -i enp2s0f0 -n eth0<br />
# sudo systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belesehttps://wiki.archlinux.org/index.php?title=MATLAB&diff=251519MATLAB2013-03-21T09:03:00Z<p>Seb.belese: </p>
<hr />
<div>[[Category:Mathematics and science]]<br />
{{stub}}<br />
<br />
== General installation ==<br />
<br />
Use the following commands to mount and install Matlab. Note that the path to the install script should contain no spaces, or the install will fail. For graphical install and interface {{Pkg|libxp}} is needed. You may need to [[Pacman|install]] {{Pkg|libxp}} from the [[official repositories]] first. Note also that Matlab is not compliant with Java 7, so you may need to install, for example, {{Pkg|openjdk6}}.<br />
Install from iso file:<br />
# modprobe loop<br />
# mount -o loop matlab.iso /mnt/<br />
# /mnt/install<br />
<br />
Additionally, install {{Pkg|xorg-fonts-100dpi}}, {{Pkg|xorg-fonts-75dpi}}, and {{Pkg|xorg-fonts-type1}} so fonts are displayed properly in figures.<br />
<br />
=== Create Desktop and Menu Shortcuts ===<br />
If you choose Custom in Installation Type, the symlink will be created automatically. Otherwise, you may need to manually create a symlink in {{ic|/usr/local/bin}} to make it easier to launch in terminal:<br />
<br />
# ln -s /{MATLAB}/bin/matlab /usr/local/bin<br />
<br />
To create a menu item, we need to get a icon first:<br />
<br />
# wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png<br />
<br />
Then create a new .desktop file in {{ic|/usr/share/applications}} with following lines:<br />
<br />
{{hc|/usr/share/applications/matlab.desktop|<nowiki><br />
#!/usr/bin/env xdg-open<br />
[Desktop Entry]<br />
Type=Application<br />
Icon=/usr/share/icons/matlab.png<br />
Name=MATLAB R2012a<br />
Comment=Start MATLAB - The Language of Technical Computing<br />
Exec=matlab -desktop<br />
Categories=Development;<br />
</nowiki><br />
}}<br />
<br />
You can also put this .desktop file in the Desktop folder to create a shortcut.<br />
<br />
More details see [https://help.ubuntu.com/community/MATLAB MATLAB - Community Ubuntu Documents]<br />
<br />
=== Install 32-bit Matlab on 64-bit system ===<br />
{{Out of date|Since Version R2012b all Linux versions are 64bit. That's not true for students versions!}}<br />
Unfortunately, 32-bit is the only version available to students; 64-bit versions are available if you pay more money. These instructions have been updated for r2012a student version. To start off with we need to install a bunch of lib32 packages, not all found with pacman. The following packages must be installed (the list may be out of date):<br />
{{Pkg|lib32-mesa}}, {{Pkg|lib32-glu}}, {{Pkg|lib32-glibc}}, {{Pkg|lib32-libxmu}}, {{Pkg|lib32-zlib}}, {{Pkg|lib32-ncurses}}, {{Pkg|lib32-libxtst}}, {{Pkg|lib32-libxi}}, {{Pkg|lib32-libxrender}}, {{Pkg|lib32-libxfixes}}, {{Pkg|lib32-freetype2}}, {{Pkg|lib32-fontconfig}}, {{Pkg|lib32-libxdamage}} from the [[official repositories]] and {{AUR|lib32-libxpm}}, {{AUR|lib32-libxp}}, {{AUR|bin32-openjdk6}} (32 bit openjdk7 might also work) from the [[AUR]].<br />
<br />
Once they are installed: <br />
<br />
$ ./install -glnx86<br />
<br />
After fixing any library dependency problems, you will be able to guide the installer through the install process. If activation doesn't work in the installer you'll need to login to Wolfram's site and download a license file which you'll put in {{ic|${MATLAB}/licenses}}. After the install process, you'll need to create a symbolic link because the installer oddly thinks it's installing the 64-bit version of Matlab:<br />
<br />
$ cd ${MATLAB}/sys/java/jre<br />
$ ln -s glnx86 glnxa64<br />
<br />
In the above, ${MATLAB} should be replaced by the root directory you chose for your installation.<br />
<br />
You'll also need to put another link in Matlab's {{ic|bin}} folder because despite asking Matlab to install the 32bit version, it still thinks you want to use the 64bit one:<br />
<br />
$ cd ${MATLAB}/bin<br />
$ ln -s glnx86 glnxa64<br />
<br />
After that you'll need to edit the {{ic|${MATLAB}/bin/matlab}} script to get the java settings correct. After the comments at the top of the file, you'll need the line:<br />
<br />
export MATLAB_JAVA=/path/to/jre<br />
<br />
Where {{ic|/path/to/jre}} will be {{ic|/opt/java/jre}} if you're using Sun's JRE. The path is one level up from where {{ic|rt.jar}} is located. That is, {{ic|rt.jar}} should be in {{ic|/opt/java/jre/libs}} if you used {{ic|/opt/java/jre}} for {{ic|MATLAB_JAVA}}. In Matlab R2010a it works pretty well, if you use the internal JRE with:<br />
<br />
export MATLAB_JAVA=${MATLAB}/sys/java/jre/glnx86/jre<br />
<br />
If using {{AUR|bin32-openjdk6}}, use<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre/<br />
<br />
To run it, you'll need to:<br />
<br />
$ ${MATLAB}/bin/matlab -glnx86 -desktop<br />
<br />
At this point you may have to resolve more library dependencies or troubleshoot [[Java]]. Your version of Matlab may need a specific version of Sun's JRE installed.<br />
<br />
=== Install supported compiler ===<br />
<br />
In order for Matlab to work with C code it is necessarry to install a supported Compiler. Install {{AUR|gcc44}} from the AUR.<br />
<br />
Then edit {{ic|${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 <br />
mex -setup<br />
in Matlab and select the {{ic|mexopts.sh}} file.<br />
<br />
== Troubleshooting ==<br />
As one installs Matlab, it might complain that it can't 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]].<br />
<br />
==== License: invalid machine id ====<br />
The installer may complain about an invalid machine id, because it is looking for a network interface named eth0, while the naming is different in archlinux. Juste change the name of the interface:<br />
<br />
# sudo systemctl stop NetworkManager<br />
# sudo ifrename -i enp2s0f0 -n eth0<br />
# sudo systemctl start NetworkManager<br />
<br />
Then restart the installer. The machine id should now be different than 000000000000.<br />
<br />
==== Resolving start warnings/errors ====<br />
<br />
* 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 {{ic|/lib64/libc.so.6}} library, this can be resolved by:<br />
<br />
# ln -s /lib/libc.so.6 /lib64<br />
<br />
* 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 {{Pkg|jdk7-openjdk}} package):<br />
<br />
export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk/jre<br />
<br />
==== MATLAB crashes when displaying graphics ====<br />
<br />
To identify this error, start MATLAB with<br />
<br />
LIBGL_DEBUG=verbose matlab<br />
<br />
from the terminal and try to collect OpenGL information with {{ic|opengl info}} from the MATLAB command prompt. If it crashes again and there is an output line like <br />
<br />
libGL error: dlopen /usr/lib/xorg/modules/dri/swrast_dri.so failed <br />
(/usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: <br />
version `GLIBCXX_3.4.15' not found (required by /usr/lib/xorg/modules/dri/swrast_dri.so))<br />
<br />
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<br />
<br />
cd /usr/local/MATLAB/R(your release)/sys/os/glnxa64<br />
sudo unlink libstdc++.so.6<br />
sudo ln -s /usr/lib/libstdc++.so.6<br />
<br />
== OpenGL Acceleration ==<br />
<br />
Once Matlab is installed type the following in the interpreter:<br />
<br />
>> opengl info<br />
<br />
The output should be similar to the following:<br />
<br />
{{bc|<nowiki><br />
Version = 2.0 Mesa 7.8.2<br />
Vendor = Advanced Micro Devices, Inc.<br />
Renderer = Mesa DRI R600 (RV710 9552) 20090101 x86/MMX/SSE2 TCL DRI2<br />
MaxTextureSize = 4096<br />
Visual = 0xcb (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)<br />
Software = false<br />
# of Extensions = 107<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 0<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
This will vary with card you are using, but the important part is "Software = false". If it's not "false" for you, then there is a problem with your hardware acceleration.<br />
<br />
=== NVIDIA ===<br />
<br />
With an [[Nvidia|NVIDIA]] card, the output should be similar to this:<br />
{{bc|<nowiki><br />
>> opengl info<br />
Version = 2.1.2 NVIDIA 177.82<br />
Vendor = NVIDIA Corporation<br />
Renderer = Quadro NVS 140M/PCI/SSE2<br />
MaxTextureSize = 8192<br />
Visual = 0x21 (TrueColor, depth 16, RGB mask 0xf800 0x07e0 0x001f)<br />
Software = false<br />
# of Extensions = 144<br />
<br />
Driver Bug Workarounds:<br />
OpenGLBitmapZbufferBug = 0<br />
OpenGLWobbleTesselatorBug = 0<br />
OpenGLLineSmoothingBug = 0<br />
OpenGLClippedImageBug = 1<br />
OpenGLEraseModeBug = 0<br />
</nowiki>}}<br />
<br />
With the NVIDIA card all it required to start working was to copy the {{ic|libGLU.so}} from the Matlab installed library {{ic|${MATLAB}/sys/opengl/lib/glnx86/libGLU.so}} to {{ic|/usr/lib directory}}. Note that in x86_64 this might be a different directory.<br />
<br />
{{Note|Although, not thoroughly tested, using {{Pkg|lib32-nvidia-utils}} seems to work as well.}}</div>Seb.belese