Installation Notes for Unix

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 at https://www.youtube.com/watch?v=Mx_tYI3wyP4.

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 transfering 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. Optionally, create the license file gamslice.txt in the GAMS system directory. The license file is nowadays sent via email, with instructions. If no license file is present, GAMS will still function in the demonstration mode but can only solve small problems. Student and demonstration systems do not include a license file. A license file can easily be added later, so if you cannot find a license file, you can safely proceed without one.
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=bdmlp

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

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 add or change your license file if this has changed the set of licensed solvers.

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


Installation of the Windows system under Linux using Wine

The 32-bit Windows version of the GAMS system can be installed and used under 32-bit Wine. However, note that using GAMS for Windows under Wine is neither tested nor officially supported by GAMS. Nevertheless, for experienced Linux users, we here provide some instructions on how to install a Windows GAMS system under Wine.

Many components of the GAMS system, including the IDE and solvers, should work under Wine. When running under Wine on Linux, the GAMS distribution accepts GAMS licenses for Windows, Linux, or generic platforms. See here for a list of known compatibility issues.

We encourage here the use of the 32-bit GAMS system instead of the 64-bit system, as also the 64-bit GAMS distribution includes certain components, including the IDE, as 32-bit version only. Using these 32-bit components with a 64-bit Wine system may not work.

1. Install a 32-bit Wine system and the winetricks tool using the package manager your distribution. If winetricks is not available via the package manager, follow the instructions on http://wiki.winehq.org/winetricks
2. Install additional fonts by executing
winetricks allfonts
3. If you had a pure 64-bit Linux system, then some 32-bit support libraries might be needed to run the 32-bit GAMS system. On a CentOS 7 system, these libraries were installed via
yum install freetype.i686
yum install libgcc.i686
yum install libSM.i686
yum install libXext.i686
4. Download the GAMS distribution for 32-bit Windows (windows_x86_32.exe) from http://www.gams.com/latest
5. Start the GAMS Windows installer by executing the following command from the command line:
wine windows_x86_32.exe
6. You should now be able to run the GAMS IDE by executing gamside.exe via wine. On a system where the WINEPREFIX has not been changed (default: ~/.wine) and with GAMS installed in the default location, the command to start the IDE is
wine ~/.wine/drive_c/GAMS/win32/24.9/gamside.exe