Skip to content

Gurobi setup instructions

Michael Mell edited this page Feb 12, 2024 · 4 revisions

Table of contents

Introduction

MoMA uses the Gurobi optimizer. Containerized versions of MoMA include Gurobi. For these you only need to obtain a Gurobi license as described here. You only need to install Gurobi on your machine, if you want to run MoMA without containerization or to develop MoMA.

This section describes which Gurobi versions are used by MoMA, how to obtain a Gurobi license, and how to install Gurobi on your machine.

List of used Gurobi versions

Different MoMA versions use different Gurobi versions. Specifically, non-containerized MoMA versions use Gurobi 8.1, whereas containerized versions use Gurobi 10. The switch to Gurobi 10 was required to enable MoMA to run inside containers, which is not supported by Gurobi 8.

The following table summarizes the mapping between MoMA versions and Gurobi versions:

MoMA version Gurobi version Containerized version available?
<=0.9.6 8.1 no
0.9.8 10.2 yes
0.9.9, 0.9.10 10.3 yes
0.10.1 8.1 no
>=0.10.2 10.2 yes

Obtain a Gurobi license

Gurobi license types for MoMA usage

The following Gurobi license types are relevant for MoMA:

  1. Academic license (also called: Named-User Academic license):
    This license is used for developing MoMA on your local machine (see here).
    This is a free, single-seat license for academic use, which allows you to run Gurobi on your local machine. It is machine and IP specific (i.e. you need a different license when working on the University network vs. via VPN). It must be renewed after one year (as of writing). See here for details.
  2. Academic WLS license:
    This license is use for running MoMA inside a container (see here).
    This is a free, individual license for academic use, which allows you to run Gurobi inside containers, such as Docker containers (also within the cloud). It also allows you to run Gurobi on your local machine outside of containers. It must be renewed after 3 months (as of writing). Additional information can be found here.
  3. Gurobi license server:
    This license is used for running MoMA on HPC clusters (either containerized or not).
    This is a locally hosted network-license that can be used to run Gurobi on HPC clusters and allow multiple users and MoMA instance to use Gurobi.
    See here for details.

All three licenses work with the non-containerized versions. You need to use the Academic WLS license or the WLS license for containerized versions.

ℹ️ Academic users can request multiple licenses for themselves (both WLS and non-WLS licenses).

Obtaining the Gurobi academic license

Steps to obtain the Gurobi academic license:

  • Register with Gurobi to obtain the academic license: https://portal.gurobi.com/iam/register/

  • Go to the Gurobi User Portal to request and download a license. E.g. for the academic named-user license the dialogs look like this:

    Dialog for generating new license Request dialog for a new license
    images/screenshot_gurobi_request_dialog.png images/screenshot_gurobi_license_request_confirmation.png
  • After requesting the license you must download the corresponding license file (instructions are provided in the Gurobi portal after requesting the license).

Additional information on how to obtain a Gurobi license can be found here:

For Gurobi 8.1:

For Gurobi 10.0:

Gurobi setup instructions

Setup instruction for Gurobi on Linux are available here:

Their content is summarized in the example configurations below.

Example configurations

Gurobi needs the environment variables GUROBI_LIB_PATH, GUROBI_HOME, PATH, LD_LIBRARY_PATH, and GRB_LICENSE_FILE to be set correctly in your .bashrc or a MoMA launch-script.

This section shows example configuration entries for Gurobi in your .bashrc. The examples assume the default Gurobi install path (i.e. /opt/gurobi<VERSION>/). You will need to replace <PATH TO THE GUROBI LICENSE FILE (gurobi.lic)> with the path to your Gurobi license file. Additional information can be found in the installation guides linked above.

Gurobi 8.1

export GUROBI_LIB_PATH="/opt/gurobi811/linux64/lib"
export GUROBI_HOME="/opt/gurobi811/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="<PATH TO THE GUROBI LICENSE FILE (gurobi.lic)>"

Gurobi 10.0.2

export GUROBI_LIB_PATH="/opt/gurobi1002/linux64/lib"
export GUROBI_HOME="/opt/gurobi1002/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="<PATH TO THE GUROBI LICENSE FILE (gurobi.lic)>"