# Technical Note - MATLAB FlexLM Licensing Issues

## Summary

You may sometimes find that MATLAB tells you that it has run out of licences, or words to that effect and you may then want to try and see who is using the licences in case there's a chance you can pull rank on them. The Matlab documentation will tell you to use an utility called`lmstat`

, however it may not be obvious how you should do that, especially if it is not on the default PATH, so here are some instructions that apply to the School's machines.
## Details

Firstly, be aware that`lmstat`

is part of the `FlexLM/FlexNet`

licensing
product and that it actually just an invocation of a more general utility `lmutil`

,
and you can therefore invoke `"lmstat `"

as `"lmutil lmstat`"

.
Should you be on a machine not covered here, looking for `lmutil`

may be
all you need to do to follow these instructions on that machine.
Secondly, products such as MATLB which use the `FlexLM/FlexNet`

licensing
suite tend to install it below their own product's directory structure.
Thirdly, `lmstat/lmutil`

needs to be able to access whichever licence file is
controlling the product you are using, in this case MATLAB. The licence
file itself may simply be a pointer to an external licence server, as opposed
to an actual licence, and the location of that licence file may be set in the
environment (`$M_LICENSE_FILE`

) or specified directly, however the
principle remains the same.
Fourthly, `FlexLM/FlexNet`

licensing, when done over the network, often
uses just one licence for many products so as to ease administration. This
means that if you simply query the licence server you may get more information
than you know what to do with. Fortunately, `lmutil`

allows you to specify only
specific features within the licence.
Fifthly, these instructions were written when the current version of MATLAB
was `2010a`

, so this version's name appears in the instructions: you may need
to replace that string with whatever version you are using.
Sixthly, throughout the MATLAB product you may see "licence", the noun,
spelt with an "s" as in the verb: this is an American thing.
Seventhly, the output from `lmstat`

shows you the usernames on the machine
where that user is running `MATLAB`

. The licence server controls usage across
VUW, so the usernames you see may not be ECS/MSOR ones.
Finally, yes, there are other ways to do this, including, adding stuff to your PATH,
setting licence file locations in the environment, grep'ing the output, etc, etc.
### somes

MATLAB is installed on the`C:`

drive
`lmutil`

is found as
c:\program files\MATLAB\R2010a\bin\win32\lmutil.exethe licence file is

c:\program files\MATLAB\R2010a\licenses\network.licYou'll need to run

`lmutil`

from within a DOS box, usually initiated by running `CMD.EXE`

Within the DOS box, you should type
C: cd C:\Program Files\MATLAB\R2010a\licenses ..\bin\win32\lmutil.exe lmstat -f matlab -c network.lic

### ward

MATLAB is installed on the`B:`

drive
`lmutil`

is found as
B:\Program Files\MATLAB\R2010a\bin\win32\lmutil.exeThe licence file is

B:\Program Files\MATLAB\R2010a\licences\network.licYou'll need to run

`lmutil`

from within a DOS box, usually initiated by running `CMD.EXE`

Within the DOS box, you should type
B: cd B:\Program Files\MATLAB\R2010a\licenses ..\bin\win32\lmutil.exe lmstat -f matlab -c network.lic

### regent

MATLAB is installed below`/vol/matlab`

`lmstat`

is found as
/vol/matlab/R2010a/etc/lmstatThe

`FlexLM/FlexNet`

utilities know which licence they need to access by default
You should type
/vol/matlab/R2010a/etc/lmstat -f matlab

### debretts

MATLAB is installed below`/vol/matlab`

but I could not find a Solaris version of
the `FlexLM/FlexNet`

utilities for 2010a, so you'll need to use 2009b
`lmstat`

is found as
/vol/matlab/R2009b/etc/sol64/lmstatThe licence file is

/vol/matlab/R2010a/licenses/network.licYou should type

/vol/matlab/R2009b/etc/sol64/lmstat -f matlab -c /vol/matlab/R2010a/licenses/network.lic

### Generic command line

Given that now (Nov 2014) we appear to have a "current" pointer to one of the various MATLAB installtions we maintain you should be able to do the more generic/vol/matlab/current/etc/glnxa64/lmutil lmstat -f matlab -c /vol/matlab/R2013b/licenses/network.lic