Warning

This documentation tracks the development branch of JuMP. For the documentation of the latest JuMP release, see here.

# Installation Guide¶

This guide will briefly guide you through installing Julia, JuMP and[a] solver[s] of your choice.

## Getting Julia¶

At the time of writing this documentation the latest release of Julia is version `0.5`

, which is the version required by JuMP. You can easily build from source on OS X and Linux, but the binaries will work well for most people.

Download links and more detailed instructions are available on the Julia website.

## Getting JuMP¶

Once you’ve installed Julia, installing JuMP is simple. Julia has a git-based package system. To use it, open Julia in interactive mode (i.e. `julia`

at the command line) and use the package manager:

```
julia> Pkg.add("JuMP")
```

This command checks METADATA.jl to determine what the most recent version of JuMP is and then downloads it from its repository on GitHub.

To start using JuMP (after installing a solver), it should be imported into the local scope:

```
julia> using JuMP
```

## Getting Solvers¶

Solver support in Julia is currently provided by writing a solver-specific package that provides a very thin wrapper around the solver’s C interface and providing a standard interface that JuMP can call. If you are interested in providing an interface to your solver, please get in touch. The table below lists the currently supported solvers and their capabilities.

Solver | Julia Package | `solver=` |
License | LP | SOCP | MILP | NLP | MINLP | SDP |
---|---|---|---|---|---|---|---|---|---|

Artelys Knitro | KNITRO.jl | `KnitroSolver()` |
Comm. | X | X | ||||

BARON | BARON.jl | `BaronSolver()` |
Comm. | X | X | ||||

Bonmin | AmplNLWriter.jl | `BonminNLSolver()` * |
EPL | X | X | X | X | ||

CoinOptServices.jl | `OsilBonminSolver()` |
||||||||

Cbc | Cbc.jl | `CbcSolver()` |
EPL | X | |||||

Clp | Clp.jl | `ClpSolver()` |
EPL | X | |||||

Couenne | AmplNLWriter.jl | `CouenneNLSolver()` * |
EPL | X | X | X | X | ||

CoinOptServices.jl | `OsilCouenneSolver()` |
||||||||

CPLEX | CPLEX.jl | `CplexSolver()` |
Comm. | X | X | X | |||

ECOS | ECOS.jl | `ECOSSolver()` |
GPL | X | X | ||||

FICO Xpress | Xpress.jl | `XpressSolver()` |
Comm. | X | X | X | |||

GLPK | GLPKMath... | `GLPKSolver[LP|MIP]()` |
GPL | X | X | ||||

Gurobi | Gurobi.jl | `GurobiSolver()` |
Comm. | X | X | X | |||

Ipopt | Ipopt.jl | `IpoptSolver()` |
EPL | X | X | ||||

MOSEK | Mosek.jl | `MosekSolver()` |
Comm. | X | X | X | X | X | |

NLopt | NLopt.jl | `NLoptSolver()` |
LGPL | X | |||||

SCS | SCS.jl | `SCSSolver()` |
MIT | X | X | X |

Where:

- LP = Linear programming
- SOCP = Second-order conic programming (including problems with convex quadratic constraints and/or objective)
- MILP = Mixed-integer linear programming
- NLP = Nonlinear programming
- MINLP = Mixed-integer nonlinear programming
- SDP = Semidefinite programming

* requires CoinOptServices installed, see below.

To install Gurobi, for example, and use it with a JuMP model `m`

, run:

```
Pkg.add("Gurobi")
using JuMP
using Gurobi
m = Model(solver=GurobiSolver())
```

Setting solver options is discussed in the Model section.

Solver-specific notes follow below.

### Artelys Knitro¶

Requires a license. The KNITRO.jl interface currently supports only nonlinear problems.

### BARON¶

Requires a license. A trial version is available for small problem instances.

### COIN-OR Clp and Cbc¶

Binaries for Clp and Cbc are provided on OS X and Windows (32- and 64-bit) by default. On Linux, they will be compiled from source (be sure to have a C++ compiler installed). Cbc supports “SOS” constraints but does *not* support MIP callbacks.

### CPLEX¶

Requires a working installation of CPLEX with a license (free for faculty members and graduate teaching assistants). The interface requires using CPLEX as a shared library, which is unsupported by the CPLEX developers. Special installation steps are required on OS X. CPLEX supports MIP callbacks and “SOS” constraints.

### ECOS¶

ECOS can be used by JuMP to solve LPs and SOCPs. ECOS does not support general quadratic objectives or constraints, only second-order conic constraints specified by using `norm`

or the quadratic form `x'x <= y^2`

.

### FICO Xpress¶

Requires a working installation of Xpress with an active license (it is possible to get license for academic use, see FICO Academic Partner Program). Supports SOCP and “SOS” constraints. The interface is experimental, but it does pass all JuMP and MathProgBase tests. Callbacks are not yet supported.

Warning

If you are using 64-bit Xpress, you must use 64-bit Julia (and similarly with 32-bit Xpress).

### GLPK¶

GLPK binaries are provided on OS X and Windows (32- and 64-bit) by default. On Linux, it will be compiled from source. Note that `GLPKSolverLP`

should be used for continuous problems and `GLPKSolverMIP`

for problems with integer variables. GLPK supports MIP callbacks but does not support “SOS” constraints.

### Gurobi¶

Requires a working installation of Gurobi with an activated license (free for academic use). Gurobi supports MIP callbacks and “SOS” constraints.

Warning

If you are using 64-bit Gurobi, you must use 64-bit Julia (and similarly with 32-bit Gurobi).

### Ipopt¶

Ipopt binaries are provided on OS X and Windows (32- and 64-bit) by default. On Linux, it will be compiled from source. The default installation of Ipopt uses the open-source MUMPS library for sparse linear algebra. Significant speedups can be obtained by manually compiling Ipopt to use proprietary sparse linear algebra libraries instead. Julia can be pointed to use a custom version of Ipopt; we suggest posting to the julia-opt mailing list with your platform details for guidance on how to do this.

### MOSEK¶

Requires a license (free for academic use). Mosek does not support the MIP callbacks used in JuMP. For nonlinear optimization, Mosek supports only convex problems. The Mosek interface is maintained by the Mosek team. (Thanks!)

### NLopt¶

NLopt supports only nonlinear models. An algorithm must be specified as an option when using `NLoptSolver`

. NLopt is not recommended for large-scale models, because it does not currently exploit sparsity of derivative matrices.

### SCS¶

SCS can be used by JuMP to solve LPs and SOCPs, and SDPs. SCS is a first order solver and has low accuracy (\(10^{-4}\)) by default; see the SCS.jl documentation for more information.

### COIN-OR Bonmin and Couenne¶

Binaries of Bonmin and Couenne are provided on OS X and Windows (32- and 64-bit) by the CoinOptServices.jl package.
On Linux, they will be compiled from source. Once installed, they can be called either via `.osil`

files using
`OsilBonminSolver`

and `OsilCouenneSolver`

from CoinOptServices.jl,
or via `.nl`

files using `BonminNLSolver`

and `CouenneNLSolver`

from AmplNLWriter.jl.
We recommend using the `.nl`

format option, which is currently more stable and has better performance for derivative computations.
Since both Bonmin and Couenne use Ipopt for continuous subproblems, the same MUMPS sparse linear algebra performance caveat applies.

### Other AMPL-compatible solvers¶

Any other solver not listed above that can be called from AMPL can be used by JuMP through the
AmplNLWriter.jl package. The first argument to `AmplNLSolver`

can be used to specify a solver executable name.

For example, SCIP is a powerful noncommercial mixed-integer programming solver. To use SCIP within JuMP, you must first download and compile SCIP with support for AMPL. Then you may use `AmplNLSolver("/path/to/scipampl")`

where `scipampl`

is the executable produced from the compilation process.