coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
533 stars 93 forks source link

Nondeterministic crash within cbc-c-windows-x86-64.dll #75

Closed pgoelz closed 4 years ago

pgoelz commented 4 years ago

We have been chasing a bug where CBC silently crashes and takes the entire program with it. The bug only appears on Windows and is not triggered by any specific ILP. Our usage case optimizes a fixed sequence of ILPs and will crash at a different ILP each time (I have verified that the ILPs are indeed the same). The cause seems to be an access violation within the call to cbclib.Cbc_solve() in cbc-c-windows-x86-64.dll, but I don’t know how to debug further. I was hoping to recompile CBC with debug flags, but coinbrew fails with checking how to get verbose linking output from ... configure: WARNING: compilation failed. I also tried using your compilation scripts (./downloadCBC.sh, then ./buildCBCWin.sh, on a linux machine), but got the following error output:

...
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/ec2-user/python-mip/scripts/Cbc':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check 
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.

I’m attaching config.log. Am I using the scripts wrong? So far, I have not modified any flags.

I mentioned this issue in https://github.com/coin-or/python-mip/issues/70, and @tkralphs asked me to open a new issue. My compiler is gcc 7.3.1.

tkralphs commented 4 years ago

The main problem is that you don't have the compiler installed. If you check config.log, you will see

./configure: line 4796: g++: command not found

But you are also doing by hand exactly what coinbrew is designed to automate for you. You definitely do not need to provide all those arguments to configure and build each project separately. Just use coinbrew. It should work out of the box in MSys2 with MinGW compilers. Follow the steps here:

https://coin-or.github.io/user_introduction.html#building-with-gcc

I'm going to close this issue for now, but you can reopen if you have further problems. You may consider opening an issue in the Cbc or coinbrew projects, though, if the issue is with those projects and not this one.

pgoelz commented 4 years ago

Apologies, I did not realize that GCC did not by default include C++ tools on my test system. For future reference, installing C++ and Fortran support to GCC and then installing lapack made the coinbrew compilation succeed.

tkralphs commented 4 years ago

Great, thanks for following up!