Obtaining a new Gurobi license key involves two steps. The first is to create a new license on our Web site. The second is to generate a license key that associates the license on our Web site with your machine. We'll discuss each step in turn:
Creating a new license
The process for creating a new license depends on the license type:
Once a new license is visible under Current, clicking on the License ID will produce a page like the following:
Getting a license key
To obtain a Gurobi license key for your machine, you'll need to run the grbgetkey command on the machine on which you would like to run the Gurobi Optimizer while that machine is connected to the Internet. If you are using a free academic license, your machine must be connected from a recognized academic domain. Note that an Internet connection is not required once you have obtained your license key.
The exact command to run for a specific license is indicated at the bottom of the license page (e.g., grbgetkey 253e22f3-...). We recommend that you use copy-paste to grab the entire grbgetkey command from our Web site. On a Windows system, you can paste the command directly into the Windows Search box (known as the Run box in Windows XP). This is demonstrated in the Windows 7 example shown here:
The grbgetkey program passes identifying information about your machine back to our Web site, and the Web site responds with your license key. Once this exchange has occured, grbgetkey will ask you for the name of the directory in which to store your license key file. You can store this file anywhere, but we recommend that you accept the default location (by simply hitting Enter).
If you are installing a paid license and your computer isn't connected to the Internet, we also offer a manual installation process. You'll find manual installation instructions at the bottom of the license page (by following the link labeled click here for additional instructions).
Where to store your license key file
When you run the Gurobi Optimizer, it will look for the gurobi.lic key file in three different default locations. It will always look in your home directory. In addition, on a Windows system, Gurobi Optimizer 5.0.0 will also look in c:\gurobi500 and c:\gurobi50. On a Linux system, it will also look in /opt/gurobi500 and /opt/gurobi50. On a Mac system, it will also look in /Library/gurobi500 and /Library/gurobi50. Note that these default paths are absolute, so for example Gurobi will look for the license key file in c:\gurobi500, even if the software is installed in d:\gurobi500.
If you would like to store your license in a non-default location, you must set environment variable GRB_LICENSE_FILE to point to the license key file. Important note: the environment variable should point to the license key file itself, not to the directory that contains the file.
On Windows systems, environment variables are created and modified through the Control Panel. In Windows Vista® or Windows 7, searching for Environment Variables in the Control Panel search box will lead you to the appropriate screen. In Windows XP®, the Environment Variables screen is accessed through the Environment Variables button on the Advanced tab of the System screen of the Control Panel. If you wish to put the license key file in a non-default location, you should add a new System variable named GRB_LICENSE_FILE, and set it to the location of your license file.
On Linux systems, if you choose to put the license key file in a non-default location, you should add a line like the following to your .bashrc file:
export GRB_LICENSE_FILE=/usr/home/jones/gurobi.licFor Linux csh shell users, you should add the following to your .cshrc file:
setenv GRB_LICENSE_FILE /usr/home/jones/gurobi.licYou should of course set the variable to point to the actual location of your license key file.
On Mac systems, you can set the optional GRB_LICENSE_FILE environment variable through environment.plist, as explained in Apple's Runtime configuration Guidelines.
Final steps
Most users will be ready to use their licenses at this point. The two exceptions are those using free academic licenses, and those using floating or single-use licenses.
If you are using a free academic license, once grbgetkey has obtained your license key, it will proceed to an academic validation step. This step checks your domain name against our list of known academic domains. If this step doesn't succeed, please refer to Validation troubleshooting for information on how to proceed.
If you are using a floating or single-use license you'll need to set up a Gurobi token server.
Once you have obtained a license key for your machine, you are ready to launch the Gurobi shell. On Windows systems, double-click on the Gurobi icon on your desktop (or type gurobi.bat from a cmd window). On Linux or Mac OS systems, type gurobi.sh in a Terminal window. The shell should produce the following output:
Gurobi Interactive Shell, Version 5.0.0 Copyright (c) 2012, Gurobi Optimization, Inc. Type "help()" for help gurobi>
If you are using a token license, you can also verify that everything is set up correctly using the Gurobi command-line optimizer. The following command...
> gurobi_cl --tokens...will return the state of the token server, as well a list of the clients who are currently using tokens.
You are now ready to use the Gurobi interactive interface.
Some Windows users have reported that they were unable to launch the Gurobi shell after running the installer. You may need to log off and log back in again in order for the environment variable changes made by the installer to take effect.