Date: Sat, 16 Aug 2003 15:56:17 +0300 (IDT) From: Dan Pelleg <daniel+handbook@pelleg.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/55652: handbook addition: installing linux MATLAB Message-ID: <20030816125617.D7E3854F@lank.auton.cs.cmu.edu> Resent-Message-ID: <200308170410.h7H4AAaX079155@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 55652 >Category: docs >Synopsis: handbook addition: installing linux MATLAB >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Aug 16 21:10:09 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Dan Pelleg >Release: FreeBSD 4.8-RC i386 >Organization: >Environment: System: FreeBSD l 4.8-RC FreeBSD 4.8-RC #4: Sat Aug 2 13:54:45 EDT 2003 root@p:/scratch/obj/usr/src/sys/L i386 >Description: Handbook section describing installation of MATLAB for linux. >How-To-Repeat: >Fix: --- en_US.ISO8859-1/books/handbook/linuxemu/chapter.sgml.orig Fri Aug 15 08:31:07 2003 +++ en_US.ISO8859-1/books/handbook/linuxemu/chapter.sgml Sat Aug 16 15:38:29 2003 @@ -2939,6 +2939,175 @@ </sect2> </sect1> + <sect1 id="linuxemu-matlab"> + <sect1info> + <authorgroup> + <author> + <firstname>Dan</firstname> + <surname>Pelleg</surname> + <contrib>Contributed by </contrib> + </author> + <!-- daniel+handbook@pelleg.org --> + </authorgroup> + </sect1info> + <title>Installing MATLAB</title> + + <indexterm> + <primary>applications</primary> + <secondary><application>MATLAB</application></secondary> + </indexterm> + + <para>This document describes the process of installing the Linux + version of <application>MATLAB version 6.5</application> onto + a FreeBSD system. It works quite well, with the exception of the Java + Virtual Machine (see below).</para> + + <para>The Linux version of <application>MATLAB</application> can be + ordered directly from MathWorks at <ulink + url="http://www.mathworks.com"></ulink>. Make sure you also get the + license file or instructions how to create it.</para> + + <sect2> + <title>Installing MATLAB</title> + <para>To install MATLAB, do the following: + <procedure> + <step> + <para>Insert the installation CD and mount + it. Become <username>root</username>, as recommended by the install + script. To start the installation script type:</para> + <screen>&prompt.root; <userinput>/compat/linux/bin/sh /cdrom/install</userinput></screen> + <tip> + <para>The installer is graphical. If you get errors about not + being able to open a display, type "<userinput>setenv HOME + ~<replaceable>USER</replaceable>"</userinput>, where + <replaceable>USER</replaceable> is the user you did a + <command>su</command> as.</para> + </tip> + </step> + <step> + <para> + When asked for the <application>MATLAB</application> root directory, type: + <userinput>/compat/linux/usr/local/matlab</userinput>. + </para> + <tip> + + <para> For easier typing on the rest of the installation process, type + this at your shell: + <command>set MATLAB=/compat/linux/usr/local/matlab</command> + </para> + </tip> + </step> + + <step> + <para>Edit the license file as instructed when + obtaining the <application>MATLAB</application> license. + </para> + <tip> + <para> You can prepare this file in advance using your + favorite editor, and copy it to + <filename>$MATLAB/etc/license.dat</filename> before the + installer asks you to edit it. + </para> + </tip> + </step> + + <step> + <para> + Complete the installation process. + </para> + </step> + </procedure> + <para>At this point your <application>MATLAB</application> + installation is complete. The following steps apply "glue" to connect + it to your FreeBSD system. + </para> + </sect2> + + <sect2> + <title>License manager startup</title> + <procedure> + <step> + <para>Create symlinks for the license manager scripts:</para> + <screen>&prompt.root; <userinput>ln -s $MATLAB/etc/lmboot /usr/local/etc/lmboot_TMW</userinput> +&prompt.root; <userinput>ln -s $MATLAB/etc/lmdown /usr/local/etc/lmdown_TMW</userinput></screen> + </step> + <step> + <para>Create a startup file at + <filename>/usr/local/etc/rc.d/flexlm.sh</filename>. The example + below is a modified version of the distributed + <filename>$MATLAB/etc/rc.lm.glnx86</filename>. The changes are + file locations, and startup of the license manager under + Linux emulation.</para> + + <programlisting>#!/bin/sh +case "$1" in + start) + if [ -f /usr/local/etc/lmboot_TMW ]; then + /compat/linux/bin/sh /usr/local/etc/lmboot_TMW -u <replaceable>username</replaceable> && echo 'MATLAB_lmgrd' + fi + ;; + stop) + if [ -f /usr/local/etc/lmdown_TMW ]; then + /compat/linux/bin/sh /usr/local/etc/lmdown_TMW > /dev/null 2>&1 + fi + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 + ;; +esac + +exit 0</programlisting> + + <important> + <para>The file must be made executable:</para> + <screen>&prompt.root; <userinput>chmod +x /usr/local/etc/rc.d/flexlm.sh</userinput></screen> + </important> + <important> + <para> You must replace <replaceable>username</replaceable> + above with the name of a valid user on your system (and not + root). + </para> + </important> + </step> + <step> + <para>Start the license manager: <command>/usr/local/etc/rc.d/flexlm.sh start</command> + </para></step> + </procedure> + </sect2> + + <sect2> + <title>Creating a MATLAB startup script</title> + <procedure> + <step> + <para>Place the following startup script in + <filename>/usr/local/bin/matlab</filename>: + </para> + <programlisting>#!/bin/sh +/compat/linux/bin/sh /compat/linux/usr/local/matlab/bin/matlab "$@"</programlisting> + </step> + <step> + <para> Type: <command>chmod +x /usr/local/bin/matlab</command>. + </para> + </step> + </procedure> + </sect2> + + <sect2> + <title>Using MATLAB</title> + <para>At this point you are ready to type <command>matlab</command> + and start using it. Note that the version of + <application>Java</application> shipped with + <application>MATLAB</application> does not work under + FreeBSD. Therefore you will have to start + <application>MATLAB</application> with either the + <option>-nojvm</option> or the <option>-nodesktop</option> + switch. + </para> + </sect2> + + </sect1> + <sect1 id="linuxemu-advanced"> <title>Advanced Topics</title> >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030816125617.D7E3854F>