MATLAB Answers

How can I change the license server used by MATLAB clients?

311 views (last 30 days)
I have just installed a new Network License Manager, and would like to "retarget" my MATLAB installations to this new server.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Mar 2019
Edited: MathWorks Support Team on 7 Mar 2019
This can be accomplished in 3 ways:
1) Replacing the license files MATLAB uses
2) Setting an environment variable to point to a new server
3) Launching MATLAB using the -c flag
-----Method 1-----
MATLAB clients will have a license file located in $MATLAB\licenses (R2008a or later) or $MATLAB\bin\win32 (windows) or $MATLAB/etc (linux/mac). This file consits of a SERVER line, and a USE_SERVER line. To retarget the client, replace the SERVER line with the new SERVER line from the new manager, save the file, and start MATLAB.
-----Method 2-----
During MATLAB's startup, it checks the enviornment variables "LM_LICENSE_FILE" and "MLM_LICENSE_FILE". To launch MATLAB using a license from a new server, set an environment variable with either of these names to a value using the syntax {port}@{hostname} of the license server, where {port} is the number at the end of the SERVER line, and {hostname} is the resolveable name of the license manager.
For example, if the Network License Manager had a server line that read as follows:
SERVER licenseserver1 001122aabbcc 27000
the environment variable value should be set as
LM_LICENSE_FILE=27000@licenseserver1
-----Method 3-----
When launching MATLAB, you can also force it to use a particular license by using the -c flag. The argument that follows -c can be in the form of a path to a license file, or using the <port>@<hostname> syntax mentioned above. For example:
matlab -c 12345@licenseserver
On Windows machines, you can modify the target field of the MATLAB shortcut as follows for a similar effect:
"C:\Program Files\MATLAB\R2008a\bin\matlab.exe" -c 12345@licenseserver

  0 Comments

Sign in to comment.

More Answers (0)

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by