Standard Locations

GAMS looks for specific files in some system-wide and user-specific locations which are independent of the GAMS installation. This allows the user to store these files in one place without the need to adjust anything when moving from one GAMS version to another. These folders are referred to as standard locations and are split into two groups: configuration directories and data directories. Here are some examples of files, which will be found in the data directories (or subfolders of these):

The GAMS configuration file is expected in one of the configuration directories.

The exact location depends on the operating system used and user specific settings. Running gamsinst -listdirs on the command line shows the folders searched explicitly.

Standard Locations on macOS

Configuration Directories

These folders get searched on macOS (in the listed order):

  • The GAMS system directory
  • The subfolder GAMS in $HOME/Library/Preferences ($HOME usually contains the user's home directory)

Here is an example output of gamsinst -listdirs:

Config directories (searched for e.g. gamsconfig.yaml):
/Users/JaneDoe/GAMS32
/Users/JaneDoe/Library/Preferences/GAMS

Data Directories

These folders get searched on macOS (in the listed order):

  • The subfolder GAMS in $HOME/Library/Application Support ($HOME usually contains the user's home directory)
  • The subfolder GAMS in /Library/Application Support
  • The subfolder Resources next to the GAMS system directory
  • The GAMS system directory

Here is an example output of gamsinst -listdirs:

Data directories (searched for e.g. gamslice.txt):
/Users/JaneDoe/Library/Application Support/GAMS
/Library/Application Support/GAMS
/Users/JaneDoe/Resources
/Users/JaneDoe/GAMS32

Standard Locations on Unix

Configuration Directories

On Unix the environment variables XDG_CONFIG_HOME and XDG_CONFIG_DIRS (see XDG Base Directory Specification) influence the search directories. These folders get searched on Unix (in the listed order):

  • The GAMS system directory
  • The subfolder GAMS of folders from $XDG_CONFIG_DIRS or the subfolder GAMS in /etc/xdg
  • The folder $XDG_CONFIG_HOME or the subfolder GAMS in $HOME/.config ($HOME usually contains the user's home directory)

Here is an example output of gamsinst -listdirs:

Config directories (searched for e.g. gamsconfig.yaml):
/home/JohnDoe/GAMS32
/etc/xdg/GAMS
/home/JohnDoe/.config/GAMS

Data Directories

On Unix the environment variables XDG_DATA_HOME and XDG_DATA_DIRS (see XDG Base Directory Specification) influences the search directories. These folders get searched on Unix (in the listed order):

  • The folder $XDG_DATA_HOME or the subfolder GAMS in $HOME/.local/share ($HOME usually contains the user's home directory)
  • The subfolder GAMS of folders from $XDG_DATA_DIRS or the subfolder GAMS in /usr/local/share and the subfolder GAMS in /usr/share
  • The GAMS system directory

Here is an example output of gamsinst -listdirs:

Data directories (searched for e.g. gamslice.txt):
/home/JohnDoe/.local/share/GAMS
/usr/local/share/GAMS
/usr/share/GAMS
/home/JohnDoe/GAMS32

Standard Locations on Windows

Configuration Directories

These folders get searched on Windows (in the listed order):

  • The GAMS system directory
  • The subfolder GAMS in C:\ProgramData
  • The subfolder GAMS in AppData\Local in the User's directory
  • The subfolder GAMS in Documents in the User's directory

Here is an example output of gamsinst -listdirs:

Config directories (searched for e.g. gamsconfig.yaml):
C:\GAMS\32
C:\ProgramData\GAMS
C:\Users\JohnDoe\AppData\Local\GAMS
C:\Users\JohnDoe\Documents\GAMS

Data Directories

These folders get searched on Windows (in the listed order):

  • The subfolder GAMS in Documents in the User's directory
  • The subfolder GAMS in AppData\Roaming in the User's directory
  • The subfolder GAMS in C:\ProgramData
  • The subfolder data in the GAMS system directory
  • The subfolder data\GAMS in the GAMS system directory
  • The GAMS system directory

Here is an example output of gamsinst -listdirs:

Data directories (searched for e.g. gamslice.txt):
C:\Users\JohnDoe\Documents\GAMS
C:\Users\JohnDoe\AppData\Roaming\GAMS
C:\ProgramData\GAMS
C:\GAMS\32\data
C:\GAMS\32\data\GAMS
C:\GAMS\32
GamsWorkspace data

Note: When running as a service, the "User's directory" mentioned above is not C:\Users\UserName but resolves to something like C:\Windows\system32\config\systemprofile. So the above output could look like this:

Data directories (searched for e.g. gamslice.txt):
C:\Windows\system32\config\systemprofile\Documents\GAMS
C:\Windows\system32\config\systemprofile\AppData\Roaming\GAMS
C:\ProgramData\GAMS
C:\GAMS\32\data
C:\GAMS\32\data\GAMS
C:\GAMS\32