Skip to content

Commit

Permalink
[docs] clarify where to type installation commands (#3795)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jul 31, 2024
1 parent cd10ffc commit bf662d4
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ frequently.

## Install JuMP

From Julia, JuMP is installed using the built-in package manager:
JuMP is installed using the built-in Julia package manager. Launch Julia, and
then enter the following at the `julia>` prompt:
```julia
import Pkg
Pkg.add("JuMP")
julia> import Pkg

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

!!! tip
Expand All @@ -49,30 +51,36 @@ Pkg.add("JuMP")

When we release a new version of JuMP, you can update with:
```julia
import Pkg
Pkg.update("JuMP")
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 `"Clp"` by the
Install a solver using the Julia package manager, replacing `"HiGHS"` by the
Julia package name as appropriate.
```julia
import Pkg
Pkg.add("Clp")
julia> import Pkg

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

Once installed, you can use Clp as a solver with JuMP as follows, using
Once installed, you can use HiGHS as a solver with JuMP as follows, using
[`set_attribute`](@ref) to set solver-specific options:
```julia
using JuMP
using Clp
model = Model(Clp.Optimizer)
set_attribute(model, "LogLevel" => 1)
set_attribute(model, "PrimalTolerance" => 1e-7)
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
Expand Down

0 comments on commit bf662d4

Please sign in to comment.