To provide license mobility, MathWorks® supports FlexNet® license borrowing. This capability lets you use MathWorks products on computers that do not have a continuous connection to the license server. After you borrow a license, you can disconnect your system from the network and continue to use the products you have checked out until the borrow period expires. You can also return a borrowed license early.
The following limitations apply to license borrowing:
Academic licenses, including Concurrent licenses, cannot use license borrowing.
Commercial Concurrent and Network Named User licenses can use license borrowing.
The maximum borrow period is 30 days (720 hours).
MathWorks products must be installed on client systems.
MathWorks tries to preserve licensing backward compatibility between releases. For example, you can run R2014b products with a R2016b License File.
Borrowed licenses are not compatible with Release 12 and earlier releases. You can run Release 13 products with a borrow-enabled license, however, using the borrowing capability is not supported.
The following table sums up the interoperability of different releases with borrow-enabled licenses.
Release Family | Run MATLAB® | Borrow Licenses |
---|---|---|
R14 (and later) | Yes | Yes |
R13 | Yes | Not supported |
R12 (and earlier) | No | No |
You must be an Administrator of the license to enable license borrowing.
Request a License File from MathWorks that
includes the license borrowing capability. To request a license, go
to the MathWorks website at www.mathworks.com
,
and click Support. On the support page,
click Contact support.
In these License Files, the INCREMENT
lines
for products include the keyword BORROW=720
, where 720
is
the maximum number of hours in the borrow period (you cannot change
this value). For example:
INCREMENT MATLAB MLM 17 01-jan-0000 5 52FCH63184G5 BORROW=720 \ DUP_GROUP=UH SN=220668
The maximum borrow period of 720 hours is equal to 30 days.
On your license server, stop the license manager.
On your license server, copy the SERVER
and DAEMON
lines
from the existing License File, matlabroot/etc/license.dat
,
where matlabroot
represents
your MATLAB installation folder. For example, here are the SERVER
and DAEMON
lines
from a License File:
SERVER mysystem 0012110gbc86 27000 DAEMON MLM C:\Program Files\MATLAB\R2016b\etc\win64\MLM.exe
Paste the SERVER
and DAEMON
lines
that you copied from your existing License File at the top of the
new License File that includes the license borrowing capability.
On your license server, replace the existing License File with the new License File.
Restart the license manager.
Use an options file to control license borrowing behavior. Use FlexNet tools to monitor which licenses are borrowed.
You can control various aspects of license borrowing behavior using a FlexNet options file. An options file is a text file that contains option statements. Each option statement begins with a keyword that identifies the option. The following table lists the options you use to control aspects of license borrowing. For more information about these options, see the FlexNet End User’s Guide. To see an example of an options file, see Example: Exclude a User from Borrowing a License.
Task | FlexNet Option to Use |
---|---|
Reserve a specific number of licenses that cannot be borrowed. | Use the For example, to make sure that three MATLAB licenses can never be borrowed, use this syntax: BORROW_LOWWATER
matlab 3 |
Specify which users can borrow licenses for a particular product. | Use the For example, to allow the user Fred to borrow a license for the Image Processing Toolbox™, use this syntax: INCLUDE_BORROW image_toolbox
USER fred Note: When you specify that a particular user can borrow licenses, you exclude all other users. |
Specify which users cannot borrow licenses for a particular product. | Use the For example, to prevent the user Donna from borrowing a license for the Image Processing Toolbox, use this syntax: EXCLUDE_BORROW image_toolbox
USER donna |
Specify the maximum amount of time a user can borrow a license. | Use the For example, to limit users of the Image Processing Toolbox to a three day borrow period, use this syntax: MAX_BORROW_HOURS
image_toolbox 72 The borrow period you specify must be less than 30 days, which is the borrow period specified in borrow-enabled licenses from MathWorks. |
To illustrate using an options file to control license borrowing behavior, this example uses an options file to exclude a user from borrowing a license for a specific product:
Create the options file.
An options file is a text file that contains options statements. Using any text editor, create a file that contains the following line. You can give the options file any name and store it in any convenient folder.
EXCLUDE_BORROW simulink USER fred
Specify the name of the options file on the DAEMON
line
in your License File.
On your license server, use any simple text editor to edit your
License File, adding the options=
keyword to the DAEMON
line,
as follows. Be sure to use the line continuation character (\) if
the DAEMON
line extends beyond a single line.
DAEMON MLM C:\Program Files\MATLAB\R2016b\etc\win64\MLM.exe \ options=C:\myborrowoptions.opt
Start (or restart) the license manager so that it processes the options file.
After setting up this options file, test it by logging in as the user Fred. Start MATLAB and try to borrow a license for Simulink®. You can do this using the license command at the MATLAB prompt, as follows.
license checkout simulink
Your attempt to borrow a license for Simulink as the user Fred should fail, displaying the following message.
License Manager Error -38. User/host on EXCLUDE list for feature Feature: simulink License path: C:\Program Files\MATLAB\bin\win64\license.dat; C:\Program Files\MATLAB\bin\win64\*.lic
Flexera Software, Inc, the makers of FlexNet, provides
tools that you can use to monitor the status of borrowed licenses
in your network configuration. You can use the LMTOOLS application
or the lmstat
command.
Use the LMTOOLS Application on Windows Systems
Log in to your license server.
Navigate to the
folder,
where matlabroot
\etc\$ARCH
represents
the name of your MATLAB installation and matlabroot
$ARCH
represents
a platform-specific folder.
Start the LMTOOLS application by double-clicking the lmtools.exe
executable
file.
Select the Server Status tab in the LMTOOLS dialog box.
Click the Perform Status Enquiry button.
LMTOOLS displays the status information in the output window. In the
status information, each entry in the list for a product shows the
total number of licenses for the product and tells how many licenses
are currently checked out. For borrowed licenses, the entry for the
product includes the keyword (linger:XXX
), where XXX
specifies
the borrow period in seconds.
----------- Status ------------ Flexible License Manager status on Wed 10/5/2016 10:04 [Detecting lmgrd processes...] License server status: 27000@myserver License file(s) on myserver: C:\Program Files\MATLAB\R2016b\etc\license.dat: myserver: license server UP (MASTER) v11.9 Vendor daemon status (on myserver): MLM: UP v11.9 Feature usage info: Users of TMW_Archive: (Uncounted, node-locked) Users of MATLAB: (Total of 5 licenses issued; Total of 1 license in use) "MATLAB" v14, vendor: MLM floating license myserver myserver (v14) (myserver/27000 101), start Wed 10/5 14:37 (linger: 121500) Users of SIMULINK: (Total of 5 licenses issued; Total of 0 licenses in use) Users of Control_Toolbox: (Total of 5 licenses issued; Total of 1 license in use) "Control_Toolbox" v14, vendor: MLM floating license anyuser myserver myserver (v14) (myserver/27000 201), start Wed 10/5 14:37 (linger: 121500)
Use the lmstat utility on Windows Systems
Log in to your license server and open a DOS command
window. One way to open the DOS command window is to select the Run option
from the Start menu, type cmd
in
the text entry field, and then click OK.
Navigate to the
folder,
where matlabroot
\etc\$ARCH
represents
the name of your MATLAB installation and matlabroot
$ARCH
represents
a platform-specific folder.
Run the lmutil
command specifying lmstat
as
an argument. (On Windows® systems, FlexNet packages all its
license management utilities into one program, lmutil
.)
The following example uses the -a
option
to display all the information returned by lmstat
.
Note that you must also use the -c
option to specify
the name of your License File. For more information about lmstat
,
see the FlexNet End User’s Guide.
lmutil lmstat -a -c "C:\Program Files\MATLAB\R2016b\etc\license.dat"
In the status information returned by lmstat
,
each entry in the list for a product shows the total number of licenses
for the product and tells how many licenses are currently checked
out. For borrowed licenses, the entry for the product includes the
keyword (linger:XXX
), where XXX
specifies
the borrow period in seconds.
lmutil - Copyright (c) 1989-2010 by Flexera Software, Inc. All Rights Reserved. Flexible License Manager status on Wed 10/5/2016 10:04 [Detecting lmgrd processes...] License server status: 27000@myserver License file(s) on myserver: C:\Program Files\MATLAB\R2016b\etc\license.dat: myserver: license server UP (MASTER) v11.99 Vendor daemon status (on myserver): MLM: UP v11.9 Feature usage info: Users of TMW_Archive: (Uncounted, node-locked) Users of MATLAB: (Total of 5 licenses issued; Total of 1 license in use) "MATLAB" v14, vendor: MLM floating license myserver myserver (v14) (myserver/27000 101), start Wed 10/5 14:37 (linger: 121500) Users of SIMULINK: (Total of 5 licenses issued; Total of 0 licenses in use) Users of Control_Toolbox: (Total of 5 licenses issued; Total of 1 license in use) "Control_Toolbox" v14, vendor: MLM floating license anyuser myserver myserver (v14) (myserver/27000 201), start Wed 10/5 14:37 (linger: 121500)
If the license status information contains entries for the MATLAB Runtime, this does not necessarily mean that an end user has borrowed a license for this product. MATLAB Runtime uses the license borrowing capability. To determine if a user has borrowed a license for the MATLAB Runtime, check the expiration date specified in the listing and compare it to the expiration for licenses that you know an end user borrowed.
Use lmstat on Linux Systems
Log in to your license server.
Navigate to the
directory,
where matlabroot
/etcmatlabroot
is your MATLAB installation
folder.
Run the lmstat
utility.
lmstat -a -c /usr/local/MATLAB/R2016b/etc/license.dat
Ensure that the client system has a network connection to the license server.
To turn on the menu option for Borrow Products in the Licensing menu:
On the client system, start MATLAB and enter this command:
matlab.internal.licensing.enableBorrowUI(true)
After you turn on the menu option for License Borrowing the first time, it remains available any time you start MATLAB.
Restart MATLAB.
Locate the Borrow Products option in the Licensing menu.
On the Home tab, in the Resources section, click Help.
Under Licensing, look for Borrow Products.
To turn off the menu option for Borrow Products in the Licensing menu:
On the client system, start MATLAB and enter this command:
matlab.internal.licensing.enableBorrowUI(false)
To borrow licenses by product name:
Start MATLAB.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Borrow selected products by choosing from a list. The dialog box displays the borrow period option, a list of all the licenses that are available, and the Borrow button.
Specify the borrow period: from 1 day (default) to 30 days.
Click the check box next to each product that you want to borrow.
Click Borrow.
Disconnect your computer from the network, and continue using the borrowed products until the borrow period expires. You can return borrowed licenses early.
To borrow product licenses automatically:
Start MATLAB.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Borrow products automatically as you work with them. The dialog box changes to include the borrow period option and the Turn On Borrowing button.
Specify the borrow period: from 1 day (default) to 30 days.
Click Turn On Borrowing.
Work in MATLAB as you would normally, performing the tasks you want to perform when you are disconnected from the network. As you use products, MATLAB borrows the licenses for them automatically. When you have borrowed licenses for all the products that you want to use, click Turn Off Borrowing.
Disconnect your computer from the network and continue using the borrowed products until the borrow period expires. If you want to return borrowed licenses early, see Return Borrowed Licenses Early.
To return a borrowed license early:
Connect your computer to your network.
On the Home tab, in the Resources section, click Help.
Under Licensing, click Borrow Products.
Select Return borrowed products early. The dialog box displays a list of currently borrowed products.
Specify the product licenses you want to return early. By default, all borrowed product licenses are selected. Deselect any products you do not want to return.
Click Return.
You cannot borrow licenses and then return them in the same MATLAB session. You must quit MATLAB and restart it before you can return the licenses.