Restoring an old 2007b install

October 15, 2012

Long ago, I installed 2007b on my machine, and the files are still there in /u1/Mathworks_2007b_64. The question is whether I can get this to run again.

First, I need to install links to matlab and mex in /usr/local/bin

After this, when I type matlab, I get:

/u1/Mathworks_2007b_64/bin/glnxa64/MATLAB: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory
The answer to this (on my Fedora 17 sytem) is:
yum install libXp

After this, it is simply a matter of starting the license manager. I ensure that the file (or a link to it named license.dat) is in the /u1/Mathworks/etc directory, and I type the command:

cd /u1/Mathworks/etc ; ./lmstart
This does whatever it does to get the license manager running in the background, and I am able to start and run matlab. Note that the license manager is unwilling to be run as root.

License Manager issues

For some time I was getting an "error 95" when trying to start matlab, and had to do several things to sort this out:

Installing Matlab 2007b from DVD media

In the old days (before the site license), we bought this on DVD media, and got a license that we get to use forever apparently.

The new sitelicense scheme requires us to update at least every other version (and there are two each year, good old planned obsolescence), so it is nice to have a version that won't suddenly stop running and require an update. Also we set up real time workshop for 2007b for our customized vxworks target, and have no intention of doing this for subsequent matlab versions.

Back in the old days, we had to purchase an individual use copy of the Matlab product on DVD (and still have those somewhere). They shipped DVD's and manuals, which we no longer get with the site license setup. They also told us where to download the latest version in case you didn't want to wait for the mailman. And, perhaps most importantly, they emailed us a license file. Without the license file the DVD and/or downloaded stuff will do you no good. As near as I can tell, the DVD includes every product they sell, and if you buy a new product, they just send you an ammended license file that selectively activates the new product. Pretty slick and convenient actually.

The first step is to make a directory to install it all in. I use something like /u1/Mathworks_2007a_x86_64 and make links to this from /home/Mathworks. Then I tell the rest of the world (including the Mathworks installer) about /home/Mathworks only.

I put the license file into /home/Mathworks as license.dat. Then place the DVD in the drive, cd to wherever the DVD gets mounted and do:

cd /media/MATHWORKS ; ./install
After this you answer some simple questions, tell it the matlab root directory is /home/Mathworks, and let it rip. The DVD contains linux_x86 and linux_x86_64; when I switched from a 32 bit kernel and distribution to a 64 bit, I had to reinstall matlab.

You also must start a license manager. I got fed up with the way they shipped this out and converted their lmgrd scripts (or whatever they call them) into a script I call mathlab and placed it into /etc/rc.d/init.d, so I can stop and start the license manager via service start mathlab and I make this happen automatically when my system boots via chkconfig mathlab on. This worked great until the Fedora gangsters converted to the despised systemd scheme of things.

Systemd and my license manager script

Now that Fedora (and perhaps other linux distributions) are using systemd, it is necessary to migrate my mathlab script from the init.d scheme to the new scheme. What I did was to create a file in /usr/lib/systemd/system that I call matlab-lm.service. It serves to start the license manager on boot, but restarting it or shutting it down must be done by hand. And of course there is more to it than just dropping this new file into /usr/lib/systemd/system, you must also then issue the command:
systemctl enable matlab-lm.service

Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org