Skip to content

Commit

Permalink
[docs] clarify where to type installation commands
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jul 31, 2024
1 parent cd10ffc commit 8647dc7
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 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,8 +51,9 @@ 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
Expand All @@ -61,18 +64,23 @@ to install one before you can solve problems with JuMP.
Install a solver using the Julia package manager, replacing `"Clp"` by the
Julia package name as appropriate.
```julia
import Pkg
Pkg.add("Clp")
julia> import Pkg

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

Once installed, you can use Clp 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 Clp

julia> model = Model(Clp.Optimizer);

julia> set_attribute(model, "LogLevel" => 1)

julia> set_attribute(model, "PrimalTolerance" => 1e-7)
```

!!! note
Expand Down

0 comments on commit 8647dc7

Please sign in to comment.