Or-tools: Cannot create and start GUROBI solver

Created on 20 Nov 2020  路  4Comments  路  Source: google/or-tools

What version of OR-tools and what language are you using?
Version: v8.0
Language: Python

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Works on GLOP, SCIP
But doesn't work on Gurobi

What operating system (Linux, Windows, ...) and version?
Linux Ubuntu 20.04

What did you do?
Steps to reproduce the behavior:

Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.14.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from ortools.linear_solver import pywraplp                              

In [2]: solver = pywraplp.Solver('simple_lp_program', 
   ...:                           pywraplp.Solver.GUROBI_LINEAR_PROGRAMMING)    
terminate called after throwing an instance of 'std::bad_function_call'
  what():  bad_function_call
Aborted (core dumped)

What did you expect to see
No errors

What did you see instead?
core dump

Make sure you include information that can help us debug (full error message, model Proto).

Anything else we should know about your project / environment
I have Gurobi installed and can run it and managed to solve a simple problem using the gurobipy interface.
I have also recompiled v8.0 of ortools from source, and the generated Python files gives the same error.
I also have my $GUROBI_HOME set to /opt/gurobi910/linux64

Duplicate Feature Request Python Gurobi

Most helpful comment

It is fixed on master, and should be integrated in 8.1 (hopefully next week).

All 4 comments

Nevermind, I found the problem or solution.

In gurobi_environment.cc we can see it is looking for a older version of Gurobi, namely Gurobi 9.0.2, but I had 9.1.0 installed.

Downloading 9.0.3 and changing the GUROBI_HOME env variable actually works

It is fixed on master, and should be integrated in 8.1 (hopefully next week).

smooth

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hklarner picture hklarner  路  3Comments

karomad picture karomad  路  3Comments

TeodoraB21 picture TeodoraB21  路  3Comments

nosrettep picture nosrettep  路  5Comments

bhack picture bhack  路  4Comments