8 Client setup¶
This section describes setting up client machines.
8.1 With a local license file¶
Default setup
The preferred option is to place the license file mosek.lic
in the directory mosek
in the user’s home directory. That means
$HOME/mosek/mosek.lic
%USERPROFILE%\mosek\mosek.lic
on UNIX systems and Windows, respectively. If no other configuration options are set (see below) this is the default location where MOSEK looks for a license. This works for all types of licenses. If the license file contains a floating license, the client will use the information in that file to find and contact a token server.
Environment variable
Alternatively, the path to the license file may be set by the environment variable MOSEKLM_LICENSE_FILE
, for example:
MOSEKLM_LICENSE_FILE=/home/user/licenses/mosek.lic
MOSEKLM_LICENSE_FILE=c:\users\mylogin\licenses\mosek.lic
Command line options
From the MOSEK command line the path to the license file can be set with the option -l
.
From an API
In the Optimizer API and Fusion API the path to the license file can be set with the method putlicensepath
of the environment or Model, respectively, before first optimization.
8.2 Without a local license file¶
Another method to check out a license from a floating license token server is to set the environment variable MOSEKLM_LICENSE_FILE
in one of the following formats
MOSEKLM_LICENSE_FILE=@hostname
MOSEKLM_LICENSE_FILE=port@hostname
where hostname
is the name of the token server machine and port
is the port on which MOSEKLM is listening. Then the client MOSEK application will contact the server directly and the possible overhead for opening and reading the license file is eliminated. Observe a potential firewall may block access to the token server.
The same format can be used in conjunction with the command line -l
option and in the putlicensepath
method as mentioned in the previous section.
8.3 Testing and debugging¶
In either case the client configuration can be tested by running the program msktestlic
.
If any errors related to licensing appear, then go through the error messages and look for a line containing the path to the license file, for example:
License path: /home/someplace/mosek/mosek.lic
or:
License cannot be located. The default search path is ':/home/someplace/mosek/mosek.lic:'
This is the actual location where this instance of MOSEK was trying to locate the license. If it does not correspond to your expectations then go through the setup again or check that this location contains the correct file.