GAMS/LINGO allows users to solve GAMS models using solvers within the LINDO modeling system. The GAMS/LINGO link comes free with any GAMS system. Users must have a licensed LINGO system installed and have the LINGO executable in their path.

To run GAMS/LINGO, just specify the solver as lingo. For example, if we wish to solve the trnsport.gms model, we would run

>> gams trnsport.gms lp=lingo;

As for other GAMS solvers, options can be passed on via solver option files. GAMS/LINGO specific options are described in the section GAMS/LINGO Options.

By default, GAMS/LINGO returns a model status of 14 (no solution) and a solver return status of 1 (normal completion), provided the link is executed normally. This includes the case where the LINGO executable is not found.

Lingo Path

GAMS searches for a LINGO executable using the following hierarchy:

  • Via the options LingoPath and RunLingo within a GAMS/LINGO solver option file.
  • A lingopath.txt file located in the GAMS system directory specifying the path of the LINGO executable.
  • The system path.

For example, GAMS will first search for the LINGO executable within the lingo.opt file, if specified. If not found, it will search within the GAMS system directory for a file called lingopath.txt specifying the LINGO directory. Finally if lingopath.txt is not found, GAMS will try the system path.

If no LINGO exectuable is found, the user will see a message similar to

LINGO Link 0. Jan 26, 2005 LNX.00.NA 21.6 002.000.000.LXI P3PC

--- No LingoPath option or "lingopath.txt" file found
--- System PATH will be used

sh: line 1: runlingo: command not found

The last line is platform dependent but indicates that LINGO was not found, either because it is not installed or because it is not found in the system path.


GAMS/LINGO solver options are passed on through solver option files. If you specify

<modelname>.optfile = 1;

before the SOLVE statement in your GAMS model, GAMS/LINGO will then look for and read an option file with the name lingo.opt (see also The Solver Options File).

Option Description Default
DotLng LINGO input file name lingo.lng
IterLim Minor iteration limit GAMS IterLim
LingoPath Path to LINGO system files
OptCR Relative termination for MIPs and Global Optimization Problems GAMS OptCR
Option Verbatim LINGO options
ResLim Resource limit GAMS ResLim
RunLingo Lingo executable runlingo