License Setup

This section deals with the installation of a GAMS license. Information on different license types and licensing in general can be found on our website.

The classic GAMS license consists of six lines of text typically delivered via email. Users need to copy and paste this text into a file in some designated locations on their hard drive so GAMS can find it. In addition to this email-based delivery method, GAMS will increasingly rely on a modern delivery method for licenses. This approach supports new licensing options, such as network licenses, providing greater flexibility and improved resource management capabilities. Introduced in GAMS version 47, this license delivery method will continue to be refined over time. The core of this new method is a 36-character access code to the license. The access code enables users to retrieve their GAMS license from a license server, which provides an eight-line text-based license that again needs to be stored on the user's hard drive.

License Types

GAMS licenses are available in two types, each designed to accommodate a variety of environments and usage patterns. This section provides a detailed explanation of the principal differences between the two license types.

Local Licenses

Local licenses are tailored for individual users or specific machines, making them well-suited for standalone, offline environments. These licenses may include strict usage restrictions, such as limitations on the number of uses, nodes, cores, or users. They are tied to a specific machine through a node identifier that encodes certain system characteristics. Consequently, dynamic environments like Docker containers or virtual machines are unsuitable for local licenses. Once activated, a GAMS system with a local license functions independently of a network connection to a license server, ensuring straightforward and dependable offline access.

Network Licenses

Network licenses are designed for shared use across multiple users or machines with reliable network access, managed centrally via a license server (the server URL and port are specified in the sixth line of the license file). They offer greater flexibility in dynamic environments, as the central license server handles accounting for uses, nodes, cores, users, and other resources. To maintain this flexibility, the GAMS system requires continuous network access to the license server while active, not just at startup.

Network licenses can also be manually checked out for a specified period, during which the checked-out license functions like a local license and does not require access to the license server. This feature is particularly useful when planning to work offline, such as during travel. However, a limitation of this approach is that the license cannot be returned to the server during the checkout period for use on another machine.

Install a License via GAMS Studio

The simplest way to install a license is through GAMS Studio. For detailed instructions, please refer to the GAMS Studio documentation.

Install a License Manually

If using GAMS Studio is not an option, you can install the license manually. If you received the license contents via email, copy all the lines into a new file named gamslice.txt and place this file in a location searched by GAMS. If you received the GAMS license as a 36-character access code, read more below.

Attention
If you install GAMS on macOS using the self-extracting archive, do not store the gamslice.txt in the GAMS system directory. Read more about this here.

Obtaining a License using an Access Code

Installing and activating a license using an access code is done using the command-line utilities gamsgetkey and gamsprobe that are located in the GAMS installation directory.

  1. Navigate to a directory that GAMS searches and where you have write permissions.
  2. Activate your license by running gamsgetkey in the terminal, using the access code as an argument. For example:

    /path/to/GAMS/installation/directory/gamsgetkey xxyyzzxx-yyzz-xxyy-zzxx-yyzzxxyyzzxx -o gamslice.txt

    The output option (-o gamslice.txt) will write the command-line output directly to a file. Alternatively, you can omit this part and manually copy the output to a file.

    Note
    When using the gamsgetkey utility (or the GAMS licensing dialog in GAMS Studio, see above) to activate a license, the access code, along with the node ID, username, number of cores, and available memory, is sent to the GAMS license server once. This information is used to determine the validity and scope of the license. If network communication is not possible, use the gamsprobe utility as described in Obtaining a License without Network Communication.
  3. If not already done, place the gamslice.txt in a location searched by GAMS.

Obtaining a License without Network Communication

For machines that are not connected to the internet, you can probe the node's data and get a license via a machine connected to the internet. Follow these steps:

  1. On the target machine, navigate to a directory where you have write permissions and run gamsprobe to gather necessary device data:

    /path/to/GAMS/installation/directory/gamsprobe -o device_data.json

    The output option (-o device_data.json) will write the command-line output directly to a file. Alternatively, you can omit this part and manually copy the output to a file.

  2. Transfer the device_data.json file and the access code to a machine with network access. There, run gamsgetkey to activate the license:

    /path/to/GAMS/installation/directory/gamsgetkey xxyyzzxx-yyzz-xxyy-zzxx-yyzzxxyyzzxx -i device_data.json -o gamslice.txt

  3. Transfer the gamslice.txt to the target machine and place it in a location searched by GAMS.

Manual Checkout of a Network License

It is possible to temporarily turn a network license into a local license by checking it out for a certain period. The -c (checkout duration) and -r (renew) options allow you to manage this with the command-line utility gamsgetkey. These options provide control over how long a license remains valid and how to extend its duration if needed.

License Checkout

To check out a network license for a specified duration, use the -c or --checkout-duration option (with the duration defined in full hours) along with the -o or --output option (to specify the path for saving the license file). The generated license file will be valid for the designated period.

Example: /path/to/GAMS/installation/directory/gamsgetkey xxyyzzxx-yyzz-xxyy-zzxx-yyzzxxyyzzxx -c 24 -o gamslice.txt

  • -c 24: Specifies a license checkout duration of 24 hours.
  • -o gamslice.txt: Saves the license file to gamslice.txt.

License Extension

To extend the duration of a checked-out license, use the -c or --checkout-duration option (specifying the duration in full hours), the -r or --renew option (providing the path to the current license file), and the -o or --output option (indicating the path to save the updated license file). The current license file is required because it contains a license checkout reference or refresh token. This process updates the license file, ensuring it remains valid for the newly specified duration. A license can only be extended if half of the checkout period has already passed.

Example: /path/to/GAMS/installation/directory/gamsgetkey xxyyzzxx-yyzz-xxyy-zzxx-yyzzxxyyzzxx -c 24 -r gamslice.txt -o gamslice.txt

  • -c 24: Specifies a license checkout duration of another 24 hours.
  • -r gamslice.txt: Reads the license checkout reference/refresh token from gamslice.txt to extend the license.
  • -o gamslice.txt: Saves the updated license file to gamslice.txt.

License Problems

Errors or warnings triggered by a problem with the GAMS license file (gamslice.txt) are reported in stdout. In GAMS Studio these are visible in the system log. Below are some typical error and warning messages and instructions on how to overcome them.

No License File present

Without a license file, GAMS will not work. If you have received a license file or access code, follow the instructions from the previous section. Do not rename the license file or modify its contents. Without a license GAMS will give you an error message like the one below:

*** Error: No license file found.

Note that this error should not normally occur, as a demo license is included with every GAMS installation.

License File Invalid or Corrupted

Running GAMS with an invalid license will give you an error message like the one below:

*** Error: The installed license C:\Users\username\Documents\GAMS\gamslice.txt is invalid.

Do not try to modify your license file, any change will break it. If you received the license via email but no longer have the original file, please contact sales@gams.com and ask for a copy of your license file. Please attach the license file you are currently using. If your GAMS license was provided as a 36-character access code, you can re-install the license using the access code either through GAMS Studio or manually. Note that this must be done on the machine for which the license was issued.

This error also occurs if you are using a license file that was issued for a different platform.

License File expired

If you try to use an old license file with a newer GAMS distribution, you might encounter an error message stating:

*** License file too old for this version of GAMS.
*** Maintenance expired 2840 days ago.
*** More than 60 days since expiration, sorry...
*** Run an older GAMS system or renew the license

Replace that GAMS system with the one you got together with your license file (use the Check for Update utility of GAMS Studio to find out the latest version you can use with the current license; old systems are available on request from sales@gams.com) or update your license to the current version.

No License (for a particular Solver) found

If a solver you are trying to use (or the default solver) is not included in your license file, and the model size exceeds the limits of the free demo or community version, you will get an error stating:

*** No license found
*** To update your license, please contact your distributor.

Check whether the default solvers for a particular problem class are included in the license. Please note that some of the solvers call other solvers as a sub-solver. For example, GAMS/DICOPT requires an NLP and a MIP solver.

Errors

License File too old for this Version of GAMS

The complete message is:

*** License file too old for this version of GAMS.
*** Maintenance expired xx days ago.

If GAMS continues working, you can ignore this warning. However, any forthcoming GAMS distribution will most likely not work, but downgrade to the limits of the free demo system.

License File has expired xx days ago

This warning (without further error messages) indicates that the time limited license (e.g. an evaluation license) will stop working soon.

Node ID in License File in Incorrect Format

The node ID specified in the license file does not follow the required format. This may result from a manual entry error or misconfiguration during license generation. Please verify the node ID format and ensure it complies with the expected structure.

Node ID Does Not Match License Node ID

The node ID of the system does not match the node ID registered in the license file. Ensure that the correct node ID is used when generating the license.

User Name Does Not Match License User Name

The user name of the system running GAMS does not correspond to the one registered in the license. Verify that the correct system user name is associated with the license to resolve this issue.

Number of Cores Exceeds Licensed Number of Cores

The current system configuration uses more CPU cores than permitted by the license. To resolve this, reduce the number of cores used, or obtain a license that supports the higher core count.

Total Memory Exceeds Licensed total Memory

The total memory available on the system exceeds the amount specified in the license. To comply with the licensing agreement, adjust the memory allocation or acquire a license that supports the system's memory capacity.

Network License Without Interprocess Port Not Allowed at this Point

The use of a network license without an interprocess communication port is prohibited at this point. Ensure that the necessary port is configured and available to maintain network license functionality.

Expired Network License

The network license has expired, preventing continued access to the software. To restore functionality, renew the license or apply an updated license file with a valid expiration date.

Additional Solver Limits

GAMS enforces specific model size limits for demo and community licenses.

Demo license:

  • 2000 variables and 2000 constraints for linear models (LP, RMIP, and MIP)
  • 1000 variables and 1000 constraints for all other model types

Community license:

  • 5000 variables and 5000 constraints for linear models (LP, RMIP, and MIP)
  • 2500 variables and 2500 constraints for all other model types

The solvers mentioned below impose stricter or additional limits when running with a demo or community license. We use m for the number constraints, n for the number variables, nd for the number of discrete variables, nz for the number nonzeros, and nlnz for the number nonlinear nonzeros:

  • Antigone, Baron, and LindoGlobal require m≤50, n≤50, and nlnz≤50 with a demo license.
  • Antigone, Baron, and LindoGlobal require m≤300, n≤300, and nlnz≤100 with a community license.
  • Cplex and ODHCPLEX require m≤2000 and n≤2000 with a pro-bono community license.
  • Decis and Knitro require m≤300, n≤300, nd≤50, nz≤2000, and nlnz≤1000 with a demo and community license.
  • Xpress requires m+n≤5000 with a community license.
  • In addition Gurobi requires a license file from the vendor to operate.