From bf662d4349060df3951061cf8c92c34b94f835bc Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 31 Jul 2024 19:01:09 +1200 Subject: [PATCH] [docs] clarify where to type installation commands (#3795) --- docs/src/installation.md | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/docs/src/installation.md b/docs/src/installation.md index 2a5159c47ca..2d385c9bd78 100644 --- a/docs/src/installation.md +++ b/docs/src/installation.md @@ -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 @@ -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 @@ -58,21 +61,26 @@ Pkg.update("JuMP") 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