User Tools

Site Tools


solver:how_do_i_get_set_up_to_run_with_a_gams_gurobi-link_license

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
solver:how_do_i_get_set_up_to_run_with_a_gams_gurobi-link_license [2019/04/18 08:29]
Frederik Fiand
— (current)
Line 1: Line 1:
-====== How do I get set up to run with a GAMS/​Gurobi-Link license ====== 
- 
-A GAMS/​Gurobi-Link connects the GAMS Base Module to the Gurobi solver, but does not include a license for the solver. The Gurobi license needs to be purchased/​requested directly from Gurobi. 
- 
-There are two ways to solve GAMS models with Gurobi. 
-  - The "​full"​ **GAMS/​Gurobi-Link**,​ which requires two licenses: 
-     - A GAMS license with components GAMS/​GUROBI-Link and GAMS/​BASE ​ (to generate models beyond the demo limits) 
-     - A Gurobi license (you need to get directly from Gurobi) 
-  - The "bare bone" **OSIGUROBI** link which lacks a lot of functionality compared to the full GAMS/​Gurobi-Link. Using OSIGUROBI does **not** require a GAMS/​GUROBI-Link license. 
- 
-If you attempt to use the GAMS/Gurobi solver with a link license and you haven'​t set up the Gurobi portion of the licensing, you will get a licensing error with a message describing the problem. For example, with the 64-bit GAMS distribution 24.7.0 I get the following log output when attempting to solve the rotdk model from the GAMS Model Library: ​ 
- 
-==== GAMS/​OsiGurobi (missing license) ==== 
-<​code>​ 
-... 
---- Executing OSIGUROBI: elapsed 0:00:00.041 
- 
-OSI GUROBI ​      ​24.7.0 r56449 BETA Released ​ 7Mar16 WEI x86 64bit/MS Windows ​ 
- 
-OsiGurobi (Osi library 0.107, GUROBI library 6.5.1) 
-Osi link written by S. Vigerske. Osi is part of COIN-OR. 
- 
-Failed to create Gurobi environment. Missing license. 
-... 
-</​code>​ 
- 
-==== GAMS/Gurobi (missing license) ==== 
-<​code>​ 
-... 
---- Executing GUROBI: elapsed 0:00:00.043 
- 
-Gurobi ​          ​24.7.0 r56449 BETA Released ​ 7Mar16 WEI x86 64bit/MS Windows ​ 
- 
-Gurobi link license. 
-*** Cannot initialize Gurobi environment. 
-*** Could be a missing or invalid license. (status=10009|10009) 
-... 
-</​code>​ 
- 
- 
-==== Setting up the GAMS/​Gurobi-Link license ==== 
- 
-To make the GAMS/​Gurobi-Link work you do not need to download or install the Gurobi software but only your Gurobi license. GAMS will use it's own Gurobi DLL/shared library, so **the Gurobi license has to be valid for the Gurobi version GAMS uses**. 
-You can download your Gurobi license from www.gurobi.com. Log in to your Gurobi account and go to Download --> Licenses --> your GUROBI license. ​ 
- 
-{{ :​solver:​download_gurobi_license.png?​nolink |}} 
- 
-Now click on the license you want to download, enter the required information and click on "Get License Details"​. The license detail page opens, copy the ''​grbgetkey'' ​ command and paste it to the Start/Run menu (Windows only) or a command/​terminal prompt (any system). Make sure that you add your GAMS System Directory which contains ''​grbgetkey''​ to the path variable in advance. Alternatively,​ you can also open a command prompt window from the GAMS IDE using the button in the upper right corner. After running ''​grbgetkey''​ you will be asked where to save your gurobi license. Choose a location e.g. C:​\tmp\licenses. 
- 
-{{ :​solver:​shell_grbgetkey.png?​nolink |}} 
- 
-Note that to install a license key automatically,​ the ''​grbgetkey''​ program needs to be able to communicate with the Gurobi website. It may fail if the computer: 
-  * has no Internet connection 
-  * has restricted access due to a firewall 
-  * uses a proxy server 
-In that case the ''​grbprobe''​ command may help. It retrieves the required hardware information. However, that information needs to submitted to the Gurobi website afterwards to be able to download the gurobi.lic file. 
- 
-{{ :​solver:​grbprobe_info_upload.png?​nolink |}} 
- 
-Once you have saved your gurobi.lic file the GRB_LICENSE_FILE environment variable needs to be set. This can be done in a number of ways (search the Internet for “how to set environment variables” plus your operating system). Here I use the command window on Windows to //​temporarily//​ set the environment variable: ​ 
- 
-<​code>​ 
-c:\tmp> set GRB_LICENSE_FILE=c:​\tmp\licenses\gurobi.lic 
-</​code>​ 
- 
-After setting the environment variable you will see GAMS/​OsiGurobi and GAMS/Gurobi with a link license solve the problem rotdk: 
- 
-==== GAMS/​OsiGurobi ==== 
-<​code>​ 
-... 
---- Executing OSIGUROBI: elapsed 0:00:00.042 
- 
-OSI GUROBI ​      ​24.7.0 r56449 BETA Released ​ 7Mar16 WEI x86 64bit/MS Windows ​ 
- 
-OsiGurobi (Osi library 0.107, GUROBI library 6.5.1) 
-Osi link written by S. Vigerske. Osi is part of COIN-OR. 
- 
-Optimize a model with 12012 rows, 1132 columns and 24143 nonzeros 
-... 
-</​code>​ 
- 
-==== GAMS/Gurobi ==== 
-<​code>​ 
-... 
---- Executing GUROBI: elapsed 0:00:00.042 
- 
-Gurobi ​          ​24.7.0 r56449 BETA Released ​ 7Mar16 WEI x86 64bit/MS Windows ​ 
- 
-Gurobi link license. 
-Gurobi library version 6.5.1 
-Space for names approximately 0.28 Mb 
-Use option 'names no' to turn use of names off 
-Starting Gurobi... 
-Optimize a model with 12012 rows, 1132 columns and 24143 nonzeros 
-... 
-</​code>​ 
  
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY solver/how_do_i_get_set_up_to_run_with_a_gams_gurobi-link_license.1555568951.txt.gz · Last modified: 2019/04/18 08:29 by Frederik Fiand