From dpelleg@cs.cmu.edu  Sat Aug 16 21:01:22 2003
Return-Path: <dpelleg@cs.cmu.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8B3F137B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 16 Aug 2003 21:01:22 -0700 (PDT)
Received: from gw.pelleg.org (gw.pelleg.org [205.201.13.235])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 453AE43F75
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 16 Aug 2003 21:01:21 -0700 (PDT)
	(envelope-from dpelleg@cs.cmu.edu)
Received: from lank.auton.cs.cmu.edu (bzq-179-128-154.pop.bezeqint.net [212.179.128.154])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(Client CN "gw.pelleg.org", Issuer "Dan Pelleg" (verified OK))
	by gw.pelleg.org (Postfix) with ESMTP id 5441A5A37
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 Aug 2003 00:01:15 -0400 (EDT)
Received: by lank.auton.cs.cmu.edu (Postfix, from userid 7675)
	id D7E3854F; Sat, 16 Aug 2003 15:56:17 +0300 (IDT)
Message-Id: <20030816125617.D7E3854F@lank.auton.cs.cmu.edu>
Date: Sat, 16 Aug 2003 15:56:17 +0300 (IDT)
From: Dan Pelleg <daniel+handbook@pelleg.org>
Reply-To: Dan Pelleg <daniel+handbook@pelleg.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: handbook addition: installing linux MATLAB
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55652
>Category:       docs
>Synopsis:       handbook addition: installing linux MATLAB
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    blackend
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 16 21:10:09 PDT 2003
>Closed-Date:    Tue Aug 19 01:17:44 PDT 2003
>Last-Modified:  Tue Aug 19 01:17:44 PDT 2003
>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:
Responsible-Changed-From-To: freebsd-doc->blackend 
Responsible-Changed-By: blackend 
Responsible-Changed-When: Mon Aug 18 02:45:47 PDT 2003 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55652 
State-Changed-From-To: open->closed 
State-Changed-By: blackend 
State-Changed-When: Tue Aug 19 01:16:31 PDT 2003 
State-Changed-Why:  
I committed a slightly different verion of your patch (various SGML, 
whitespaces etc. fixes).  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55652 
>Unformatted:
