JuliaOpt / CoinOptServices.jl

Julia interface to COIN-OR Optimization Services https://projects.coin-or.org/OS
Other
16 stars 4 forks source link

Figure out why WinRPM binaries have assertions enabled #2

Closed tkelman closed 9 years ago

tkelman commented 9 years ago

Pkg.test("CoinOptServices") fails on Windows right now because assertions are enabled in the binaries, see http://list.coin-or.org/pipermail/bonmin/2015-April/000424.html

I'm working on debugging the autotools to see why assertions are getting enabled, when they aren't on by default for Linux or OS X.

P.S: sorry to any newly added watchers of this repo who may not care, we just moved this from my account into JuliaOpt and I added it to the COIN-OR, nonlinear, and conic teams. There are some features in osil for conic problems, upstream is working on binding CSDP for example. It's not hooked up yet in this Julia package so maybe we should take it out of the conic team for now?

mlubin commented 9 years ago

Regarding the groups, agreed that this doesn't need to be listed under conic solvers. Coin solvers and nonlinear solvers seems reasonable.

tkelman commented 9 years ago

Apparently github will auto-watch when you add a team but not auto-unwatch when you remove the team. Whoops.

tkelman commented 9 years ago

Ugh, having trouble getting a cross-compile from my local Ubuntu machine to work with ../configure --host=x86_64-w64-mingw32 coin_skip_warn_cflags=yes coin_skip_warn_cxxflags=yes --enable-shared and shared libraries, getting undefined reference toIpopt::IpBlasDcopy(int, double const, int, double, int)'while linkinglibipoptamplinterface-1.dll`. Might need to run this in a docker container of opensuse to reproduce the build environment that the WinRPM libraries come from.

tkelman commented 9 years ago

Maybe the question isn't "why are assertions enabled by default for mingw-w64 builds," it's actually "why are assertions disabled by default for linux/osx builds" -

tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ echo '#include <assert.h>
int main() {assert(0);}' | x86_64-w64-mingw32-g++ -o assert.exe -x c++ -
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ wine assert.exe
Assertion failed!

Program: Z:\home\tkelman\COIN_RELATED\OS-2.9.2\build01_win64\assert.exe
File: <stdin>, Line 2

Expression: 0

abnormal program termination
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ echo '#include <assert.h>
int main() {assert(0);}' | g++ -o assert -x c++ -
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ ./assert
assert: <stdin>:2: int main(): Assertion `0' failed.
Aborted (core dumped)

I may have been digging through the wrong config.log then?

mlubin commented 9 years ago

I vaguely recall that the coin config scrips add "-DNDEBUG" on non-debug builds

tkelman commented 9 years ago

Brilliant, looks like that's probably it.

tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ echo '#include <assert.h>
int main() {assert(0);}' | g++ -DNDEBUG -o assert -x c++ -
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ ./assert
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ echo '#include <assert.h>
int main() {assert(0);}' | x86_64-w64-mingw32-g++ -DNDEBUG -o assert.exe -x c++ -
tkelman@ygdesk:~/COIN_RELATED/OS-2.9.2/build01_win64$ wine assert.exe

Now I know more specifically what to look for, thanks!

tkelman commented 9 years ago

I think I have this figured out now. The opensuse build service sets CXXFLAGS to some default value, which overrides the normal behavior in the COIN configure scripts of setting -DNDEBUG. I'll just add ADD_CXXFLAGS=-DNDEBUG to the configure call for Osi and that'll probably be good enough for now.

mlubin commented 9 years ago

That sounds like it will do the trick

tkelman commented 9 years ago

You might want to check whether your Debian packages have the same issue.

tkelman commented 9 years ago

Fixed by https://build.opensuse.org/request/show/307522 and https://build.opensuse.org/request/show/307523, and passing tests on Windows now. I'll turn on AppVeyor later.

mlubin commented 9 years ago

:+1:

tkelman commented 9 years ago

The cross-compile issue on my Ubuntu machine turned out to be that I forgot to configure with lt_cv_deplibs_check_method=pass_all - coin's autotools are old enough that they don't know what to do with win64 libraries. Another big project on the to-do list, scheduled for "eventually"...