Installation Guide

Info

Installation troubles? Check the Common installation issues section below.

JuMP is a package for Julia. To use JuMP, first download and install Julia.

Note

This version of JuMP is compatible with Julia 1.0 and later.

From Julia, JuMP is installed using the built-in package manager:

import Pkg
Pkg.add("JuMP")
Tip

We recommend you create a Pkg environment for each project you use JuMP for, instead of adding lots of packages to the global environment. The Pkg manager documentation has more information on this topic.

Installing a solver

JuMP depends on solvers to solve optimization problems, and you will need to install one before you can solve problems with JuMP. The table below lists the currently available solvers.

Install a solver using the Julia package manager, replacing "Clp" by the Julia package name as appropriate.

import Pkg
Pkg.add("Clp")

Once installed, you can use Clp as a solver with JuMP as follows, using set_optimizer_attributes to set solver-specific options:

using JuMP
using Clp
model = Model(Clp.Optimizer)
set_optimizer_attributes(model, "LogLevel" => 1, "PrimalTolerance" => 1e-7)
Note

Most packages follow the ModuleName.Optimizer naming convention, but exceptions may exist. See the README of the Julia package's Github repository for more details on how to use a particular solver, including any solver-specific options.

Supported solvers

Most solvers are not written in Julia, and some require commercial licenses to use, so installation is often more complex.

  • If a solver has Manual in the Installation column, the solver requires a manual installation step, such as downloading and installing a binary, or obtaining a commercial license. Consult the README of the relevant Julia package for more information.
  • If the solver has Manualᴹ in the Installation column, the solver requires an installation of MATLAB.
  • If the Installation column is missing an entry, installing the Julia package will download and install any relevant solver binaries automatically, and you shouldn't need to do anything other than Pkg.add.

Solvers with a missing entry in the Julia Package column are written in Julia. The link in the Solver column is the corresponding Julia package.

SolverJulia PackageInstallationLicenseSupports
Alpine.jlTriad NS(MI)NLP
Artelys KnitroKNITRO.jlManualComm.(MI)LP, (MI)SOCP, (MI)NLP
BARONBARON.jlManualComm.(MI)NLP
CbcCbc.jlEPL(MI)LP
CDCSCDCS.jlManualᴹGPLLP, SOCP, SDP
CDDCDDLib.jlGPLLP
ClpClp.jlEPLLP
COSMO.jlApacheLP, QP, SOCP, SDP
CPLEXCPLEX.jlManualComm.(MI)LP, (MI)SOCP
CSDPCSDP.jlEPLLP, SDP
EAGO.jlCC BY-NC-SANLP
ECOSECOS.jlGPLLP, SOCP
FICO XpressXpress.jlManualComm.(MI)LP, (MI)SOCP
GLPKGLPK.jlGPL(MI)LP
GurobiGurobi.jlManualComm.(MI)LP, (MI)SOCP
Hypatia.jlMITLP, SOCP, SDP
IpoptIpopt.jlEPLLP, QP, NLP
Juniper.jlMIT(MI)SOCP, (MI)NLP
MOSEKMosekTools.jlManualComm.(MI)LP, (MI)SOCP, SDP
NLoptNLopt.jlGPLLP, QP, NLP
OSQPOSQP.jlApacheLP, QP
PATHPATHSolver.jlMITMCP
Pavito.jlMPL-2(MI)NLP
ProxSDP.jlMITLP, SOCP, SDP
SCIPSCIP.jlManualZIB(MI)LP, (MI)NLP
SCSSCS.jlMITLP, SOCP, SDP
SDPASDPA.jl, SDPAFamily.jlGPLLP, SDP
SDPNALSDPNAL.jlManualᴹCC BY-SALP, SDP
SDPT3SDPT3.jlManualᴹGPLLP, SOCP, SDP
SeDuMiSeDuMi.jlManualᴹGPLLP, SOCP, SDP
Tulip.jlMPL-2LP

Where:

  • LP = Linear programming
  • QP = Quadratic programming
  • SOCP = Second-order conic programming (including problems with convex quadratic constraints and/or objective)
  • MCP = Mixed-complementarity programming
  • NLP = Nonlinear programming
  • SDP = Semidefinite programming
  • (MI)XXX = Mixed-integer equivalent of problem type XXX
Note

Developed a solver or solver wrapper? This table is open for new contributions! Start by making a pull request to edit the installation.md file.

Note

Developing a solver or solver wrapper? See Interacting with solvers and the MathOptInterface docs for more details on how JuMP interacts with solvers. Please get in touch via the Developer Chatroom with any questions about connecting new solvers with JuMP.

Solver-specific notes

  • Artelys Knitro

Requires a license.

  • BARON

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

  • CDD

CDD can solve the problem both using Float64 and Rational{BigInt} arithmetics. The arithmetic used the type T given in CDDLib.Optimizer{T}. Only CDDLib.Optimizer{Float64} can be used with JuMP as JuMP inputs the problem in Float64 arithmetics. Use MOI directly for CDDLib.Optimizer{Rational{BigInt}}.

  • COIN-OR Cbc

Cbc supports "SOS" constraints.

  • COSMO

COSMO can solve LPs, QPs, SOCPs and SDPs. It can handle SDPs with quadratic objective functions and supports chordal decomposition of large structured PSD constraints. COSMO is a first order method that performs well on large problems but has a low accuracy by default ($10^{−4}$). See the COSMO.jl documentation for more information.

  • CPLEX

Requires a working installation of CPLEX with a license (free for faculty members and graduate teaching assistants). CPLEX supports "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 the SecondOrderCone set.

  • Gurobi

Requires a working installation of Gurobi with an activated license (free for academic use). Gurobi supports "SOS" constraints.

  • FICO Xpress

Requires a working installation of Xpress with an active license (it is possible to get a license for academic use, see FICO Academic Partner Program). Supports SOCP and "SOS" constraints.

  • MOSEK

Requires a license (free for academic use). The Mosek interface is maintained by the Mosek team. (Thanks!) Note that even if the package implementing MathOptInterface is MosekTools, for consistency the MOI optimizer is called Mosek.Optimizer so do the following to create a model with the Mosek solver:

using MosekTools
model = Model(Mosek.Optimizer)
  • ProxSDP

ProxSDP solves general SDP problems by means of a first order proximal algorithm based on the primal-dual hybrid gradient, also known as Chambolle-Pock method. The main advantage of ProxSDP over other state-of-the-art solvers is the ability to exploit the low-rank property inherent to several SDP problems. ProxSDP is a first order solver and has low accuracy. See the ProxSDP.jl documentation for more information.

  • 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.

  • SDPA

SDPA is a second order solver which comes in several variants. The main version has a C++ interface which SDPA.jl uses for efficiently communicating the problem instance to the solver. The three high-precision variants, SDPA-GMP (arbitrary precision), SDPA-QD ("quad-double" precision) and SDPA-DD ("double-double" precision) do not expose a library interface, but can used via SDPAFamily.jl, which writes and reads files to interact with the solver binary.

AMPL and GAMS

Use AmplNLWriter to access solvers that support the nl format. Such solvers include Bonmin and Couenne. See a more complete list here.

Use GAMS.jl to access solvers available through GAMS. Such solvers include: AlphaECP, Antigone, BARON, CONOPT, Couenne, LocalSolver, PATHNLP, SHOT, SNOPT, SoPlex. See a complete list here.

Note

GAMS.jl requires an installation of the commercial software GAMS for which a free community license exists.

Previously supported solvers

The following solvers were compatible with JuMP up to release 0.18 but are not yet compatible with the latest version because they do not implement the new MathOptInterface API:

Please join the Developer Chatroom if you have interest in reviving a previously supported solver.

Common installation issues

Tip

When in doubt, run import Pkg; Pkg.update() to see if updating your packages fixes the issue. Remember you will need to exit Julia and start a new session for the changes to take effect.

Check the version of your packages

Each package is versioned with a three-part number of the form vX.Y.Z. You can check which versions you have installed with import Pkg; Pkg.status().

This should almost always be the most-recent release. You can check the releases of a package by going to the relevant Github page, and navigating to the "releases" page. For example, the list of JuMP releases is available at: https://github.com/jump-dev/JuMP.jl/releases.

If you post on the community forum, please include the output of Pkg.status()!

Unsatisfiable requirements detected

Did you get an error like Unsatisfiable requirements detected for package JuMP? The Pkg documentation has a section on how to understand and manage these conflicts.

Installing new packages can make JuMP downgrade to an earlier version

Another common complaint is that after adding a new package, code that previously worked no longer works.

This usually happens because the new package is not compatible with the latest version of JuMP. Therefore, the package manager rolls-back JuMP to an earlier version! Here's an example.

First, we add JuMP:

(jump_example) pkg> add JuMP
  Resolving package versions...
Updating `~/jump_example/Project.toml`
  [4076af6c] + JuMP v0.21.5
Updating `~/jump_example/Manifest.toml`
  ... lines omitted ...

The + JuMP v0.21.5 line indicates that JuMP has been added at version 0.21.5. However, watch what happens when we add JuMPeR:

(jump_example) pkg> add JuMPeR
  Resolving package versions...
Updating `~/jump_example/Project.toml`
  [4076af6c] ↓ JuMP v0.21.5 ⇒ v0.18.6
  [707a9f91] + JuMPeR v0.6.0
Updating `~/jump_example/Manifest.toml`
  ... lines omitted ...

JuMPeR gets added at version 0.6.0 (+ JuMPeR v0.6.0), but JuMP gets downgraded from 0.21.5 to 0.18.6 (↓ JuMP v0.21.5 ⇒ v0.18.6)! The reason for this is that JuMPeR doesn't support a version of JuMP newer than 0.18.6.

Tip

Pay careful attention to the output of the package manager when adding new packages, especially when you see a package being downgraded!