diff --git a/doc/installation.rst b/doc/installation.rst index b18594272bc..94948392427 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -29,78 +29,67 @@ To start using JuMP (after installing a solver), it should be imported into the 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. We currently have interfaces for COIN-OR, Gurobi, GNU GLPK, and CPLEX. +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. + + + +.. _jump-solvertable: + ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| Solver | Julia Package | ``solver=`` | License | LP | SOCP | MIP | ++==================================================================================+=================================================================================+=====================+=============+====+======+=====+ +| `Cbc `_ | `Cbc.jl `_ | ``CbcSolver()`` | EPL | | | X | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| `Clp `_ | `Clp.jl `_ | ``ClpSolver()`` | EPL | X | | | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| `CPLEX `_ | `CPLEXLink `_ | ``CplexSolver()`` | Comm. | X | X | X | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| `GLPK `_ | `GLPKMath... `_ | ``GLPKSolverLP()`` | | | | | +| | | ``GLPKSolverMIP()`` | GPL | X | | X | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| `Gurobi `_ | `Gurobi.jl `_ | ``GurobiSolver()`` | Comm. | X | X | X | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ +| `MOSEK `_ | `Mosek.jl `_ | ``MosekSolver()`` | Comm. | X | X | X | ++----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+-------------+----+------+-----+ + +To install Gurobi, for example, and use it with a JuMP model ``m``, run:: + + Pkg.add("Gurobi") + using JuMP + using Gurobi -COIN-OR Clp and Cbc -+++++++++++++++++++ + m = Model(solver=GurobiSolver()) + +Setting solver options is discussed in the :ref:`Model ` section. -Support for Clp and Cbc is provided via `CoinMP `_ and the `Cbc.jl `_ and `Clp.jl `_ packages. You can install these solvers through the package manager:: +Solver-specific notes follow below. - julia> Pkg.add("Cbc") - julia> Pkg.add("Clp") # Clp depends on Cbc, so installing Clp first - # will install both. +COIN-OR Clp and Cbc ++++++++++++++++++++ -Regarding the CoinMP binary itself, installation will differ by platform: +Installation of the binaries will differ by platform: * Linux - Only option is to build from source, which will happen automatically. * OS X - Downloads binary via the `Homebrew.jl `_ package. * Windows - **Only 32-bit versions of Julia are supported by the COIN solvers at this time**. The 32-bit version of Julia can be used on 64-bit Windows with no issues. Binary download. Will require `Visual Studio 2012 redistributable `_ if not already installed. -Clp and Cbc, if available, are the default choice of solver in JuMP. +Clp and Cbc, if available, are the default choice of solver in JuMP. Cbc does *not* support MIP callbacks. Gurobi ++++++ -Support for `Gurobi `_, a commercial solver, is provided by the `Gurobi.jl `_ package. First install Gurobi itself and set up a license, then run:: - - julia> Pkg.add("Gurobi") +Requires a working installation of Gurobi with an activated license (free for academic use). .. warning:: If you are using 64-bit Gurobi, you must use 64-bit Julia (and similarly with 32-bit Gurobi). -To use within a JuMP model ``m``, run:: - - using JuMP - using Gurobi - - m = Model(solver=GurobiSolver()) - -The Gurobi package README contains additional examples of how to use Gurobi within JuMP. Gurobi supports quadratic objectives and constraints. - -GLPK -++++ - -JuMP can use `GLPK `_, an open-source MILP solver, via the `GLPKMathProgInterface `_ package. - -To use GLPK within a JuMP model ``m``, run:: - - using JuMP - using GLPKMathProgInterface - - m = Model(solver=GLPKSolverMIP()) # or GLPKSolverLP() for LPs - MOSEK +++++ -`MOSEK `_ is a commercial solver. The Julia interface, `Mosek.jl `_ is fully supported by the MOSEK team. To use Mosek within a JuMP model ``m``, run:: - - using JuMP - using Mosek - - m = Model(solver=MosekSolver()) - +Requires a license (free for academic use). Mosek does not support the MIP callbacks used in JuMP. +The Mosek interface was contributed by the Mosek team. (Thanks!) CPLEX +++++ -`CPLEX `_ is a commercial solver. An experimental interface is available via the `CPLEXLink `_ package. It supports quadratic objectives and constraints. Note that this interface requires using CPLEX as a shared library, which is unsupported by the CPLEX developers. - -To use CPLEX within a JuMP model ``m``, run:: - - using JuMP - using CPLEXLink - - m = Model(solver=CplexSolver()) - - - +Requires a working installation of CPLEX with a license (free for faculty members and graduate teaching assistants). The `CPLEXLink `_ interface is experimental; it requires using CPLEX as a shared library, which is unsupported by the CPLEX developers. Special installation steps are required on OS X. diff --git a/doc/refmodel.rst b/doc/refmodel.rst index cbef77bd02a..37cada92cac 100644 --- a/doc/refmodel.rst +++ b/doc/refmodel.rst @@ -20,10 +20,10 @@ which can be used to change the default solver behavior. solver = solvername(Option1=Value1, Option2=Value2, ...) -where ``solvername`` is one of the supported LP solvers (``ClpSolver``, ``GLPKSolverLP``, and ``GurobiSolver``) or MIP solvers (``CbcSolver``, ``GLPKSolverMIP``, and ``GurobiSolver``). To use these objects, the corresponding modules (``Clp``, ``Cbc``, ``GLPKMathProgInterface``, and ``Gurobi``) must be first loaded. All options are solver-dependent; see corresponding solver packages for more information. +where ``solvername`` is one of the supported solvers. See the :ref:`solver table ` for the list of available solvers and corresponding parameter names. All options are solver-dependent; see corresponding solver packages for more information. .. note:: - Be sure that the solver provided supports the problem class of the model. For example ``ClpSolver`` and ``GLPKSolverLP`` support only linear programming problems. ``CbcSolver`` and ``GLPKSolverMIP`` support only mixed-integer programming problems. ``GurobiSolver`` supports both classes as well as problems with quadratic objectives and/or constraints. + Be sure that the solver provided supports the problem class of the model. For example ``ClpSolver`` and ``GLPKSolverLP`` support only linear programming problems. ``CbcSolver`` and ``GLPKSolverMIP`` support only mixed-integer programming problems. As an example, we can create a ``Model`` object that will use GLPK's exact solver for LPs as follows::