SHOT is programmed in C++ 17, and the build system is based on CMake. Here are some instructions for compiling SHOT.

Getting the dependencies

To compile SHOT you need to have the following component libraries available on your system.

  • A solver for mixed-integer linear programming (MILP) problems. SHOT supports the open-source solver Cbc (2.10 or newer), and the commercial solvers CPLEX (12.8 or newer) and Gurobi (8.0 or newer). If you are an academic user, you can download free versions of both CPLEX and Gurobi.

  • A solver for nonlinear programming (NLP) problems. SHOT currently supports only Ipopt (3.12 or newer). If you call SHOT from GAMS or by reading a GAMS-model file in SHOT, you can also use any licensed NLP solver available in GAMS.

Compiling Cbc

Instructions for compiling Cbc available at

Compiling Ipopt

Instructions for compiling Ipopt available at

Downloading the source code

Clone SHOT with git

git clone

or manually downloading the source code from Github.

Configuring and compiling SHOT

SHOT utilizes CMake to generate the build system. The settings for CMake are specified in the file CMakeLists.txt that is available in the root SHOT folder you downloaded in step 2.

Normally you would not need to edit the CMakeLists.txt file; instead settings can be provided as arguments when calling CMake.

You can use the following arguments to configure SHOT:



-DCMAKE_BUILD_TYPE=<Debug|Release| RelWithDebInfo|MinSizeRel>

If Debug or RelWithDebInfois used, additional debug information is created.


Compiles SHOT with AMPL interface (ASL), e.g. for use with Pyomo or JuMP.


Compiles SHOT with support for Cbc as MIP solver.


Defines where the Cbc libraries and headers are located.


Compiles SHOT with support for CPLEX as MIP solver.


Defines where the CPLEX libraries and headers are located.


Compiles SHOT with GAMS interface.


Defines where GAMS is installed


Compiles SHOT with support for Gurobi as MIP solver.


Defines where the Gurobi libraries and headers are located.


Compiles SHOT with support for Ipopt as NLP solver.


Defines where the Ipopt libraries and headers are located.


Whether the SHOT executable (or just the libraries) should be generated.

So to compile a completely free version of SHOT you can issue the following commands:

git clone
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DHAS_CBC=on -DCBC_DIR=/opt/cbc \
-DHAS_IPOPT=on -DIPOPT_DIR=/opt/ipopt ..

Compiling on Windows

Note that compiling SHOT (and its dependencies) on Windows might be challenging. Recommended options on Windows is to either use Windows Subsystem for Linux or MSYS2, for which similar steps as above can be used.

If you want to use MSYS2, instructions are available at

Installing using CMake

After compiling SHOT, you can use make install to install SHOT (including the binary, library and header files) to your system. By default the install is made into /usr/local on a Linux-system. If you want to change this, you can substitute the call to CMake above with:

cmake --install /path/to/install/dir \
-DCMAKE_INSTALL_PREFIX=/path/to/install/dir \
-DHAS_CBC=on -DCBC_DIR=/opt/cbc \
-DHAS_IPOPT=on -DIPOPT_DIR=/opt/ipopt ..

Note that the --installneeds to come first.

Creating an installation package using CPack

You can also (only tested on Linux) create installation packages (ZIP or a self-extracting installation program) using CPack (which is a part of CMake).

To create installation files directly in the build directory, just execute the command make package or cpackafter the steps above have completed.

Integrate SHOT with GAMS

Build the SHOT library as in discussed above, but make sure to pass the GAMS system directory to the cmake call via -DGAMS_DIR=.

Then add the following entry to gmscmpun.txt (gmscmpnx.txt on Windows) in the GAMS system directory:

SHOT 1101 5 0001020304 1 0 2 MINLP MIQCP
/path/to/ sht 1 1