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

📄 linuxemu-matlab.html

📁 这是很好的学习嵌入式LINUX的文章
💻 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>安装MATLAB</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手册" href="index.html" /><link rel="UP" title="Linux二进制兼容模式" href="linuxemu.html" /><link rel="PREVIOUS" title="安装Maple" href="linuxemu-maple.html" /><link rel="NEXT" title="安装Oracle" href="linuxemu-oracle.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></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 使用手册</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="linuxemu-maple.html"accesskey="P">后退</a></td><td width="80%" align="center" valign="bottom">章 10. Linux二进制兼容模式</td><td width="10%" align="right" valign="bottom"><a href="linuxemu-oracle.html"accesskey="N">前进</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. 安装<spanclass="TRADEMARK">MATLAB</span>&reg;</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Dan Pelleg.</i> <p>这一节描述在一个 FreeBSD 上安装Linux版本的<b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span>&reg; version 6.5</b>。 它工作的很好,除了<bclass="APPLICATION"><span class="TRADEMARK">Java VirtualMachine</span>&#8482;</b>例外(参考 <ahref="linuxemu-matlab.html#MATLAB-JRE">&#181;&#218; 10.5.3 节</a>)。</p><p>Linux版本的<b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span></b>可以从MathWorks<a href="http://www.mathworks.com"target="_top">http://www.mathworks.com</a>订购。请确定你也得到了许可文件或安装说明。等你成功后,让他们知道你想要一个本地FreeBSD版本。</p><div class="SECT2"><h2 class="SECT2"><a id="AEN13432" name="AEN13432">10.5.1. 安装<spanclass="TRADEMARK">MATLAB</span></a></h2><p>请按照下面的步骤安装<b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span></b>:</p><div class="PROCEDURE"><ol type="1"><li><p>以<tt class="USERNAME">root</tt>身份插入安装CD并挂载上。推荐使用安装脚本,为了启动安装脚本,键入:</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>提示:</b> 安装程序是图形的。如果你得到不能打开显示的错误,可以键入 <ttclass="COMMAND">setenv HOME ~<var class="REPLACEABLE">USER</var></tt>, <varclass="REPLACEABLE">USER</var>是你<span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">su</span>(1)</span>成的用户。</p></blockquote></div></li><li><p>当问<b class="APPLICATION"><span class="TRADEMARK">MATLAB</span></b>的根目录时,键入:<kbd class="USERINPUT">/compat/linux/usr/local/matlab</kbd>。</p><div class="TIP"><blockquote class="TIP"><p><b>提示:</b> 为了下面的安装过程更方便,在shell提示符下键入 <tt class="COMMAND">setMATLAB=/compat/linux/usr/local/matlab</tt></p></blockquote></div></li><li><p>根据获得<b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span></b>许可时的指示来编辑许可文件。</p><div class="TIP"><blockquote class="TIP"><p><b>提示:</b> 你可以用你喜欢的编辑器提前准备这个文件,并在安装程序要你编辑它之前拷贝到<tt class="FILENAME">$MATLAB/license.dat</tt></p></blockquote></div></li><li><p>完成安装过程</p></li></ol></div><p>到这里,你的<b class="APPLICATION"><spanclass="TRADEMARK">MATLAB</span></b>安装已经完成了。 接下来的步骤是让它和你的FreeBSD系统“胶合”在一起。</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN13473" name="AEN13473">10.5.2. 许可管理器的启动</a></h2><div class="PROCEDURE"><ol type="1"><li><p>为许可管理器建立符号链接的脚本:</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>建立启动文件<tt class="FILENAME">/usr/local/etc/rc.d/flexlm.sh</tt>。下面的例子是一个<tt class="FILENAME">$MATLAB/etc/rc.lm.glnx86</tt>的修改版本。变化的是文件的位置,和模拟Linux下许可管理器的启动。</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>重要:</b> 必须使脚本文件可执行:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">chmod +x /usr/local/etc/rc.d/flexlm.sh</kbd></pre><p>你也必须替换<var class="REPLACEABLE">username</var>为机器上的一个用户(不要是<ttclass="USERNAME">root</tt>)。</p></blockquote></div></li><li><p>用命令启动许可管理器:</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. 链接<spanclass="TRADEMARK">Java</span>&#8482;运行时环境</a></h2><p>改变<b class="APPLICATION"><spanclass="TRADEMARK">Java</span>&#8482;</b>运行时环境(JRE),链接到一个可以工作的版本:</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="AEN13513" name="AEN13513">10.5.4. 创建<spanclass="TRADEMARK">MATLAB</span>启动脚本</a></h2><div class="PROCEDURE"><ol type="1"><li><p>把下面的启动脚本放到<tt class="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>然后输入命令<tt class="COMMAND">chmod +x /usr/local/bin/matlab</tt>。</p></li></ol></div><div class="TIP"><blockquote class="TIP"><p><b>提示:</b> 依赖于你的<ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/emulators/linux_base/pkg-descr"><ttclass="FILENAME">emulators/linux_base</tt></a>版本,你在运行这个脚本时可能会出错,为了避免错误,编辑<ttclass="FILENAME">/compat/linux/usr/local/matlab/bin/matlab</tt>, 把这行:</p><pre class="PROGRAMLISTING">if [ `expr "$lscmd" : '.*-&gt;.*'` -ne 0 ]; then</pre><p>(在13.0.1版本是在第410行)改成:</p><pre class="PROGRAMLISTING">if test -L $newbase; then</pre></blockquote></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN13531" name="AEN13531">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>注:</b> The <var class="LITERAL">$MATLAB</var> is literal.</p></blockquote></div><div class="TIP"><blockquote class="TIP"><p><b>提示:</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. 使用<spanclass="TRADEMARK">MATLAB</span></a></h2><p>现在您已经可以键入 <tt class="COMMAND">matlab</tt> 并开始使用它了。</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">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">起点</a></td><td width="33%" align="right" valign="top"><a href="linuxemu-oracle.html"accesskey="N">前进</a></td></tr><tr><td width="33%" align="left" valign="top">安装<spanclass="TRADEMARK">Maple</span>&#8482;</td><td width="34%" align="center" valign="top"><a href="linuxemu.html"accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">安装<spanclass="TRADEMARK">Oracle</span>&reg;</td></tr></table></div></body></html>

⌨️ 快捷键说明

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