ykrist / rust-grb

Rust library bindings to the Gurobi optimiser.
MIT License
19 stars 8 forks source link

Still getting output to console despite env.set(param::OutputFlag, 0) #7

Closed MarijnRitzen closed 1 year ago

MarijnRitzen commented 1 year ago

Hi, first of all great work on the library; it is the best lp modeler library imo.

There is one annoying issue. Even though I set the OutputFlag to 0, I still get two annoying lines among every run of the model:

Set parameter Username
Academic license - for non-commercial use only - expires 2024-04-08

Since I am running this model many times, the printing is slowing down my program.

Do you know why this is and what to do about it? I tried using gurobi 9.52 and 10.0.1

MarijnRitzen commented 1 year ago

Nevermind, using an empty env I got it to work:

        let mut env = Env::empty().unwrap();
        env.set(param::OutputFlag, 0).unwrap(); // license will not be printed when env starts
        let env : Env = env.start().unwrap();