This is the steps I had to go through to get Matlab 7 Release 14 SP2 running on Linux. The license the person had was a node locked and username locked license. So the hostname and the username on the system have to be the same one that is in the license file. Mathworks the people that make Matlab are very strict on how they allow users to use their software. The licensing server will be run on the host Matlab is running on.
1. Install Matlab from CD-ROM using the installer script provided. Follow the directions in the manual. For our install we are going to install it in /usr/local/matlab[version]r[release#][service pack]. Example of this would be: /usr/local/matlab7r14sp2.
2. Then symlink the install dir to Matlab dir name. So if we upgrade anything later we can just change the symlink.
ln -s /usr/local/matlab7r14sp2 matlab
3. Copy in the license.dat file you recieved from Mathworks. Put it in the "etc" dir in the Matlab installation dir. If your moving the license file to a new workstaion copy it from the old workstation to the new workstations "etc" dir where Matlab was installed. If following the path above the license.dat file would go in /usr/local/matlab/etc/
4. From Matlab CD-ROM root change to the utils/glnx86 dir.
cd utils/glnx86
5. Copy over the files: lmgrd lm_Matlab lmutil to a dir on the host running Matlab. Let's say copy them to /usr/local/bin. These files where the only files in this dir on my cd.
cp lm* /usr/local/bin
6. Create/edit the options file /usr/local/matlab/etc/MLM.opt in the Matlab install dir's "etc" directory.
In this file the installer is supposed to put an INCLUDE line in for each product. The INCLUDE line specifies which user can use the product. Our users name is tom. I beleive the first line is needed by most as it's the product itself but who knows. If multiple users are licensed for the same product, you must create a separate INCLUDE line for each user. Verify that license file includes the correct location of options file. Also, check that the DAEMON line in your license file includes the options file location, options=Matlabroot/etc/MLM.opt, where Matlabroot is your MATLAB installation directory. The example of the MLM.opt file is below.
INCLUDE MATLAB USER tom INCLUDE Signal_Toolbox USER tom INCLUDE Optimization_Toolbox USER tom INCLUDE Curve_Fitting_Toolbox USER tom
7. Now onto the license manager. It's called flexlm and it's made by Macrovision. We copied over the files eariler so now we are going to start it. 2 flexlm deamons listen on local TCP ports to talk to Mathcad. Make sure any firewalls are down or you have punched holes for the following daemons. Restrict all other connections to these ports except for the local machine.
lmgrd - tcp port 27000 MLM - tcp port 33317
8. Start the licensing daemon to see if it complains.
lmgrd -c /usr/local/matlab/etc/license.dat
It will tell you if there are any problems. You can look up error codes on Mathworks support website.
9. If all goes well hit enter to get back to a prompt then you can try to run the command "matlab" if its in your path and see if it run without complaining. If not in your path then its in the Matlab install directory in the "bin" directory. You may have to su if you have a user locked license. As root if we had the username tom that the license was locked to and wanted to see if it worked for tom then we can su to tom like the following.
su tom
Then run Matlab again as tom. If your on a command line only start Matlab with the following command
matlab -nodisplay
10. If Matlab starts with no major errors then exit back to roo and kill the licensing daemon with the following commands.
exit
killall -9 lmgrd
You may also need to kill the process lm_Matlab. Also whatever else you see that Matlab has started.
11. Put the following line in a file that starts at boot. On RedHat Enterprise the /etc/rc.local file is fine. This will start the license server on boot. Mathworks has some decent start/stop scripts for linux on their site if you so wish.
/usr/bin/lmgrd -c /usr/local/matlab/etc/license.dat > /dev/null 2>&1
12. Execute the line you just put in your startup file and see if it starts. If so try to execute matlab one last time and it should start right up if their are no problems. If there is a problem run the above line without the "> /dev/null 2>&1" part to see all of the logs on what the license problem might be.
PS: Some licenses are locked to system hostname and username and ethernet mac address the license was requested for. Upgrading a machine you can give it the same username and same hostname but mac address is a little harder. With linux you can spoof the mac address of the old system to get it working if need be. This can be done with the iptables command. You could also get a new license from Mathworks with a new mac address or hostname. If you do spoof it watch what you do with the old system as you have the potential to have to systems with the same mac addresses on the network. Not good.