Table of Contents
- Installation using the self-extracting archive (osx_x64_64_sfx.exe)
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 PKG 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 via the Launchpad.
CPLEX Optimization Studio 12.10 was released in December 2019. This version includes: Ability for CP Optimizer users to programmatically monitor the solve and stop it ahead of time if appropriate. Ability for CPLEX users to specify their own. IBM® ILOG® CPLEX® Optimization Studio offers rapid development and deployment of optimization models through debugging, testing, tuning and application generation. CPLEX Optimization Studio provides the most efficient way to build optimization and constraint programming models for planning and scheduling.
Two installation procedures are available for GAMS on Mac OS X:
- Obtain the GAMS PKG file, which is available from http://www.gams.com/download.
- Double click the package and follow the instructions. By clicking on
Customise
in the tabInstallation Type
you can decide to add GAMS to the PATH as well as to reject the installation of GAMS Studio. Note that adding GAMS to the PATH is done by modifying your shell profile file (~/.zprofile
,~/.bash_profile
etc.). A backup of your old profile is saved (~/.zprofile.gamsbackup
,~/.bash_profile.gamsbackup
etc.). - In order to test the GAMS installation with
GAMS Studio
open theLaunchpad
and click theGAMS Studio 33
icon to open the application. Alternatively, go to Applications and open theGAMS Studio 33
application. Install your license via the corresponding GAMS Studio dialog. The license file is nowadays sent via email, with instructions. You can also request a demo license from http://www.gams.com/download.
Optionally, you can create the license file 'gamslice.txt' in a directory that GAMS searches to find a license. GAMS searches a couple of system wide and user specific standard locations for a license file.
- Open the
Model Library Explorer
and open theTRNSPORT
model (sequence number 001). Run the model and check the contents of the process log, which should be similar to the Terminal output listed in the next bullet point. In order to test the GAMS installation without using
GAMS Studio
open a Terminal window. Execute the following commands to see if everything works as expected:The output should be similar to this:
To uninstall a GAMS installation that was installed using the PKG installer, run the following command from the terminal: sudo bash /Library/Frameworks/GAMS.framework/Versions/33/Resources/uninstall.sh
. Additionally, you can remove GAMS from the PATH in your shell profile file (~/.zprofile
, ~/.bash_profile
) if GAMS was added to the PATH during installation.
- 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 commandchmod 755 osx_x64_64_sfx.exe
.- Attention
- The common way to install GAMS on a Mac is the PKG installer. When one tries 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:
- Instead of downloading the sfx installer through the browser, use a command line tool such as curl (note that by downloading the software, you agree to the License Agreement). The download link may need to be adjusted, depending on the distribution that should be downloaded.
- 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. - Create the directory that should contain the GAMS system directory, for instance
/Applications/GAMS
. Change to this directory (cd /Applications/GAMS
). Make surepwd
returns the name of this directory correctly. - 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:
Create the license file
gamslice.txt
in a directory GAMS searches to find a license. The license file is nowadays sent via email, with instructions. You can also request a demo license from http://www.gams.com/download.- Attention
- Do not store the
gamslice.txt
in the GAMS system directory. This invalidates the code signature and cause Gatekeeper to reject the bundle!
GAMS searches a couple of system wide and user specific locations for a license file. For Mac OS X these locations include
/Library/Application Support/GAMS
and/Users/username/Library/Application Support/GAMS
. The locations can vary due to different system configuration. One can get an ordered list of data directories GAMS searches forgamslice.txt
by running the program./gamsinst -listdirs
from the GAMS system directory. Even though this list might contain locations in the system directory, e.g./Applications/GAMS31.1
we strongly discourage to placegamslice.txt
here.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 valuesb. setting a command line default, e.g.,
gams trnsport lp=bdmlp
c. an option statement in the GAMS model, e.g:
option lp=bdmlp;
- Add the GAMS system directory to your path (see below).
- 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:
- 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.
Access to GAMS
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.
- 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: - 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: 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. - 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: The correct Bourne or Korn shell syntax (either command line or.profile
) is: Again, you should log out and log in in order to put the alias settings in.cshrc
or.profile
into effect. - Casual users can always type the absolute path names of the GAMS programs, e.g.:
Example
Cplex Solver For Mac
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
.
CPLEX for MPL
CPLEX has a number of sophisticated features that drastically improve solving performance, these include: sophisticated problem preprocessing, efficient restarts form an advanced basis, sensitivity analysis, infeasibilty finder to mention a few.
CPLEX has an arsenal of methodologies to solve LP problems, typically the best approach is CPLEX's dual simplex algorithm for the majority of problems. There are certain types of problems that may benefit from CPLEX's primal simplex algorithm. CPLEX also encompasses an interior point method, its Barrier algorithm which provides an alternative to the simplex method for solving linear problems, it is based on a primal-dual predictor-corrector method. The barrier algorithm is generally considered when used to solve large problems or if the problems may have numerical instability issues. There is also an efficient network simplex method that is effective in solving network models.
CPLEX can solve models that have a quadratic objective function and linear constraints. If the objective function is positive semi-definite it can utilize any of the LP methods. To solve QPs in MPL by CPLEX one has to set in MPL the 'ModelType' to Quadratic.
CPLEX Mixed Integer Optimizer provides the capability to solve problems with mixed-integer variables (general or binary). It utilizes state-of-the art algorithms and techniques. CPLEX principally uses a branch and cut algorithm that essentially solves a series of relaxed LP subproblems. Addition of cuts and sophisticated branching strategies can be employed at these subproblems to try to find the optimal solution more effectively. CPLEX also have heuristics that can aid in finding initial good solutions, it also includes a sophisticated mixed integer preprocessing system. One can even solve large and difficult integer problems quickly and efficiently.
CPLEX is tuned to solve the vast majority of LP problems using the default options. There are occasions where one may need to change the option settings, these are usually a result of bad performance or numerical instability issues. On the whole the dual simplex method is best for most LP problems, there are some instances where the primal simplex may work best. The barrier method typically should be used for very large sparse models or models that are experiencing numerical difficulties. The sifting algorithm is a simple form of column generation well suited for models where the number of variables dramatically exceeds the number of constraints. Bad performance on LPs is using a result of degeneracy, which can be identified by examining the iteration log, having long sequences of iterations where the objective value remains unchanged. Perturbations can help speed up performance on degenerate problems. Degeneracy is not an issue for the barrier method, thus highly degenerate problems one should use the barrier algorithm to solve the LP.
MIP problems can be extremely difficult to solve, though there are no steadfast rules on enhancing MIP performance, certain things may be advantageous in improving the performance on some models and be a hinderous on other problems. Below are some of the considerations one should look into when try to solve difficult MIP problems:
Probing: This looks at the logical implications of fixing binary variables, which happens after presolve but before branch and bound. CPLEX has 3 levels of probing, there is a trade off factor here that though more intensive probing can derive good results it can also take some time to complete the probing. For large difficult problems, we suggest using level 3 or 2 since time overhead of probing is more likely to be paid back over long running time of branch and bound.
Variable Selection: Selecting which variable to branch on can have considerable benefits. In difficult models 'Strong Branching' or 'Pseudo reduced costs' may be helpful. Both methods especially strong branching invest considerable effort in analyzing potential branches in hope of drastically reducing the number of nodes that will be explored.
Cuts: Adding cuts are one of the principal reasons of recent dramatic increases in MIP performance. The cuts can dramatically increase the best bound and remove otherwise sub-optimal branches in the tree. The more cuts added, the larger the inherent matrix becomes which can increase the processing time at the nodes. However usually on difficult models an aggressive cut strategy is the best mode of practice.
Cplex For Mac
For MIPs CPLEX will display cut information and how they affect the best bound at the root node:
CPLEX is tuned to solve the vast majority of LP problems using the default options. There are occasions where one may need to change the option settings, these are usually a result of bad performance or numerical instability issues. On the whole the dual simplex method is best for most LP problems, there are some instances where the primal simplex may work best. The barrier method typically should be used for very large sparse models or models that are experiencing numerical difficulties. The sifting algorithm is a simple form of column generation well suited for models where the number of variables dramatically exceeds the number of constraints. Bad performance on LPs is using a result of degeneracy, which can be identified by examining the iteration log, having long sequences of iterations where the objective value remains unchanged. Perturbations can help speed up performance on degenerate problems. Degeneracy is not an issue for the barrier method, thus highly degenerate problems one should use the barrier algorithm to solve the LP.
MIP problems can be extremely difficult to solve, though there are no steadfast rules on enhancing MIP performance, certain things may be advantageous in improving the performance on some models and be a hinderous on other problems. Below are some of the considerations one should look into when try to solve difficult MIP problems:
Probing: This looks at the logical implications of fixing binary variables, which happens after presolve but before branch and bound. CPLEX has 3 levels of probing, there is a trade off factor here that though more intensive probing can derive good results it can also take some time to complete the probing. For large difficult problems, we suggest using level 3 or 2 since time overhead of probing is more likely to be paid back over long running time of branch and bound.
Variable Selection: Selecting which variable to branch on can have considerable benefits. In difficult models 'Strong Branching' or 'Pseudo reduced costs' may be helpful. Both methods especially strong branching invest considerable effort in analyzing potential branches in hope of drastically reducing the number of nodes that will be explored.
Cuts: Adding cuts are one of the principal reasons of recent dramatic increases in MIP performance. The cuts can dramatically increase the best bound and remove otherwise sub-optimal branches in the tree. The more cuts added, the larger the inherent matrix becomes which can increase the processing time at the nodes. However usually on difficult models an aggressive cut strategy is the best mode of practice.
Cplex For Mac
For MIPs CPLEX will display cut information and how they affect the best bound at the root node:
CPLEX Licensing
Getting CPLEX License
You will need to copy the three codes displayed in the DOS window which you can do by clicking on the MSDOS icon in the upper left corner and choose
CPLEX License Activation
You can use the 'CPLEX 7+' tab in the Maximal License Manager to copy and paste the text between the lines and then activate the license.