天天看點

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、然後加載CD光牒映像

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

/media/cdrom

3、拷貝license.dat(不同的CD光牒可能位置不一樣)

[[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、中盤需要換CD光牒,另開一個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.

繼續閱讀