These directions are for installing the Linux version of MATLAB 7.0 (R14) under Linux Binary Compatibility. I'll assume that you already have the install CDs, and a valid license.
Enabling Linux Binary Compatibility
The first thing we need to do is install linux binary compatibility. It's likely that you have it installed already. You can check with the following command:
pkg_info | grep linux_base
If you have it installed you will see a line similar to this:
linux_base-fc-4_9 Base set of packages needed in Linux mode (for i386/amd64)
If you have it installed please skip the next commands for installing it. Otherwise, run the following to install linux binary compatibility.
cd /usr/ports/emulators/linux_base-fc4
make install clean
Either way add the following line to /etc/rc.conf.
linux_load=YES
In order to start compatibility, use the following command:
kldload linux.ko
That will be run automatically everytime you boot with the line we added to rc.conf.
Now add the following line to /etc/fstab.
linprocfs /compat/linux/proc linprocfs rw 0 0
Now run the following two commands:
kldload linprocfs
mount /compat/linux/proc
From now on that will be done for you automatically.
Installing Matlab
Now we need to install linux-java. First you'll have to download the linux-java binary from Sun. Accept the license agreement, and download the file j2sdk-1_4_2_10-linux-i586.bin or its closest equivalent. Once downloaded, move the file to /usr/ports/distfiles/. Then we can install linux-java:
cd /usr/ports/java/linux-sun-jdk14
make install clean
Now we can move on to installing MATLAB. When you mount the cds you will have to mount them with executable permissions. Or you can follow my method of copying the contents of the cds to disk, and run the install from there. Either way will work, but I'll walk you through doing it the same way that I did.
cd /usr
mkdir mat mat2 mat3
Now copy all of the contents to those respective directories (mat for cd1, mat2 for cd2, etc).
cd /compat/linux/usr/
mkdir local
cd local
mkdir matlab
cd matlab
mkdir etc
cd etc
That was a slight pain. At this point you will want copy your prepared license.dat file to etc.
cp license.dat /compat/linux/usr/local/matlab/etc
Now that the license is prepared we're ready to begin the install.
cd /compat/linux/usr/local/matlab
/compat/linux/bin/sh /usr/mat/install
Modify that command if you are installing directly off of the cd. For the install itself you will want to take the default installation directory (the directory you are currently in). The rest of the installer is self explanatory. I'll assume the install was successful.
cd /compat/linux/usr/local/matlab/etc
ln -s lmboot /usr/local/etc/lmboot_TMW
ln -s lmdown /usr/local/etc/lmdown_TMW
We just made a few links for files that will be referenced in our license manager script. Now we'll get that script going.
cp rc.lm.glnx86 /usr/local/etc/rc.d/flexlm.sh
cd /usr/local/etc/rc.d/
chmod +x flexlm.sh
vi flexlm.sh
That will give us a good template for the file. We just need to edit a few paths. In the end your file should look like this:
#!/bin/sh
case "$1" in
start)
if [ -f /usr/local/etc/lmboot_TMW ]; then
/compat/linux/bin/sh /usr/local/etc/lmboot_TMW -u xaenn && echo 'MATLAB_lmgrd'
fi
;;
stop)
if [ -f /usr/local/etc/lmdown_TMW ]; then
/compat/linux/bin/sh /usr/local/etc/lmdown_TMW > /dev/null 2>&1
fi
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
You will want to change xaenn to the appropriate username for your system.
/usr/local/etc/rc.d/flexlm.sh start
For the first time we need to start it manually, but it will happen at startup automatically from now on. Right now we could use MATLAB, but it's a bit cumbersome to invoke, so let's write a quick script.
vi ~/bin/matlab
Add the following lines:
#!/bin/sh
/compat/linux/bin/sh /compat/linux/usr/local/matlab/bin/matlab
As per the FreeBSD Handbook, depending on your version of emulators/linux_base, you may need to edit the matlab script.
vi /compat/linux/usr/local/matlab/bin/matlab
Edit the following line
if [ `expr "$lscmd" : '.*->.*'` -ne 0 ]; then
and replace it with
if test -L $newbase; then
And one final note, sound support has been hit or miss for me. Sometimes it works, and other times it won't. As an alternative you may use the wavwrite function, and then play the output from mplayer. It's not ideal, but it works. Finally, you'll have something nice like this:
2008年3月31日 星期一
Matlab version 1
Installing Matlab 7.0 and Femlab 3.1
Антон Хохлов orvind at mail.ru
Tue Aug 29 09:52:38 UTC 2006
Previous message: Current unassigned doc problem reports
Next message: Link Request
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
--------------------------------------------------------------------------------
Hi,
I'm a newby in this mailing list so I'm sorry if something is wrong with my letter.
Yesterday I tried to install Matlab 7.0 with the help of the correspondent
FreeBSD handbook's section. I've found out that the section is incomplete
and allows to install and run Matlab with the -nojvm option enabled
which disables X-based gui and some other features.
In addition for my work I need a FEMLAB toolbox for Matlab
(since some time ago it is called COMSOL Multiphysics toolbox),
but I could not find any manual for that anywhere in the internet.
So I wrote a short instruction of how to do that. I hope someone could fix
my english mistakes and append the instruction to FreeBSD handbook.
Installing Matlab 7.0
1. Follow the steps 10.5.1,10.5.2 and 10.5.4 of the FreeBSD handbook (Installing Matlab section). It seems you don't need to perform step 10.5.5 when installing Matlab 7.0. Don't touch $MATLAB/sys/java/jre/glnx86 as it is described in 10.5.3! Since now you can run Matlab in the text mode only (option -nojvm will be enabled automatically when Matlab starting).
2. In order to run Matlab GUI you need to install the following ports (or binary packages):
linux_base, linux-glib2, linux-xorg-libs, linux_dri and linux-openmotif.
3. Delete all files from $MATLAB/sys/os/glnx86 and $MATLAB/sys/opengl/lib, type as root:
ln -s /compat/linux/usr/X11R6/lib/libXm.so.3 $MATLAB/sys/os/glnx86/libXm.so.2
ln -s /compat/linux/usr/X11R6/lib/libGL.so.1 $MATLAB/sys/opengl/lib/glnx86/libGL.so
ln -s /compat/linux/usr/X11R6/lib/libGLU.so.1 $MATLAB/sys/opengl/lib/glnx86/libGLU.so
ln -s $MATLAB/sys/opengl/lib/libMesaGL.so $MATLAB/sys/opengl/lib/glnx86/libGL.so
ln -s $MATLAB/sys/opengl/lib/libMesaGLU.so $MATLAB/sys/opengl/lib/glnx86/libGLU.so
4. Done!
Note, after completing step 3 check that created links point to the existent libraries. If some links are broken, go to your /compat/linux/usr/X11R6/lib folder and fix them by creating symbolic links to your version of libXm.so.*, libGL.so.* and libGLU.so.*
Installing Femlab 3.1
1. Execute Femlab installer with
/compat/linux/bin/sh ./install
or just with
./install
and complete the installation process.
Point to Matlab installation path when asked (if Matlab is needed).
2. Open $FEMLAB/bin/femlab and find the line containing Linux*. Add FreeBSD* there. It's 231st line for me.
Before:
linux*|Linux*)
After:
linux*|Linux*|FreeBSD*)
If you need to run Femlab standalone (without connection to Matlab), you may skip steps 3-4 and go to 5.
3. Fetch java3d-sdk-1.3.1-linux-i386.bin or later version from anywhere. I've installed java/java3d port first and then copied the file from /usr/ports/distfiles. Unpack the file (just run with /bin/sh and accept the agreement), copy contents of created jre/lib folder to $MATLAB/sys/java/jre/glnx86/jre1.5.0/lib.
4. Check that your hostname is correct and that the correspondent line in
/etc/hosts exist, add the line in opposite case.
5. Create Femlab startup script in /usr/local/bin/
#!/bin/sh
/compat/linux/bin/sh $WHERE_FEMLAB_IS_INSTALLED/bin/femlab "$@"
6. Enjoy ;)
Yours,
Anton Khokhlov
Антон Хохлов orvind at mail.ru
Tue Aug 29 09:52:38 UTC 2006
Previous message: Current unassigned doc problem reports
Next message: Link Request
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
--------------------------------------------------------------------------------
Hi,
I'm a newby in this mailing list so I'm sorry if something is wrong with my letter.
Yesterday I tried to install Matlab 7.0 with the help of the correspondent
FreeBSD handbook's section. I've found out that the section is incomplete
and allows to install and run Matlab with the -nojvm option enabled
which disables X-based gui and some other features.
In addition for my work I need a FEMLAB toolbox for Matlab
(since some time ago it is called COMSOL Multiphysics toolbox),
but I could not find any manual for that anywhere in the internet.
So I wrote a short instruction of how to do that. I hope someone could fix
my english mistakes and append the instruction to FreeBSD handbook.
Installing Matlab 7.0
1. Follow the steps 10.5.1,10.5.2 and 10.5.4 of the FreeBSD handbook (Installing Matlab section). It seems you don't need to perform step 10.5.5 when installing Matlab 7.0. Don't touch $MATLAB/sys/java/jre/glnx86 as it is described in 10.5.3! Since now you can run Matlab in the text mode only (option -nojvm will be enabled automatically when Matlab starting).
2. In order to run Matlab GUI you need to install the following ports (or binary packages):
linux_base, linux-glib2, linux-xorg-libs, linux_dri and linux-openmotif.
3. Delete all files from $MATLAB/sys/os/glnx86 and $MATLAB/sys/opengl/lib, type as root:
ln -s /compat/linux/usr/X11R6/lib/libXm.so.3 $MATLAB/sys/os/glnx86/libXm.so.2
ln -s /compat/linux/usr/X11R6/lib/libGL.so.1 $MATLAB/sys/opengl/lib/glnx86/libGL.so
ln -s /compat/linux/usr/X11R6/lib/libGLU.so.1 $MATLAB/sys/opengl/lib/glnx86/libGLU.so
ln -s $MATLAB/sys/opengl/lib/libMesaGL.so $MATLAB/sys/opengl/lib/glnx86/libGL.so
ln -s $MATLAB/sys/opengl/lib/libMesaGLU.so $MATLAB/sys/opengl/lib/glnx86/libGLU.so
4. Done!
Note, after completing step 3 check that created links point to the existent libraries. If some links are broken, go to your /compat/linux/usr/X11R6/lib folder and fix them by creating symbolic links to your version of libXm.so.*, libGL.so.* and libGLU.so.*
Installing Femlab 3.1
1. Execute Femlab installer with
/compat/linux/bin/sh ./install
or just with
./install
and complete the installation process.
Point to Matlab installation path when asked (if Matlab is needed).
2. Open $FEMLAB/bin/femlab and find the line containing Linux*. Add FreeBSD* there. It's 231st line for me.
Before:
linux*|Linux*)
After:
linux*|Linux*|FreeBSD*)
If you need to run Femlab standalone (without connection to Matlab), you may skip steps 3-4 and go to 5.
3. Fetch java3d-sdk-1.3.1-linux-i386.bin or later version from anywhere. I've installed java/java3d port first and then copied the file from /usr/ports/distfiles. Unpack the file (just run with /bin/sh and accept the agreement), copy contents of created jre/lib folder to $MATLAB/sys/java/jre/glnx86/jre1.5.0/lib.
4. Check that your hostname is correct and that the correspondent line in
/etc/hosts exist, add the line in opposite case.
5. Create Femlab startup script in /usr/local/bin/
#!/bin/sh
/compat/linux/bin/sh $WHERE_FEMLAB_IS_INSTALLED/bin/femlab "$@"
6. Enjoy ;)
Yours,
Anton Khokhlov
訂閱:
文章 (Atom)