pantz.org banner
Install of Matlab and it's licensing server on Linux
Posted on 10-05-2007 21:08:00 UTC | Updated on 10-05-2007 21:08:00 UTC
Section: /software/matlab/ | Permanent Link

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.

Reddit!

Related stories


RSS Feed RSS feed logo

About


3com

3ware

alsa

alsactl

alsamixer

amd

android

apache

areca

arm

ati

auditd

awk

badblocks

bash

bind

bios

bonnie

cable

carp

cat5

cdrom

cellphone

centos

chart

chrome

chromebook

cifs

cisco

cloudera

comcast

commands

comodo

compiz-fusion

corsair

cpufreq

cpufrequtils

cpuspeed

cron

crontab

crossover

cu

cups

cvs

database

dbus

dd

dd_rescue

ddclient

debian

decimal

dhclient

dhcp

diagnostic

diskexplorer

disks

dkim

dns

dos

dovecot

drac

dsniff

dvdauthor

e-mail

echo

editor

emerald

encryption

ethernet

expect

ext3

ext4

fat32

fedora

fetchmail

fiber

filesystems

firefox

firewall

flac

flexlm

floppy

flowtools

fonts

format

freebsd

ftp

gdm

gmail

gnome

google

gpg

greasemonkey

greylisting

growisofs

grub

hacking

hadoop

harddrive

hba

hex

hfsc

html

html5

http

https

hulu

idl

ie

ilo

intel

ios

iperf

ipmi

iptables

ipv6

irix

javascript

kde

kernel

kickstart

kmail

kprinter

krecord

kubuntu

kvm

lame

ldap

linux

logfile

lp

lpq

lpr

maradns

matlab

memory

mencoder

mhdd

mkinitrd

mkisofs

moinmoin

motherboard

mouse

movemail

mplayer

multitail

mutt

myodbc

mysql

mythtv

nagios

nameserver

netflix

netflow

nginx

nic

ntfs

ntp

nvidia

odbc

openbsd

openntpd

openoffice

openssh

openssl

openvpn

opteron

parted

partimage

patch

perl

pf

pfflowd

pfsync

photorec

php

pop3

pop3s

ports

postfix

power

procmail

proftpd

proxy

pulseaudio

putty

pxe

python

qemu

r-studio

raid

recovery

redhat

router

rpc

rsync

ruby

saltstack

samba

schedule

screen

scsi

seagate

seatools

sed

sendmail

sgi

shell

siw

smtp

snort

solaris

soundcard

sox

spam

spamd

spf

spotify

sql

sqlite

squid

srs

ssh

ssh.com

ssl

su

subnet

subversion

sudo

sun

supermicro

switches

symbols

syslinux

syslog

systemd

systemrescuecd

t1

tcpip

tcpwrappers

telnet

terminal

testdisk

tftp

thttpd

thunderbird

timezone

ting

tls

tools

tr

trac

tuning

tunnel

ubuntu

unbound

vi

vpn

wget

wiki

windows

windowsxp

wireless

wpa_supplicant

x

xauth

xfree86

xfs

xinearama

xmms

youtube

zdump

zeromq

zic

zlib