Debugging QuantLib applications on OSX Leopard

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Debugging QuantLib applications on OSX Leopard

tamasrs (Bugzilla)
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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev