Skip to content

Instantly share code, notes, and snippets.

@joehuchette
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joehuchette/9059342 to your computer and use it in GitHub Desktop.
Save joehuchette/9059342 to your computer and use it in GitHub Desktop.
Installation instructions for JuMP in 15.083

JuMP for 15.083

Follow the steps below to install Julia, JuMP, Gurobi, and IJulia for use in 15.083. If you encounter installation problems, contact huchette@mit.edu or mlubin@mit.edu.

Install Julia

Mac OS X

  1. We will use the v0.3.5 binaries provided on the Julia download page. If you are running OS-X Lion, Mountain Lion, or Mavericks, choose the 10.7+64-bit version. Snow Leopard users, the 10.6 64-bit version is for you.
  2. Once downloaded, open the .dmg disk image in Finder and then drag Julia-0.3.5.app to your Applications folder.
  3. Open the Terminal.app add the Julia executable to your path:
  • Run echo PATH=\$PATH:\"/Applications/Julia-0.3.5.app/Contents/Resources/julia/bin\" >> ~/.bash_profile.

  • You can now run Julia by typing julia at the command line. To run a Julia file, type julia path/to/file.

Windows

  1. You can install the Julia 0.3.5 binaries from the Julia download page - you should use the 64-bit version if you have a 64-bit system.
  2. Extract the files to wherever you want.
  3. Open a Command Window and navigate to the the folder you made. You should now be able to run Julia by typing julia for interactive mode or julia myfile.jl to run a script.
  4. If you want to be able to run Julia from any location on your computer, you will need to add the Julia folder to your PATH. PATH is a list of folders that Windows looks in when the program name you type in isn't in the current folder. To see how to change your PATH, look at this link. Your PATH probably looks like "C:/RandomFolder/;c:/somestuff/blah/" right now. Say you put Julia in C:/Julia03/ - you should add this to the end of your PATH so it will look like "C:/RandomFolder/;c:/somestuff/blah/;C:/Julia03". Note the ; used to separate the folders.

Linux

Follow the instructions here Julia download page depending on your particular flavor of Linux.

Install IJulia

IJulia is a plugin to the IPython notebook system that we suggest for use in the class. To set up IJulia, first install IPython. The easiest way to do this is by installing Anaconda. Make sure to use the 64-bit version.

OSX note

On OSX you may need to append the anaconda/bin directory to your path; this can be accomplished by running

echo PATH=\$PATH:\"/Users/$USERNAME/anaconda/bin\" >> ~/.bash_profile

assuming you installed Anaconda to your home directory.

  • Important: on Windows, the Anaconda installer window gives options Add Anaconda to the System Path and also Register Anaconda as default Python version of the system. Be sure to check these boxes.

Finally, start Julia and install the IJulia package:

julia> Pkg.add("IJulia")

You should now be able to run IJulia notebooks at the terminal by running

>> ipython notebook --profile julia

Check Steven Johnson's nice set of instructions for more information.

Install Gurobi 6.0.0

If you have an older version of Gurobi (>= 5.5) on your computer, that should be fine. Some of the features we will use later in the course requier a fairly new version of Gurobi. We will be using the 64bit version of Julia, so make sure that you have the 64 bit version of Gurobi intalled. If you need a new version:

  1. Go to www.gurobi.com
  2. Create an account, and request an academic license.
  3. Download the installer for Gurobi 6.0
  4. Install Gurobi, accepting default options. Remember where it installed to!
  5. Go back to the website and navigate to the page for your academic license. You'll be given a command with a big code in it, e.g. grbgetkey aaaaa-bbbb
  6. In a terminal, navigate to the gurobi600/<operating system>/bin folder where <operating system> is the name of your operating system.
  7. Copy-and-paste the command from the website into the command prompt - you need to be on campus for this to work!

Install JuMP and the Gurobi interface

Installing these is easy using the Julia package manager:

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

Test it all

Open a new IJulia window and run the commands found in the test file getting_started.html. Save the notebook and submit the results to mlubin@mit.edu.

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