Skip to content

Latest commit

 

History

History
117 lines (76 loc) · 2.63 KB

gurobi.md

File metadata and controls

117 lines (76 loc) · 2.63 KB

Installation of gurobi

Download and install gurobi

Download the corresponding version of gurobi from the official website, here is an example for Linux.

Installation and configuration

  1. unzip

    tar -xvfz gurobi10.0.3_linux64.tar.gz
  2. configuration Since IAGS calls gurobi in python, there are two ways to install the gurobipy library:

    1. pip/conda:

      # pip install
      pip install gurobipy
      
      # conda install
      conda install gurobipy
    2. local installation

      Execute the command in the unzipped gurobi/linux64 directory:

      python setup.py install
  3. Adding Environment Variables

    Entering vim ~/.bashrc in the terminal and add it to the file afterwards:

    export GUROBI_HOME="/home/.../gurobi1003/linux64"
    # ... is the path where gurobi is installed
    export PATH="${PATH}:${GUROBI_HOME}/bin"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
  4. Reset environment variables

    source ~/.bashrc

Activate gurobi

The academic license is free and activate for one year per activation.

  1. Register and Login

    img_1

    Use campus email whenever possible.

  2. Access to the user license portal

    img_2
  3. Apply for license

    img_3
  4. Get key

    img_4

    View the key you just applied for in the license screen and click on the second red box to view your key.

    img_5

    The application was successful here.

  5. Activate gurobi

    # Go to the gurobi installation directory
    cd /gurobi1003/linux64/bin
    
    # Activate the key you just requested
    # After successful activation, a gurobi.lic file will be created, which is stored in the current folder by default
    grbgetkey ********-****-****-****-***********

    Updating environment variables is more similar to the steps taken during installation:

    vim ~/.bashrc
    export GRB_LICENSE_FILE="/home/....../gurobi.lic"
  6. Test

    After the above steps, enter the command gurobi.sh to test whether the installation is successful, the following screen appears that is successful

    img_6