|
From: Tamas S. <ta...@ao...> - 2009-03-06 16:59:16
|
Hello all, here is some notes on debugging QuantLib applications on OSX Leopard: by default QuantLib is build with -g -O2 flag which will create a special folder in ql/.libs called libQuantLib-0.9.8.dylib.dSYM, this will hold all the debugging info. However since all the "not important *.o" files are deleted the gdb debugger will crash on OSX if this two files located together: libQuantLib-0.9.8.dylib.dSYM libQuantLib-0.9.8.dylib by default "make install" will copy the dylib file to the installation location, since this should be the release version the debug informations (folder of lib*.dSYM) are not copied of course, but the library files still hold some debug information. So if an application based on QuantLib is debugged the gdb will create lots of warnings about missing debug info: ..... warning: Could not find object file "/Users/tamas/Programming/ QuantLibRoot/QuantLib/ql/.libs/libQuantLib.lax/libCashFlows.a/ averagebmacoupon.o" - no debug information available for "averagebmacoupon.cpp" ___etc___ ..... to avoid this when the "make install" script is called, on OSX one should run `strip -S libQuantLib-0.9.8.dylib` before installing the library to its final location (eg removing all "useless"debug info from the library) -------------------------------------------------------------------------------------------------------------------------- So the real question now is how to debug QuantLib on OSX Leopard? Well, during "make" one should keep these files: ql/.libs/libQuantLib.lax/libCashFlows.a/averagebmacoupon.o ql/.libs/libQuantLib.lax/libExperimental.a/abcdatmvolcurve.o by forcing the libtool (or make script) to not to clean up after successful linking... I hope this will help someone... Best, Tamas |