Macports/dylib failure with libc++abi.dylib: terminate called throwing an exception Abort trap: 6

macports

I installed Macports vowpal_wabbit v6.1 on MacOS 10.8.4 and it dies with:

libc++abi.dylib: terminate called throwing an exception
Abort trap: 6

I read around a lot and it seems this is a known compatibility issue between libc++ compiled with gcc vs llvm.
I did read the caveats about mixing compilers.
Symptoms seem to be similar to this.
I vaguely recollect there was a compatibility reason with some port I installed which forced me to use mp-gcc instead of llvm, it might have been some crufty old dependency of numpy or suchlike.

MacPorts version is 2.2.0. XCode version is 5.0 and I previously also unsuccessfully tried with 4.6. I did uninstall, clean and reinstall to no success. Versions:

vowpal_wabbit-6.1_0+cluster.darwin_12.x86_64
boost @1.54.0_0+no_single+no_static+python27

Macports compiler versions are:
sudo port select --show gcc returns mp-gcc45
sudo port select --show cc returns
Error: The 'show' command failed: The specified group 'cc' does not exist.
I don't see which compiler would get used by default? Doesn't it break things if I reinstall every Macport with llvm? I have many installed ports and that would be really painful, needless to say also breaking other things.

Also:
otool -L /opt/local/bin/vw

/opt/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.7)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)

Best Answer

Both vowpal_wabbit and its dependency Boost seem to be getting wrongly compiled and linked with the system libstdc++ instead of macport's /opt/local/lib/libstdc++.6.dylib

Solution seems to be:

a) Hack the macports Boost install by either:

b) Then we have to hack the macports file to point VW to the Boost install