Skip to content

Commit eee2d5b

Browse files
committed
fix for loading gurobi using GUROBI_HOME environment variable
Former-commit-id: d64e72f [formerly 62affb6] Former-commit-id: 5a4e16d
1 parent 5cd6890 commit eee2d5b

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

mip/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from enum import Enum
44

5-
VERSION = '1.3.6'
5+
VERSION = '1.3.9'
66

77
# epsilon number (practical zero)
88
EPS = 10e-6

mip/gurobi.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,23 @@
1818

1919
if 'GUROBI_HOME' in environ:
2020
libfile = glob(os.path.join(os.environ['GUROBI_HOME'],
21-
'lib/libgurobi*[0-9].so'))
21+
'lib/libgurobi[0-9][0-9].*'))
22+
2223
if libfile:
2324
lib_path = libfile[0]
2425

26+
# checking gurobi version
27+
s1 = lib_path.split('.')[0]
28+
vs = ''
29+
for c in reversed(s1):
30+
if c.isdigit():
31+
vs += c
32+
else:
33+
break
34+
vs = vs[::-1]
35+
minor_ver = vs[-1]
36+
major_ver = vs[0:-1]
37+
2538
if lib_path is None:
2639
for major_ver in reversed(range(6, 10)):
2740
for minor_ver in reversed(range(0, 11)):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7167473adfedccc43f2893899f10c16e68b58211
1+
8bb43ca5bb4c3ba87f807ecf5f41b8c346438e76
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6d0bedb91e58d3d7c366dbffc38b0b0817f48cc8
1+
c2b327e83cbf2a3af7cea6b8007084f87d9813cf

0 commit comments

Comments
 (0)