Table of Contents
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 license file
- LibInclude files
- External Equation libraries
- Extrinsic Function libraries
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
GAMSin$HOME/Library/Preferences($HOMEusually contains the user's home directory)
Here is an example output of gamsinst -listdirs:
Data Directories
These folders get searched on macOS (in the listed order):
- The subfolder
GAMSin$HOME/Library/Application Support($HOMEusually contains the user's home directory) - The subfolder
GAMSin/Library/Application Support - The subfolder
Resourcesnext to the GAMS system directory - The GAMS system directory
Here is an example output of gamsinst -listdirs:
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
GAMSof folders from$XDG_CONFIG_DIRSor the subfolderGAMSin/etc/xdg - The folder
$XDG_CONFIG_HOMEor the subfolderGAMSin$HOME/.config($HOMEusually contains the user's home directory)
Here is an example output of gamsinst -listdirs:
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_HOMEor the subfolderGAMSin$HOME/.local/share($HOMEusually contains the user's home directory) - The subfolder
GAMSof folders from$XDG_DATA_DIRSor the subfolderGAMSin/usr/local/shareand the subfolderGAMSin/usr/share - The GAMS system directory
Here is an example output of gamsinst -listdirs:
Standard Locations on Windows
Configuration Directories
These folders get searched on Windows (in the listed order):
- The GAMS system directory
- The subfolder
GAMSinC:\ProgramData - The subfolder
GAMSinAppData\Localin the User's directory - The subfolder
GAMSinDocumentsin the User's directory
Here is an example output of gamsinst -listdirs:
Data Directories
These folders get searched on Windows (in the listed order):
- The subfolder
GAMSinDocumentsin the User's directory - The subfolder
GAMSinAppData\Roamingin the User's directory - The subfolder
GAMSinC:\ProgramData - The subfolder
datain the GAMS system directory - The subfolder
data\GAMSin the GAMS system directory - The GAMS system directory
Here is an example output of gamsinst -listdirs:
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: