You are located in service: RWTH High Performance Computing (Linux)




1. How to access the software

module load MATH
module load gurobi

2. Matlab with gurobi

You have to prepare Matlab to use it with gurobi. To do this, you first have to find out where gurobi is installed:

$> module load MATH
$> module load gurobi
$> which gurobi_cl

At the time this manual was written, the default version of Gurobi was 9.1.1. This may change in the future, so the following steps must be adjusted accordingly. To make gurobi available in matlab, you have to switch to the matlab directory of gurobi in matlab and run gurobi_setup. In the prompt of the matlab-gui you have to enter the following:

>> % use the previously found path up to the 'bin' part and append 'matlab' at the end.
>> cd /usr/local_rwth/sw/gurobi/gurobi911/linux64/matlab
>> gurobi_setup

Now you can use gurobi from within matlab.

3. Python mit gurobi

You can import the gurobi python library after loading the gurobipy module:

$> module load python/3.9.6
$> module load MATH
$> module load gurobi/9.1.1
$> module load gurobipy/911-3.9

You have to select the gurobipy module matching the gurobi and python version where the first number is the gurobi version without dots and the second number the python version reduced to the first two digits, i.e. gurobi 9.1.1 and python 3.9.6 become gurobipy/911-3.9

After loading the module you can import gurobipy in your python script:

import gurobipy

last changed on 07/14/2022

How did this content help you?

Creative Commons Lizenzvertrag
This work is licensed under a Creative Commons Attribution - Share Alike 3.0 Germany License