⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linuxemu-matlab.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Installing MATLAB</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Linux Binary Compatibility" href="linuxemu.html" /><link rel="PREVIOUS" title="Installing Maple" href="linuxemu-maple.html" /><link rel="NEXT" title="Installing Oracle" href="linuxemu-oracle.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="linuxemu-maple.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 10 Linux Binary Compatibility</td><td width="10%" align="right" valign="bottom"><a href="linuxemu-oracle.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="LINUXEMU-MATLAB" name="LINUXEMU-MATLAB">10.5 Installing <spanclass="TRADEMARK">MATLAB</span>&reg;</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Dan Pelleg.</i> <p>This document describes the process of installing the Linux version of <bclass="APPLICATION"><span class="TRADEMARK">MATLAB</span>&reg; version 6.5</b> onto aFreeBSD system. It works quite well, with the exception of the <bclass="APPLICATION"><span class="TRADEMARK">Java Virtual Machine</span>&#8482;</b> (see<a href="linuxemu-matlab.html#MATLAB-JRE">Section 10.5.3</a>).</p><p>The Linux version of <b class="APPLICATION"><span class="TRADEMARK">MATLAB</span></b>can be ordered directly from The MathWorks at <a href="http://www.mathworks.com"target="_top">http://www.mathworks.com</a>. Make sure you also get the license file orinstructions how to create it. While you are there, let them know you would like a nativeFreeBSD version of their software.</p><div class="SECT2"><h2 class="SECT2"><a id="AEN13473" name="AEN13473">10.5.1 Installing <spanclass="TRADEMARK">MATLAB</span></a></h2><p>To install <b class="APPLICATION"><span class="TRADEMARK">MATLAB</span></b>, do thefollowing:</p><div class="PROCEDURE"><ol type="1"><li><p>Insert the installation CD and mount it. Become <tt class="USERNAME">root</tt>, asrecommended by the installation script. To start the installation script type:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">/compat/linux/bin/sh /cdrom/install</kbd></pre><div class="TIP"><blockquote class="TIP"><p><b>Tip:</b> The installer is graphical. If you get errors about not being able to opena display, type <tt class="COMMAND">setenv HOME ~<varclass="REPLACEABLE">USER</var></tt>, where <var class="REPLACEABLE">USER</var> is theuser you did a <a href="http://www.FreeBSD.org/cgi/man.cgi?query=su&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">su</span>(1)</span></a> as.</p></blockquote></div></li><li><p>When asked for the <b class="APPLICATION"><span class="TRADEMARK">MATLAB</span></b>root directory, type: <kbd class="USERINPUT">/compat/linux/usr/local/matlab</kbd>.</p><div class="TIP"><blockquote class="TIP"><p><b>Tip:</b> For easier typing on the rest of the installation process, type this atyour shell prompt: <tt class="COMMAND">set MATLAB=/compat/linux/usr/local/matlab</tt></p></blockquote></div></li><li><p>Edit the license file as instructed when obtaining the <b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span></b> license.</p><div class="TIP"><blockquote class="TIP"><p><b>Tip:</b> You can prepare this file in advance using your favorite editor, and copyit to <tt class="FILENAME">$MATLAB/license.dat</tt> before the installer asks you to editit.</p></blockquote></div></li><li><p>Complete the installation process.</p></li></ol></div><p>At this point your <b class="APPLICATION"><span class="TRADEMARK">MATLAB</span></b>installation is complete. The following steps apply ``glue'' to connect it to yourFreeBSD system.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN13515" name="AEN13515">10.5.2 License ManagerStartup</a></h2><div class="PROCEDURE"><ol type="1"><li><p>Create symlinks for the license manager scripts:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ln -s $MATLAB/etc/lmboot /usr/local/etc/lmboot_TMW</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">ln -s $MATLAB/etc/lmdown /usr/local/etc/lmdown_TMW</kbd></pre></li><li><p>Create a startup file at <tt class="FILENAME">/usr/local/etc/rc.d/flexlm.sh</tt>. Theexample below is a modified version of the distributed <ttclass="FILENAME">$MATLAB/etc/rc.lm.glnx86</tt>. The changes are file locations, andstartup of the license manager under Linux emulation.</p><pre class="PROGRAMLISTING">#!/bin/shcase "$1" in  start)        if [ -f /usr/local/etc/lmboot_TMW ]; then              /compat/linux/bin/sh /usr/local/etc/lmboot_TMW -u <varclass="REPLACEABLE">username</var> &amp;&amp; echo 'MATLAB_lmgrd'        fi        ;;  stop)    if [ -f /usr/local/etc/lmdown_TMW ]; then            /compat/linux/bin/sh /usr/local/etc/lmdown_TMW  &gt; /dev/null 2&gt;&amp;1    fi        ;;  *)    echo "Usage: $0 {start|stop}"    exit 1    ;;esacexit 0</pre><div class="IMPORTANT"><blockquote class="IMPORTANT"><p><b>Important:</b> The file must be made executable:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">chmod +x /usr/local/etc/rc.d/flexlm.sh</kbd></pre><p>You must also replace <var class="REPLACEABLE">username</var> above with the name of avalid user on your system (and not <tt class="USERNAME">root</tt>).</p></blockquote></div></li><li><p>Start the license manager with the command:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">/usr/local/etc/rc.d/flexlm.sh start</kbd></pre></li></ol></div></div><div class="SECT2"><h2 class="SECT2"><a id="MATLAB-JRE" name="MATLAB-JRE">10.5.3 Linking the <spanclass="TRADEMARK">Java</span>&#8482; Runtime Environment</a></h2><p>Change the <b class="APPLICATION"><span class="TRADEMARK">Java</span>&#8482;</b>Runtime Environment (JRE) link to one working under FreeBSD:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">cd $MATLAB/sys/java/jre/glnx86/</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">unlink jre; ln -s ./jre1.1.8 ./jre</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN13555" name="AEN13555">10.5.4 Creating a <spanclass="TRADEMARK">MATLAB</span> Startup Script</a></h2><div class="PROCEDURE"><ol type="1"><li><p>Place the following startup script in <ttclass="FILENAME">/usr/local/bin/matlab</tt>:</p><pre class="PROGRAMLISTING">#!/bin/sh/compat/linux/bin/sh /compat/linux/usr/local/matlab/bin/matlab "$@"</pre></li><li><p>Then type the command <tt class="COMMAND">chmod +x /usr/local/bin/matlab</tt>.</p></li></ol></div><div class="TIP"><blockquote class="TIP"><p><b>Tip:</b> Depending on your version of <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/emulators/linux_base/pkg-descr"><ttclass="FILENAME">emulators/linux_base</tt></a>, you may run into errors when running thisscript. To avoid that, edit the file <ttclass="FILENAME">/compat/linux/usr/local/matlab/bin/matlab</tt>, and change the line thatsays:</p><pre class="PROGRAMLISTING">if [ `expr "$lscmd" : '.*-&gt;.*'` -ne 0 ]; then</pre><p>(in version 13.0.1 it is on line 410) to this line:</p><pre class="PROGRAMLISTING">if test -L $newbase; then</pre></blockquote></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN13573" name="AEN13573">10.5.5 Creating a <spanclass="TRADEMARK">MATLAB</span> Shutdown Script</a></h2><p>The following is needed to solve a problem with <span class="TRADEMARK">MATLAB</span>not exiting correctly.</p><div class="PROCEDURE"><ol type="1"><li><p>Create a file <tt class="FILENAME">$MATLAB/toolbox/local/finish.m</tt>, and in it putthe single line:</p><pre class="PROGRAMLISTING">! $MATLAB/bin/finish.sh</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> The <var class="LITERAL">$MATLAB</var> is literal.</p></blockquote></div><div class="TIP"><blockquote class="TIP"><p><b>Tip:</b> In the same directory, you will find the files <ttclass="FILENAME">finishsav.m</tt> and <tt class="FILENAME">finishdlg.m</tt>, which letyou save your workspace before quitting. If you use either of them, insert the line aboveimmediately after the <var class="LITERAL">save</var> command.</p></blockquote></div></li><li><p>Create a file <tt class="FILENAME">$MATLAB/bin/finish.sh</tt>, which will contain thefollowing:</p><pre class="PROGRAMLISTING">#!/usr/compat/linux/bin/sh(sleep 5; killall -1 matlab_helper) &#38;exit 0</pre></li><li><p>Make the file executable:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">chmod +x $MATLAB/bin/finish.sh</kbd></pre></li></ol></div></div><div class="SECT2"><h2 class="SECT2"><a id="MATLAB-USING" name="MATLAB-USING">10.5.6 Using <spanclass="TRADEMARK">MATLAB</span></a></h2><p>At this point you are ready to type <tt class="COMMAND">matlab</tt> and start usingit.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="linuxemu-maple.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="linuxemu-oracle.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Installing <spanclass="TRADEMARK">Maple</span>&#8482;</td><td width="34%" align="center" valign="top"><a href="linuxemu.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Installing <spanclass="TRADEMARK">Oracle</span>&reg;</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -