Skip to content

Latest commit

 

History

History
297 lines (242 loc) · 22.1 KB

File metadata and controls

297 lines (242 loc) · 22.1 KB

Installation Guide

This guide explains how to install Julia and JuMP. If you have installation troubles, read the Common installation issues section below.

Install Julia

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

!!! tip If you are new to Julia, read our Getting started with Julia tutorial.

Choosing a version

You can install the "Current stable release" or the "Long-term support (LTS) release."

  • The "Current stable release" is the latest release of Julia. It has access to newer features, and is likely faster.
  • The "Long-term support release" is an older version of Julia that has continued to receive bug and security fixes. However, it may not have the latest features or performance improvements.

For most users, you should install the "Current stable release," and whenever Julia releases a new version of the current stable release, you should update your version of Julia. Note that any code you write on one version of the current stable release will continue to work on all subsequent releases.

For users in restricted software environments (for example, your enterprise IT controls what software you can install), you may be better off installing the long-term support release because you will not have to update Julia as frequently.

Install JuMP

JuMP is installed using the built-in Julia package manager. Launch Julia, and then enter the following at the julia> prompt:

julia> import Pkg

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

When we release a new version of JuMP, you can update with:

julia> import Pkg

julia> Pkg.update("JuMP")

Install a solver

JuMP depends on solvers to solve optimization problems. Therefore, you will need to install one before you can solve problems with JuMP.

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

julia> import Pkg

julia> Pkg.add("HiGHS")

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

julia> using JuMP

julia> using HiGHS

julia> model = Model(HiGHS.Optimizer);

julia> set_attribute(model, "output_flag", false)

julia> set_attribute(model, "primal_feasibility_tolerance", 1e-8)

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

Solver Julia Package Installation License Supports
Alpine.jl Triad NS (MI)NLP
Artelys Knitro KNITRO.jl Manual Comm. (MI)LP, (MI)SOCP, (MI)NLP
BARON BARON.jl Manual Comm. (MI)NLP
Bonmin AmplNLWriter.jl EPL (MI)NLP
Cbc Cbc.jl EPL (MI)LP
CDCS CDCS.jl Manualᴹ GPL LP, SOCP, SDP
CDD CDDLib.jl GPL LP
Clarabel.jl Apache LP, QP, SOCP, SDP
Clp Clp.jl EPL LP
CoolPDLP.jl MIT LP
COPT COPT.jl Comm. (MI)LP, SOCP, SDP
COSMO.jl Apache LP, QP, SOCP, SDP
Couenne AmplNLWriter.jl EPL (MI)NLP
CPLEX CPLEX.jl Manual Comm. (MI)LP, (MI)SOCP
CSDP CSDP.jl EPL LP, SDP
NVIDIA cuOpt cuOpt.jl Apache (MI)LP
cuPDLPx CuPDLPx.jl Apache LP
DAQP DAQP.jl MIT (Mixed-binary) QP
EAGO.jl MIT (MI)NLP
ECOS ECOS.jl GPL LP, SOCP
FICO Xpress Xpress.jl Manual Comm. (MI)LP, (MI)SOCP
GLPK GLPK.jl GPL (MI)LP
Gurobi Gurobi.jl Manual Comm. (MI)LP, (MI)SOCP
HiGHS HiGHS.jl MIT (MI)LP, QP
Hypatia.jl MIT LP, SOCP, SDP
Ipopt Ipopt.jl EPL LP, QP, NLP
Juniper.jl MIT (MI)SOCP, (MI)NLP
Loraine.jl MIT LP, SDP
MadNLP.jl MIT LP, QP, NLP
MAiNGO MAiNGO.jl EPL 2.0 (MI)NLP
Manopt.jl MIT NLP
MiniZinc MiniZinc.jl Manual MPL-2 CP-SAT
Minotaur AmplNLWriter.jl Manual BSD-like (MI)NLP
MOSEK MosekTools.jl Manual Comm. (MI)LP, (MI)SOCP, SDP
NLopt NLopt.jl GPL LP, QP, NLP
Octeract AmplNLWriter.jl Comm. (MI)NLP
Optim.jl MIT NLP
OSQP OSQP.jl Apache LP, QP
PATH PATHSolver.jl MIT MCP
Pajarito.jl MPL-2 (MI)NLP, (MI)SOCP, (MI)SDP
Pavito.jl MPL-2 (MI)NLP
Penbmi Penopt.jl Comm. Bilinear SDP
Percival.jl MPL-2 NLP
PolyJuMP.KKT PolyJuMP.jl MIT NLP
PolyJuMP.QCQP PolyJuMP.jl MIT NLP
ProxSDP.jl MIT LP, SOCP, SDP
RAPOSa AmplNLWriter.jl Manual RAPOSa (MI)NLP
SCIP SCIP.jl Apache (MI)LP, (MI)NLP
SCS SCS.jl MIT LP, QP, SOCP, SDP
SDPA SDPA.jl, SDPAFamily.jl GPL LP, SDP
SDPLR SDPLR.jl GPL LP, SDP
SDPLRPlus.jl SDPLRPlus.jl MIT LP, SDP
SDPNAL SDPNAL.jl Manualᴹ CC BY-SA LP, SDP
SDPT3 SDPT3.jl Manualᴹ GPL LP, SOCP, SDP
SeDuMi SeDuMi.jl Manualᴹ GPL LP, SOCP, SDP
SHOT AmplNLWriter.jl EPL (MI)NLP
StatusSwitchingQP.jl MIT LP, QP
Tulip.jl MPL-2 LP
CATrustRegionMethod.jl MIT NLP
Uno UnoSolver.jl MIT NLP

Where:

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

!!! note Developed a solver or solver wrapper? This table is open for new contributions. Edit the installation.md file, and use the checklist Adding a new solver to the documentation when opening the pull request.

!!! note Developing a solver or solver wrapper? See [Models](@ref jump_models) 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.

AMPL-based solvers

Use AmplNLWriter to access solvers that support the NL format.

Some solvers, such as Bonmin, Couenne and SHOT can be installed via the Julia package manager. Others need to be manually installed.

Consult the AMPL documentation for a complete list of supported solvers.

GAMS-based solvers

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.

NEOS-based solvers

Use NEOSServer.jl to access solvers available through the NEOS Server.

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.