View | Details | Raw Unified | Return to bug 55652
Collapse All | Expand All

(-)en_US.ISO8859-1/books/handbook/linuxemu/chapter.sgml (+169 lines)
Lines 2939-2944 Link Here
2939
    </sect2>
2939
    </sect2>
2940
  </sect1>
2940
  </sect1>
2941
2941
2942
  <sect1 id="linuxemu-matlab">
2943
    <sect1info>
2944
      <authorgroup>
2945
	<author>
2946
	  <firstname>Dan</firstname>
2947
	  <surname>Pelleg</surname>
2948
	  <contrib>Contributed by </contrib>
2949
	</author>
2950
	<!-- daniel+handbook@pelleg.org -->
2951
      </authorgroup>
2952
    </sect1info>
2953
    <title>Installing MATLAB</title>
2954
2955
    <indexterm>
2956
      <primary>applications</primary>
2957
      <secondary><application>MATLAB</application></secondary>
2958
    </indexterm>
2959
2960
    <para>This document describes the process of installing the Linux
2961
      version of <application>MATLAB version 6.5</application> onto
2962
      a FreeBSD system.  It works quite well, with the exception of the Java
2963
      Virtual Machine (see below).</para>
2964
2965
    <para>The Linux version of <application>MATLAB</application> can be
2966
    ordered directly from MathWorks at <ulink
2967
    url="http://www.mathworks.com"></ulink>. Make sure you also get the
2968
      license file or instructions how to create it.</para>
2969
2970
    <sect2>
2971
      <title>Installing MATLAB</title>
2972
      <para>To install MATLAB, do the following:
2973
      <procedure>
2974
        <step>
2975
        <para>Insert the installation CD and mount
2976
        it.  Become <username>root</username>, as recommended by the install
2977
        script.  To start the installation script type:</para>
2978
        <screen>&prompt.root; <userinput>/compat/linux/bin/sh /cdrom/install</userinput></screen>
2979
        <tip>
2980
          <para>The installer is graphical.  If you get errors about not
2981
            being able to open a display, type "<userinput>setenv HOME
2982
              ~<replaceable>USER</replaceable>"</userinput>, where
2983
            <replaceable>USER</replaceable> is the user you did a
2984
            <command>su</command> as.</para>
2985
          </tip>
2986
        </step>
2987
        <step>
2988
          <para>
2989
            When asked for the <application>MATLAB</application> root directory, type:
2990
            <userinput>/compat/linux/usr/local/matlab</userinput>.
2991
          </para>
2992
          <tip>
2993
            
2994
            <para> For easier typing on the rest of the installation process, type
2995
              this at your shell:
2996
              <command>set MATLAB=/compat/linux/usr/local/matlab</command>
2997
            </para>
2998
          </tip>
2999
        </step>
3000
3001
        <step>
3002
          <para>Edit the license file as instructed when
3003
            obtaining the <application>MATLAB</application> license.
3004
          </para>
3005
          <tip>
3006
            <para> You can prepare this file in advance using your
3007
              favorite editor, and copy it to
3008
              <filename>$MATLAB/etc/license.dat</filename> before the
3009
              installer asks you to edit it.
3010
            </para>
3011
          </tip>
3012
        </step>
3013
3014
        <step>
3015
          <para>
3016
            Complete the installation process.
3017
          </para>
3018
        </step>
3019
      </procedure>
3020
      <para>At this point your <application>MATLAB</application>
3021
      installation is complete.  The following steps apply "glue" to connect
3022
      it to your FreeBSD system.
3023
      </para>
3024
    </sect2>
3025
3026
    <sect2>
3027
      <title>License manager startup</title>
3028
      <procedure>
3029
        <step>
3030
          <para>Create symlinks for the license manager scripts:</para>
3031
        <screen>&prompt.root; <userinput>ln -s $MATLAB/etc/lmboot /usr/local/etc/lmboot_TMW</userinput>
3032
&prompt.root; <userinput>ln -s $MATLAB/etc/lmdown /usr/local/etc/lmdown_TMW</userinput></screen>
3033
        </step>
3034
        <step>
3035
          <para>Create a startup file at
3036
            <filename>/usr/local/etc/rc.d/flexlm.sh</filename>. The example
3037
            below is a modified version of the distributed
3038
            <filename>$MATLAB/etc/rc.lm.glnx86</filename>.  The changes are
3039
            file locations, and startup of the license manager under
3040
            Linux emulation.</para>
3041
3042
            <programlisting>#!/bin/sh
3043
case "$1" in
3044
  start)
3045
        if [ -f /usr/local/etc/lmboot_TMW ]; then
3046
              /compat/linux/bin/sh /usr/local/etc/lmboot_TMW -u <replaceable>username</replaceable> && echo 'MATLAB_lmgrd'
3047
        fi
3048
        ;;
3049
  stop)
3050
	if [ -f /usr/local/etc/lmdown_TMW ]; then
3051
            /compat/linux/bin/sh /usr/local/etc/lmdown_TMW  > /dev/null 2>&1
3052
	fi
3053
        ;;
3054
  *)
3055
	echo "Usage: $0 {start|stop}"
3056
	exit 1
3057
	;;
3058
esac
3059
3060
exit 0</programlisting>
3061
3062
            <important>
3063
              <para>The file must be made executable:</para>
3064
                <screen>&prompt.root; <userinput>chmod +x /usr/local/etc/rc.d/flexlm.sh</userinput></screen>
3065
            </important>
3066
            <important>
3067
              <para> You must replace <replaceable>username</replaceable>
3068
              above with the name of a valid user on your system (and not
3069
              root).
3070
              </para>
3071
            </important>
3072
        </step>
3073
        <step>
3074
          <para>Start the license manager: <command>/usr/local/etc/rc.d/flexlm.sh start</command>
3075
          </para></step>
3076
      </procedure>
3077
    </sect2>
3078
3079
    <sect2>
3080
      <title>Creating a MATLAB startup script</title>
3081
      <procedure>
3082
        <step>
3083
          <para>Place the following startup script in
3084
            <filename>/usr/local/bin/matlab</filename>:
3085
          </para>
3086
          <programlisting>#!/bin/sh
3087
/compat/linux/bin/sh /compat/linux/usr/local/matlab/bin/matlab "$@"</programlisting>
3088
        </step>
3089
        <step>
3090
          <para> Type: <command>chmod +x /usr/local/bin/matlab</command>.
3091
            </para>
3092
        </step>
3093
      </procedure>
3094
    </sect2>
3095
3096
    <sect2>
3097
      <title>Using MATLAB</title>
3098
      <para>At this point you are ready to type <command>matlab</command>
3099
        and start using it.  Note that the version of
3100
        <application>Java</application> shipped with
3101
        <application>MATLAB</application> does not work under
3102
        FreeBSD.  Therefore you will have to start
3103
        <application>MATLAB</application> with either the
3104
        <option>-nojvm</option> or the <option>-nodesktop</option>
3105
        switch.
3106
      </para>
3107
    </sect2>
3108
3109
  </sect1>
3110
2942
  <sect1 id="linuxemu-advanced">
3111
  <sect1 id="linuxemu-advanced">
2943
    <title>Advanced Topics</title>
3112
    <title>Advanced Topics</title>

Return to bug 55652