|
From: Jonathan S. <sw...@gm...> - 2025-06-11 21:46:17
|
Hi Alex, I would try to add -g and remove -O2 from your CXXFLAGS for debugging. You can also try installing the CMake extension for VSCode and then choose one of the debug build presets. This should enforce consistent build flags between the examples and the library. 2025년 6월 12일 (목) 02:30, Alexandros Fragkiadakis <ale...@gm...>님이 작성: > Hi, > > I am trying to build Quatlib in MacOS and use it in debug mode (i.e I want > to be able to debug the core .cpp files) > > I used the instructions here https://www.quantlib.org/install/macosx.shtml > > I have installed boost using home-brew in: /opt/homebrew/include. I was > able to build using make command and the example of Bermudan swaption works > fine, when I run it from command line. So I assume the installation works. > > Folders: > /Users/alex/local/include/ql/ (containing the .hpp files) > /Users/alex/local/lib (containing libQuantLib.a and libQuantLib.dylib) > > Both have been created > > When I try to open the Quantlib folder with VSCode I was able to debug, > /QuantLib-1.38/Examples/CDS/CDS.cpp. (step into the file) > > > [image: image.png] > > > However, when I try to step into all the .cpp files of Quantlib (example > Date.cpp, TermStructure.cpp etc) I fail. When I put a breakpoint there in > any of the .cpp files inside ql folder I see “Module containing this > breakpoint has not yet loaded” > Also In the /ql folder I can see the .o file for date.cpp has been created. > > Is there another process I need to follow to build the library in a > “Debug” mode? Maybe an extra configuration when doing: > > ./configure --with-boost-include=/usr/local/include/ \ > --prefix=${HOME}/local/ \ > CXXFLAGS='-O2 -stdlib=libstdc++ -mmacosx-version-min=10.6' \ > LDFLAGS='-stdlib=libstdc++ -mmacosx-version-min=10.6' > > I have used the QuantLib in Visual Studio an d windows before and there > after the Build you could step into any file by default/ modify the core > code etc with no issues. > > Thanks, > Alex > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |