Installation Notes for Unix

Table of Contents

Installation

To install GAMS, please follow the steps below as closely as possible. We advise you to read this entire document before beginning the installation procedure. Additionally, a video on how to install GAMS on Linux is available here.

  1. Obtain the GAMS distribution file, which is available from http://www.gams.com/latest, in one large self-extracting zip archive with a _sfx.exe file extension, e.g., linux_x64_64_sfx.exe on a Linux 64bit system. Check that it has the execute permission set. If you are not sure how to do this, just type in the command, e.g., chmod 755 linux_x64_64_sfx.exe.
  2. Choose a location where you want to create the GAMS system directory (the GAMS system directory is the directory where the GAMS system files should reside). At this location the GAMS installer will create a subdirectory with a name that indicates the distribution of GAMS you are installing. For example, if you are installing the 24.3 distribution in /opt/gams, the installer will create the GAMS system directory /opt/gams/gams24.3_linux_x64_64_sfx. If the directory where you want to install GAMS is not below your home directory, you may need to have root privileges on the machine.
  3. Create the directory that should contain the GAMS system directory, for instance /opt/gams. Change to this directory (cd /opt/gams). Make sure pwd returns the name of this directory correctly.
  4. Run the distribution file, either from its current location or after transferring it to the directory that should contain the GAMS system directory. By executing the distribution file, the GAMS distribution should be extracted. For example, if you downloaded the distribution file into your home directory, you might execute the following commands:
    mkdir /opt/gams
    cd /opt/gams
    ~/linux_x64_64_sfx.exe
    
  5. Install a valid GAMS license. More on the license setup can be found here.
  6. Change to the GAMS system directory and run the program ./gamsinst. It will prompt you for default solvers to be used for each class of models. If possible, choose solvers you have licensed since unlicensed solvers will only run in demonstration mode. These solver defaults can be changed or overridden by:

    a. rerunning ./gamsinst and resetting the default values

    b. setting a command line default, e.g., gams trnsport lp=soplex

    c. an option statement in the GAMS model, e.g: option lp=soplex;

  7. Add the GAMS system directory to your path (see below).
  8. To test the installation, log in as a normal user and run a few models from your home directory, but not the GAMS system directory:
    LP:    trnsport (objective value:  153.675)
    NLP:   chenery  (objective value:  1058.9)
    MIP:   bid      (optimal solution: 15210109.512)
    MINLP: procsel  (optimal solution: 1.9231)
    MCP:   scarfmcp (no objective function)
    MPSGE: scarfmge (no objective function)
    
  9. If you move the GAMS system to another directory, remember to rerun ./gamsinst. It is also good practice to rerun ./gamsinst when you change your license file if this has changed the set of licensed solvers.

Access to GAMS

To run GAMS you must be able to execute the GAMS programs located in the GAMS system directory. There are several ways to do this. Remember that the GAMS system directory in the examples below may not correspond to the directory where you have installed your GAMS system.

  1. If you are using the C shell (csh) and its variants you can modify your .cshrc file by adding the line
    set path = ( $path /opt/gams/gams24.3_linux_x64_64_sfx )
    
  2. Those of you using the Bourne (sh) or Korn (ksh) shells and their variants can modify their .profile or .bashrc file by adding the line
    PATH=$PATH:/opt/gams/gams24.3_linux_x64_64_sfx
    
    If neither .profile nor .bashrc exist yet, .profile needs to be created. You should log out and log in again after you have made any changes to your path.
  3. You may prefer to use an alias for the names of the programs instead of modifying the path as described above. C shell users can use the following commands on the command line or in their .cshrc file:
    alias gams /opt/gams/gams24.3_linux_x64_64_sfx/gams
    alias gamslib /opt/gams/gams24.3_linux_x64_64_sfx/gamslib
    
    The correct Bourne or Korn shell syntax (either command line or .profile) is:
    alias gams=/opt/gams/gams24.3_linux_x64_64_sfx/gams
    alias gamslib=/opt/gams/gams24.3_linux_x64_64_sfx/gamslib
    
    Again, you should log out and log in in order to put the alias settings in .cshrc or .profile into effect.
  4. Casual users can always type the absolute path names of the GAMS programs, e.g.:
    /opt/gams/gams24.3_linux_x64_64_sfx/gams trnsport