天天看点

Linux系统下Matlab的安装设置2008-3-14 5:51:00

2008-3-14 5:51:00

测试系统:Everest0.5 / Fedora 8

一、安装

从网上下载的Matlab R14

1、首先需要建立安装目录

[[email protected] ~]$ su

[[email protected] ~]$ mkdir /usr/matlab

2、然后加载光盘映像

[[email protected] wzh]# mount -o loop -t iso9660 /mnt/hda7/soft/MatlabR14Linux/Matlab_R14_Mac.Linux.Unix_CD1.iso

/media/cdrom

3、拷贝license.dat(不同的光盘可能位置不一样)

[[email protected] wzh]# cd /usr/matlab

[[email protected] matlab]# cp /media/cdrom/Matlab.7.R14.License-Mac.OS.X-Unix-

Linux/Matlab.7.R14.License-Mac.OS.X-Unix-Linux/license.dat .

(这个点不可少,拷贝到当前目录)

4、开始安装

[[email protected] matlab]# /media/cdrom/install

5、中盘需要换光盘,另开一个shell按提示载和CD2和CD3直到安装完成

[[email protected] wzh]# umount /media/cdrom

[[email protected] wzh]# mount -o loop -t iso9660 /mnt/hda7/soft/MatlabR14Linux/Matlab_R14_Mac.Linux.Unix_CD2.iso

/media/cdrom

[[email protected] wzh]# umount /media/cdrom

[[email protected] wzh]# mount -o loop -t iso9660 /mnt/hda7/soft/MatlabR14Linux/Matlab_R14_Mac.Linux.Unix_CD3.iso

/media/cdrom

6、重新载入CD1,拷贝并修改license.lic

[[email protected] wzh]# umount /media/cdrom

[[email protected] wzh]# mount -o loop -t iso9660 /mnt/hda7/soft/MatlabR14Linux/Matlab_R14_Mac.Linux.Unix_CD1.iso

/media/cdrom

[[email protected] wzh]# cp /media/cdrom/Matlab.7.R14.License-Mac.OS.X-Unix-Linux/Matlab.7.R14.License-Mac.OS.X-Unix-Linux/license.lic /usr/matlab/etc/

[[email protected] wzh]# kwrite /usr/matlab/etc/license.lic (或gedit /usr/matlab/etc/license.lic )

使用命令得到hostname

[[email protected] matlab]# hostname

localhost.localdomain

将得到的hostname写入license.lic的第一行中, 如下:

SERVER localhost.localdomain ANY 5353

保存文件

到此安装结束,用命令/usr/matlab/bin/matlab即可运行matlab了。

二、设置

1、建立快捷方式

在桌面右键直接建立一个到/usr/matlab/bin/matlab的快捷方式就可以了。也可以建立在任务栏面板上。

2、据说中文环境容易死机,因为我的系统为英文环境,所以以下为摘抄。

第一步,安装完matlab r2007a后,在中文环境中启动时,matlab容易死机,而在英文环境中却能正常工作!这就说明是matlab与中文环境有冲突。

第二步,环境变量的设置:

修改matlab安装目录下bin目录下的matlab启动就可以一劳永逸,具体方法如下:

a、进入matlab安装目录下的bin目录

b、sudo vi matlab

c、在#! /bin/sh的下一行加上 LANG=en_AU.UTF-8 LANG=en_AU.UTF-8 XMODIFIERS=

d、保存退出,直接在终端输入matlab就可以运行了。

3、可能会出现selinux不让安装的问题,设为允许试试,还有一种问题(我没遇到,摘抄)

error while loading shared libraries: libXp.so.6

解决方法是 将CD1中的/update/……省略若干目录……/libmwin.so 文件

拷贝到 /usr/lib 目录,然后更名为 libXp.so.6

4、Support for chinese (摘抄)

su

cd /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/fonts/

mkdir fallback

cd fallback

ln -s /home/max/.fonts/simsun.ttc ./simsun.ttf

5. Support for maple interface(摘抄,没试过)

[最新的matlab7.3版本似乎已经解决了符号运算功能]

export LD_ASSUME_KERNEL=2.4.1

(……)

6、Support for compiling a mex file(摘抄,没试过)

[最新版本的matlab7.3即2006b已经可以使用gcc4.1.0编译mex文件,虽然官方支持的版本为3.4.0-3.4.5]

[在编译mex文件前,执行mex -setup设置编译环境]

I'm trying to compile a Mex file on SuSE linux 10.1, which uses GCC 4.1.0.
The file compiles fine, but when I try to run it I get this error:
/opt/Matlab/bin/glnx86/../../sys/os/glnx86/libgcc_s.so.1: version
`GCC_3.3' not found (required by /usr/lib/libstdc++.so.6).
From the documentation, it appears as though Matlab only supports GCC 3.2.3.
I suspect that my only solution is to download and compile this compiler and
then use it to compile my mex file.If you must use gcc 3.2.3, your best bet is
to first build and install gcc 3.3.6, and then use that to build gcc 3.2.3.
3.1. build and install gcc 3.3.6 first
download gcc-3.3.6.tar.bz2 to /home/max/
cd home/max
tar xjvf gcc-3.3.6.tar.bz2 # $srcdir=/home/max/gcc-3.3.6
mkdir objdir
cd objdir
$srcdir/configure --prefix=/opt/gcc-3.3.6 # or wherever
make bootstrap
su
make install
3.2 and then use gcc 3.3.6 to build gcc 3.2.3
export PATH=/opt/gcc-3.3.6/bin:$PATH
export LD_LIBRARY_PATH=/opt/gcc-3.3.6/lib:$LD_LIBRARY_PATH
mkdir objdir
cd objdir
$srcdir/configure --prefix=/opt/gcc-3.2.3 # or wherever
make bootstrap
su
make install
3.3 now, compile your mex file, before compiling do
export PATH=/opt/gcc-3.2.3/bin:$PATH      

在linux下装matlab遇到的问题

When running the installation, I run across errors such as: cp: cannot stat `/devel/Arel/R14n/cdimages/unix/cdrom1/update/bin/glnxa64/*': No such file or directory Error writing to /tmp/31122tmwinstall The installer is unable to copy files to /tmp. Make sure that /tmp exists, is writable, and has at least 5 megabytes of available space. Solution: In order to install 32-bit MATLAB on a 64-bit Linux machine running Linux, it is necessary to use one of the following workarounds: 1) Download the products from our downloads site at the following URL: http://www.mathworks.com/web_downloads/ Once downloaded, start the installation script as follows: ./install -glnx86 2) If it is necessary to install from CD, run the installer as follows: ./install -glnx86 -nocp If installing products from multiple CD's, it will be necessary to stop the installation process after each CD by clicking the "Skip CD X" button (where X is the next CD number). This process will then need to be repeat for each of the CD's. 3) Copy all 3 CD's into a single directory on your local hard drive and then run the installer with the -glnx86 and -nocp flags. Note some files will be overwritten during this process. Once the installation procedure is complete, the Flexlm License Manager will have to be properly configured. To do this, go to the MATLAB root directory and run the following command: ./install_matlab 4 -glnx86 NOTE: The -glnx86 flag is required for all license manager scripts (lmstart, lmdown, lmstat, etc...) as well as for starting MATLAB.

继续阅读