On Tue, 28 Sep 2010, David Andrs wrote:
> I was trying to run libmesh examples (specifically example 13) on Mac OS X
> (Snow Leopard) using Apple supplied compilers and I encountered the
> reported problems with dynamic_cast. In order to fix the dynamic _cast
> issued, one has to change libmesh_CXXSHAREDFLAGS in Make.common to:
> -ldylib1.o -dynamiclib
> (-ldylib1.o and -no_compact_linkedit are the new ones)
> That fixes the problem for optimized mode.
> However, if you compile and run in debug mode, you start to have weird
> memory corruption errors inside STL (like printing out some text to
> stdout). In order to "fix" that, I had to remove -D_GLIBCXX_DEBUG
> -D_GLIBCXX_DEBUG_PEDANTIC from libmesh_CXXFLAGS on line 233 in
> Make.common. I'm not sure what would be the proper fix for this.
Thanks! I'm afraid the proper fix is going to have to be done at
configure time. Adding dylib1.o won't work on non-Apple systems, and
removing the GLIBCXX flags for everyone isn't a good solution.
The only catch then is figuring out how to conservatively detect
*which* Apple compilers are affected. It's not unreasonable to hope
that they'll put out a fixed system compiler/library eventually, and
when that happens I'd rather not cripple debug mode for everyone whose
hostos matches "darwin".