Using Google OR tools with third party MIP solvers on Windows

791 views
Skip to first unread message

Marko Grdinic

unread,
Apr 14, 2015, 2:53:25 PM4/14/15
to or-tools...@googlegroups.com
Hello, I am currently trying to solve the Facility Routing Problem for the Discrete Optimization course on Coursera.

I've had some luck with Gurobi, but for some of the problems the restrictions imposed by the demo license are too onerous to attain a full score. While installing and using Gurobi with VS2013 was straightforward, as everything I needed was included in the .sln files, the other solvers such as SCIP are all native Linux programs and have no such convenient Windows support.

As Google OR tools has an API for those solvers, I thought I could perhaps somehow add the SCIP binaries to it and use it that way.

Would that be possible?

That, or any advice on how I could get a MIP solver working with OR tools would be appreciated.

Thank you for your time.

Marko Grdinic

unread,
Apr 15, 2015, 7:20:54 AM4/15/15
to or-tools...@googlegroups.com
I managed to get the SCIP solver to work.

All VS needs for a third party library to work are the binaries(the .lib and the .dll files) and the includes. The precompiled binaries are offered on the main page of SCIP and the include files are buried several archives deep in the SCIP 'src' that needs to be downloaded separately. The source does not need to be built or anything, just unpacked, which surprised me. This is not documented anywhere.

I've run a few examples and it works well for me, but I note that SCIP has a but-ugly C API with pointers sticking out everywhere.

Google OR Tools has a much nicer interface to SCIP. I would like to get the two to work together.

The building from source instructions are not clear on what I should do to combine them.

For example, 'make third_party'. 

It is not clear whether this command would install any third party solvers automatically, or if it only refers to some other dependencies. Do I have to put in the scip source archive into the dependencies directory? Do I have to set any special settings?

Laurent Perron

unread,
Apr 15, 2015, 8:31:17 AM4/15/15
to or-tools...@googlegroups.com
Hi, 

the solution is to add scipoptsuite-3.1.1.tgz source archive in dependencies\archives before running make third_party.
I am currently making it support scip 3.1.1, so don't do it now.

I will also update the documentation.

Thanks

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marko Grdinic

unread,
Apr 15, 2015, 9:47:50 AM4/15/15
to or-tools...@googlegroups.com
Yeah, I've noticed something was going on when cmake suddenly disappeared from the installation page. :)

Only after asking, I've noticed that in the Unix part it said that I have add the scip file to the dependencies directory.

I think the installation instruction have been clear so far, except for one.

'$ make third_party'

I am honestly confused about what this command is supposed to be referring to. While I was trying to get SCIP to work I had installed MSYS and it had a shell for such commands and I linked it to the Mingw64 directory, but I've noticed that the OR tools also uses the cl compiler so I am not sure.

I'll wait a while for you to finish. I've done most of the problem with Gurobi anyway.

Laurent Perron

unread,
Apr 15, 2015, 10:17:09 AM4/15/15
to or-tools...@googlegroups.com
Hi, 

I have finished support for scip 3.1.1 and soplex 2.0.1

some remarks:
- or-tools only support visual studio, no mingw, no gnu compiler.
- in the same spirit, you need to compile with either the 32bit command line prompt, or the 64bit cross compiler command line prompt from the visual studio 2013 tools menu
- to install scip, copy scipoptsuite-3.1.1.tgz to dependencies\archives, then build third_party (see below)
- before compiling or-tools sources, you need to run 'make third_party'.
- I provide a make.exe in tools, so the actual command is tools\make third_party.
- If anything break in that process, or-tools will likely not work.

Marko Grdinic

unread,
Apr 15, 2015, 11:38:35 AM4/15/15
to or-tools...@googlegroups.com
You were rather prompt on this! Right now it is compiling, and I noticed at the start that it gave an error about git not being present before zooming off.

The build finished successfully (with 3 warnings.) Should I restart it after installing git?

Also it was not noted that I needed the 64-bit cross compiler terminal. Had you not told me now, I would have used the native one.

Marko Grdinic

unread,
Apr 15, 2015, 12:14:35 PM4/15/15
to or-tools...@googlegroups.com
I hadn't tried whether it worked, but simply cleaned up and rebuild with git installed.

When I tried to run the integer_programming.cc it gave an error that gflags.h could not be found. I found it in the dependecies directory and moved it into the 'src' directory. Now it gives me different errors:

Error 6 error C3861: 'ParseCommandLineFlags': identifier not found C:\Users\Markog\Documents\Visual Studio 2013\Projects\OR Tools Test\OR Tools Test\OR Tools Test.cpp 86
Error 5 error C2653: 'google' : is not a class or namespace name C:\Users\Markog\Documents\Visual Studio 2013\Projects\OR Tools Test\OR Tools Test\OR Tools Test.cpp 86

Probably something went wrong during my build. Were the include files supposed to be in the 'src' directory. Also, I can't find the ortools.lib anywhere.

I'll try again.

Marko Grdinic

unread,
Apr 15, 2015, 12:24:13 PM4/15/15
to or-tools...@googlegroups.com
I've tried again, but ortools.lib is still missing from the lib directory (or any other directory for that matter.) 

Please advise.

Laurent Perron

unread,
Apr 15, 2015, 3:14:47 PM4/15/15
to or-tools...@googlegroups.com
Please run make third_party again, and check you have all tools installed (svc, git, cmake) before running it.
You error means that gflags was not installed successfully, problably cmake or git was not found.

When it finishes successfully, you can compile or-tools.

Le mer. 15 avr. 2015 à 18:24, Marko Grdinic <mra...@gmail.com> a écrit :
I've tried again, but ortools.lib is still missing from the lib directory (or any other directory for that matter.) 

Please advise.

--

Marko Grdinic

unread,
Apr 16, 2015, 1:37:50 AM4/16/15
to or-tools...@googlegroups.com
The same result as before, but I redirected the terminal output to a text file for your perusal.


There were some fatal git errors mixed in there, but I have no idea what to do about them.
Reply all
Reply to author
Forward
0 new messages