ykrist / rust-grb

Rust library bindings to the Gurobi optimiser.
MIT License
17 stars 7 forks source link

Can't link with Gurobi newer than 9.5.1 #9

Open Petrusion opened 2 months ago

Petrusion commented 2 months ago

I don't know if 9.5.1 is simply the last supported Gurobi version by this crate, or if there is a problem on my machine, but when I try to use any version newer than 9.5.1 (via setting the GUROBI_HOME environment variable) it will print this linker problem:

libgrb-2257aa9b06125009.rlib(grb-2257aa9b06125009.grb.2a7a2767fa019a27-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol GRBloadclientenv referenced in function _ZN3grb3env3Env10new_client17h32c895719ef71177E

ykrist commented 2 months ago

It looks like GRBloadclientenv was removed in the 10.0 release. It's only used in Env::from_client, which wraps this C function, so I'll remove that.

Petrusion commented 2 months ago

Awesome! Looking forward to the update.

ykrist commented 1 month ago

I've released version 2.0 of this crate which adds support for Gurobi 10 and 11. I've tested the crate against version 9.5, 10 and 11, but feel free to re-open this issue if you think there's something broken with the release.

Petrusion commented 1 month ago

(I understand that commenting will reopen this issue?)

(EDIT: it seems this didn't reopen the issue and I see no way to do it. I probably can't do it myself. I will open this as a new issue if it seems this thread is dead for a few days)

Thank you for taking the time to update the library. There are just two small problems with the 2.0.0 release:

ykrist commented 1 month ago

Ah, it looks like you're compiling on Windows. I'm a novice when it comes to linking shared libs on Windows (I don't have a Windows dev machine), would you be able list the contents of gurobi1101/win64/lib? It looks like the build script could do with some tweaks.

Petrusion commented 1 month ago

Sure. Here are the results of calling dir in /lib and /bin: lib:

28.02.2024  02:44           276 894 gurobi-javadoc.jar
28.02.2024  02:44            98 316 gurobi.jar
28.02.2024  02:45               805 gurobi.py
28.02.2024  02:44            54 098 gurobi110.lib
28.02.2024  02:44           156 672 gurobi110.netstandard20.dll
28.02.2024  02:44           493 308 gurobi110.netstandard20.xml
28.02.2024  02:44         2 345 846 gurobi_c++md2017.lib
28.02.2024  02:44         2 951 146 gurobi_c++mdd2017.lib
28.02.2024  02:44         2 876 314 gurobi_c++mt2017.lib
28.02.2024  02:44         3 523 262 gurobi_c++mtd2017.lib
28.02.2024  02:45             1 215 rootcert.pem

bin:

28.02.2024  03:36        26 147 468 grbcluster.exe
28.02.2024  03:36        18 282 258 grbgetkey.exe
28.02.2024  03:36        18 607 512 grbprobe.exe
28.02.2024  02:44           165 376 grbtune.exe
28.02.2024  02:44           366 592 grb_ts.exe
28.02.2024  02:44               342 gurobi.bat
28.02.2024  02:44        36 569 832 gurobi110.dll
28.02.2024  02:44           181 992 Gurobi110.NET.dll
28.02.2024  02:44           503 876 Gurobi110.NET.XML
28.02.2024  02:44        35 043 560 gurobi110_light.dll
28.02.2024  02:44           200 424 GurobiJni110.dll
28.02.2024  02:44           179 712 gurobi_cl.exe
28.02.2024  02:44           118 784 vslauncher.exe
28.02.2024  02:44           458 336 vswhere.exe