Skip to content

Instantly share code, notes, and snippets.

@mlubin
Last active May 18, 2016 04:50
Show Gist options
  • Save mlubin/54da06025514575b38674a5074c3c70f to your computer and use it in GitHub Desktop.
Save mlubin/54da06025514575b38674a5074c3c70f to your computer and use it in GitHub Desktop.
JuMP install instructions for Optimization Days/Journées de l'Optimisation 2016

Install Julia

You should use Julia 0.4.0 or later. Binaries of Julia for all platforms are available here.

  • Windows and Linux users should choose the 64-bit version, unless using a very old computer.

Install IJulia/Jupyter

Jupyter is a convenient notebook-based interface to present documents which interleave code, text, and equations. Follow the instructions here to set up IJulia.

Install Julia packages

To start off, we will be using the following packages:

  • JuMP
  • Ipopt
  • Clp
  • GLPKMathProgInterface

Install each one by running Pkg.add("xxx") where xxx is the package name from a Julia prompt or notebook. If you have a previous installation of Julia, be sure to update your packages to the latest version by running Pkg.update().

To test that your installation is working, run the following code:

using JuMP
m = Model()
@variable(m, x >= 0)
@variable(m, y >= 0)
@constraint(m, 2x + y <= 1)
@objective(m, Max, x+y)
status = solve(m)
@show status
@show getvalue(y)

The output should be:

status = :Optimal
getvalue(y) = 1.0

More resources

We will not have the time to go through all of the basic syntax points of Julia. For more materials on learning Julia, see here. The JuMP documentation is located here. During the tutorial, we will be though through some of these example notebooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment