Installation Notes for Mac OS X

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. Furthermore, we recommend to use the DMG installer for Mac OS X because it includes the GAMS Studio and it integrates GAMS into Mac OS X, e.g. it is possible to open the GAMS Studio and GAMS Terminal via Launchpad.

Two installation procedures are available for GAMS on Mac OS X:

# Installation using the DMG installer (GAMS30.1.0.dmg)

3. If the mounted device does not open automatically, open it manually by double clicking on the device.
4. Drag the GAMS icon onto the Applications folder in order to copy the files to your Applications.
5. Before installing a license file, open the GAMS Terminal.
Attention
Please note that you must not copy the license file to the system directory before opening the GAMS Terminal. This would invalidate the code signature and cause Gatekeeper to reject the bundle!
Now, to install a license file, either manually create the license file gamslice.txt in the GAMS system directory (Resources/sysdir) or open GAMS Studio and use the About GAMS dialog. The license file is nowadays sent via email, with instructions. You can also request a demo license from http://www.gams.com/download.
6. In order to test the GAMS installation with GAMS Studio open the Launchpad and click the GAMS Studio icon to open the application. Alternatively, go to Applications and open the GAMS Studio application found in the GAMS installation directory. Open the Model Library Explorer and open the TRNSPORT model (sequence number 001). Execute the model and review the content of the process log, which shall be similar to the output of the GAMS Terminal application listed below in bullet point 7.
7. In order to test the GAMS installation without using GAMS Studio open the Launchpad and click the GAMS Terminal icon to open the application. Alternatively, go to Applications and open the GAMS Terminal application found in the GAMS installation directory. This small application opens a new terminal, adds the GAMS system directory to the PATH environment variable, and changes the current directory to the home directory. Execute the following commands to see if everything works as expected:

gamslib trnsport
gams trnsport


The output should be similar to this:

--- Job trnsport Start 06/26/14 11:24:56 24.3.1 r46409 DEX-DEG Mac x86_64/Darwin
--- Starting compilation
--- trnsport.gms(69) 3 Mb
--- Starting execution: elapsed 0:00:00.024
--- trnsport.gms(45) 4 Mb
--- Generating LP model transport
--- trnsport.gms(66) 4 Mb
---   6 rows  7 columns  19 non-zeroes
--- Executing CPLEX: elapsed 0:00:00.114

IBM ILOG CPLEX   24.3.1 ... DEG Mac x86_64/Darwin
Cplex 12.6.0.0

Starting Cplex...
Space for names approximately 0.00 Mb
Use option 'names no' to turn use of names off
Tried aggregator 1 time.
LP Presolve eliminated 1 rows and 1 columns.
Reduced LP has 5 rows, 6 columns, and 12 nonzeros.
Presolve time = 0.02 sec. (0.00 ticks)

Iteration      Dual Objective            In Variable           Out Variable
1              73.125000    x(seattle.new-york) demand(new-york) slack
2             119.025000     x(seattle.chicago)  demand(chicago) slack
3             153.675000    x(san-diego.topeka)   demand(topeka) slack
4             153.675000  x(san-diego.new-york)  supply(seattle) slack
LP status(1): optimal
Cplex Time: 0.03sec (det. 0.01 ticks)

Optimal solution found.
Objective :         153.675000

--- Restarting execution
--- trnsport.gms(66) 2 Mb
--- Reading solution for model transport
--- trnsport.gms(68) 3 Mb
*** Status: Normal completion
--- Job trnsport.gms Stop 06/26/14 11:24:57 elapsed 0:00:00.487


# Installation using the self-extracting archive (osx_x64_64_sfx.exe)

1. Obtain the GAMS distribution file, which is available from http://www.gams.com/download, in one large self-extracting zip archive with a _sfx.exe file extension, e.g., osx_x64_64_sfx.exe. Check that it has the execute permission set. If you are not sure how to do this, just type in the command chmod 755 osx_x64_64_sfx.exe .
Attention
The common way to install GAMS on a Mac is the DMG installer. When you try to run the sfx installer (e.g. for unattended installation) under macOS 10.15 (Catalina) or newer, the installer and several related files will be tagged with the com.apple.quarantine flag. There are different solutions to this problem:
• The flag can be removed by the following command:
xattr -rd com.apple.quarantine osx_x64_64_sfx.exe

curl https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0/macosx/osx_x64_64_sfx.exe -o osx_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 /Applications/GAMS, the installer will create the GAMS system directory /Applications/GAMS/gams24.3_osx_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 /Applications/GAMS. Change to this directory (cd /Applications/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 /Applications/GAMS
cd    /Applications/GAMS
~/osx_x64_64_sfx.exe

5. Create the license file gamslice.txt in the GAMS system directory. The license file is nowadays sent via email, with instructions. You can also request a demo license from http://www.gams.com/download.
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 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 second of the two lines given below:
set path = (/your/previous/path/setting )
set path = ( $path /Applications/GAMS/gams24.3_osx_x64_64_sfx ) # new  2. Those of you using the Bourne (sh) or Korn (ksh) shells and their variants can modify their .profile file by adding the second of the three lines below: PATH=/your/previous/path/setting PATH=$PATH:/Applications/GAMS/gams24.3_osx_x64_64_sfx  # new
export PATH

If the .profile file does not exist yet, it 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 /Applications/GAMS/gams24.3_osx_x64_64_sfx/gams
alias gamslib /Applications/GAMS/gams24.3_osx_x64_64_sfx/gamslib

The correct Bourne or Korn shell syntax (either command line or .profile) is:
alias gams=/Applications/GAMS/gams24.3_osx_x64_64_sfx/gams
alias gamslib=/Applications/GAMS/gams24.3_osx_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.:
/Applications/GAMS/gams24.3_osx_x64_64_sfx/gams trnsport


## Example

The following shows the log of a session, where a user downloads a GAMS 24.3.1 system and installs it under Applications/GAMS/gams24.3_osx_x64_64_sfx. It is assumed that a GAMS license file has been stored as /Users/doe/gamslice.txt.

doe@mac:/Users/doe$curl -L -k -O \ http://d37drm4t2jghv5.cloudfront.net/distributions/24.3.1/macosx/osx_x64_64_sfx.exe % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 148M 100 148M 0 0 4374k 0 0:00:34 0:00:34 --:--:-- 5906k  doe@mac:/Users/doe$ chmod 755 osx_x64_64_sfx.exe

doe@mac:/Users/doe$cd /Applications/GAMS  doe@mac:/Applications/GAMS$ ~/osx_x64_64_sfx.exe
UnZipSFX 5.52 of 28 February 2005, by Info-ZIP (http://www.info-zip.org).
creating: gams24.3_osx_x64_64_sfx/
inflating: gams24.3_osx_x64_64_sfx/sp2full.m
inflating: gams24.3_osx_x64_64_sfx/optpathnlp.def
inflating: gams24.3_osx_x64_64_sfx/hexdump
inflating: gams24.3_osx_x64_64_sfx/datalib
inflating: gams24.3_osx_x64_64_sfx/empsyntax.txt
inflating: gams24.3_osx_x64_64_sfx/optlindoglobal.html
...
inflating: gams24.3_osx_x64_64_sfx/apifiles/CSharp/DomainChecking/DomainChecking.cs
inflating: gams24.3_osx_x64_64_sfx/apifiles/CSharp/DomainChecking/DomainChecking.csproj
inflating: gams24.3_osx_x64_64_sfx/apifiles/CSharp/xp_example2.cs
inflating: gams24.3_osx_x64_64_sfx/optdicopt.html

doe@mac:/Applications/GAMS$cd gams24.3_osx_x64_64_sfx doe@mac:/Applications/GAMS/gams24.3_osx_x64_64_sfx$cp ~/gamslice.txt .
doe@mac:/Applications/GAMS/gams24.3_osx_x64_64_sfx$./gamsinst ----------------------------------------------------- gamsinst run on Wed Jun 25 19:25:29 2014 GAMS sysdir is "/Applications/GAMS/gams24.3_osx_x64_64_sfx" LP (Linear Programming) models can be solved by: 1. BDMLP (demo or student license) 2. CBC (demo or student license) 3. CONOPT (demo or student license) 4. CPLEX (demo or student license) 5. GUROBI (demo or student license) 6. IPOPT (demo or student license) 7. IPOPTH (demo or student license) ... Installed defaults: LP: CPLEX MIP: CPLEX RMIP: CPLEX NLP: CONOPT MCP: PATH MPEC: NLPEC RMPEC: NLPEC CNS: CONOPT DNLP: CONOPT RMINLP: CONOPT MINLP: DICOPT QCP: CONOPT MIQCP: SBB RMIQCP: CONOPT EMP: JAMS We are now prepared to set read and execute permissions on the GAMS system files. If you are not sure which option to choose, we recommend option 3. You can set read (and execute) permission for: 1. user only. 2. user and group. 3. user, group, and world. Enter your choice now  3  The files "gams", "gamslib", etc., are now executable. You can run these commands in a number of ways: 1. Call them using an absolute path (i.e. /Applications/GAMS/gams24.3_osx_x64_64_sfx/gams). 2. Create your own aliases for them. 3. Add the GAMS system directory "/Applications/GAMS/gams24.3_osx_x64_64_sfx" to your path. Method 3. is recommended.  doe@mac:/Applications/GAMS/gams24.3_osx_x64_64_sfx$cd

doe@mac:/Users/doe$/Applications/GAMS/gams24.3_osx_x64_64_sfx/gamslib trnsport Copy ASCII: trnsport.gms  doe@mac:/Users/doe$/Applications/GAMS/gams24.3_osx_x64_64_sfx/gams trnsport.gms
--- Job trnsport Start 06/26/14 11:24:56 24.3.1 r46409 DEX-DEG Mac x86_64/Darwin
--- Starting compilation
--- trnsport.gms(69) 3 Mb
--- Starting execution: elapsed 0:00:00.024
--- trnsport.gms(45) 4 Mb
--- Generating LP model transport
--- trnsport.gms(66) 4 Mb
---   6 rows  7 columns  19 non-zeroes
--- Executing CPLEX: elapsed 0:00:00.114

IBM ILOG CPLEX   24.3.1 ... DEG Mac x86_64/Darwin
Cplex 12.6.0.0

Starting Cplex...
Space for names approximately 0.00 Mb
Use option 'names no' to turn use of names off
Tried aggregator 1 time.
LP Presolve eliminated 1 rows and 1 columns.
Reduced LP has 5 rows, 6 columns, and 12 nonzeros.
Presolve time = 0.02 sec. (0.00 ticks)

Iteration      Dual Objective            In Variable           Out Variable
1              73.125000    x(seattle.new-york) demand(new-york) slack
2             119.025000     x(seattle.chicago)  demand(chicago) slack
3             153.675000    x(san-diego.topeka)   demand(topeka) slack
4             153.675000  x(san-diego.new-york)  supply(seattle) slack
LP status(1): optimal
Cplex Time: 0.03sec (det. 0.01 ticks)

Optimal solution found.
Objective :         153.675000

--- Restarting execution
--- trnsport.gms(66) 2 Mb
--- Reading solution for model transport
--- trnsport.gms(68) 3 Mb
*** Status: Normal completion
--- Job trnsport.gms Stop 06/26/14 11:24:57 elapsed 0:00:00.487