Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki mateusz.lacki@gmail.com wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
Dear Matthias. Thank you for the reply. I did the following:
I recompiled alps using new empty build directory with "-D CMAKE_BUILD_TYPE=Debug” in the cmake command, but still gdb produces the following:
Program received signal SIGSEGV, Segmentation fault. 0x00000001000e4468 in ?? () (gdb) bt #0 0x00000001000e4468 in ?? () #1 0x00007fff5fbfbed0 in ?? () #2 0x00007fff5fbfc168 in ?? () #3 0x00007fff5fbfbed0 in ?? () #4 0x000000010004cf95 in ?? () #5 0x0000000104683cc0 in ?? () #6 0x0000000104938940 in ?? () #7 0x0000000000000000 in ?? () (gdb) quit
So no debug information. I would appreciate any information of what I could be doing wrong. Is setting the flag ""-D CMAKE_BUILD_TYPE=Debug” enough?
I have noticed that there was some effect: for example mps_optim produces a lot more on the output (I’d say due to std::count << mps.description() << std::endl; ) , so I guess some debug option is being printed but this would be triggered by passing a proper flag like “-D DEBUG” to the preprocessor, but I am hoping for “-g” for the compiler.
Best, Mateusz
On 07 Aug 2015, at 16:30, Matthias Troyer troyer@phys.ethz.ch wrote:
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki mateusz.lacki@gmail.com wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
Dear Mateusz,
That should do it, but you an check whether the debug compilation flags actually contain a -g, if not you can edit them
Matthias
On Aug 26, 2015, at 1:21 PM, Mateusz Łącki mateusz.lacki@gmail.com wrote:
Dear Matthias. Thank you for the reply. I did the following:
I recompiled alps using new empty build directory with "-D CMAKE_BUILD_TYPE=Debug” in the cmake command, but still gdb produces the following:
Program received signal SIGSEGV, Segmentation fault. 0x00000001000e4468 in ?? () (gdb) bt #0 0x00000001000e4468 in ?? () #1 0x00007fff5fbfbed0 in ?? () #2 0x00007fff5fbfc168 in ?? () #3 0x00007fff5fbfbed0 in ?? () #4 0x000000010004cf95 in ?? () #5 0x0000000104683cc0 in ?? () #6 0x0000000104938940 in ?? () #7 0x0000000000000000 in ?? () (gdb) quit
So no debug information. I would appreciate any information of what I could be doing wrong. Is setting the flag ""-D CMAKE_BUILD_TYPE=Debug” enough?
I have noticed that there was some effect: for example mps_optim produces a lot more on the output (I’d say due to std::count << mps.description() << std::endl; ) , so I guess some debug option is being printed but this would be triggered by passing a proper flag like “-D DEBUG” to the preprocessor, but I am hoping for “-g” for the compiler.
Best, Mateusz
On 07 Aug 2015, at 16:30, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
Dear Matthias,
I think the answer is yes (I cite "ccmake .” output belop)
Is there a file which contains the full command that is used to compile a given source file? I tried to track back through cmakefiles manually, but I failed
CMAKE_BUILD_TYPE Debug CMAKE_COLOR_MAKEFILE ON CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG -g CMAKE_CXX_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG -g CMAKE_C_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_C_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_C_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG
Best, Mateusz
On 26 Aug 2015, at 13:48, Matthias Troyer troyer@phys.ethz.ch wrote:
Dear Mateusz,
That should do it, but you an check whether the debug compilation flags actually contain a -g, if not you can edit them
Matthias
On Aug 26, 2015, at 1:21 PM, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear Matthias. Thank you for the reply. I did the following:
I recompiled alps using new empty build directory with "-D CMAKE_BUILD_TYPE=Debug” in the cmake command, but still gdb produces the following:
Program received signal SIGSEGV, Segmentation fault. 0x00000001000e4468 in ?? () (gdb) bt #0 0x00000001000e4468 in ?? () #1 0x00007fff5fbfbed0 in ?? () #2 0x00007fff5fbfc168 in ?? () #3 0x00007fff5fbfbed0 in ?? () #4 0x000000010004cf95 in ?? () #5 0x0000000104683cc0 in ?? () #6 0x0000000104938940 in ?? () #7 0x0000000000000000 in ?? () (gdb) quit
So no debug information. I would appreciate any information of what I could be doing wrong. Is setting the flag ""-D CMAKE_BUILD_TYPE=Debug” enough?
I have noticed that there was some effect: for example mps_optim produces a lot more on the output (I’d say due to std::count << mps.description() << std::endl; ) , so I guess some debug option is being printed but this would be triggered by passing a proper flag like “-D DEBUG” to the preprocessor, but I am hoping for “-g” for the compiler.
Best, Mateusz
On 07 Aug 2015, at 16:30, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
This does look like -g being added. You can use the command
VERBOSE=1 make
to see what is actually being done
On Aug 26, 2015, at 2:30 PM, Mateusz Łącki mateusz.lacki@gmail.com wrote:
Dear Matthias,
I think the answer is yes (I cite "ccmake .” output belop)
Is there a file which contains the full command that is used to compile a given source file? I tried to track back through cmakefiles manually, but I failed
CMAKE_BUILD_TYPE Debug CMAKE_COLOR_MAKEFILE ON CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG -g CMAKE_CXX_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG -g CMAKE_C_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_C_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_C_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG
Best, Mateusz
On 26 Aug 2015, at 13:48, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Dear Mateusz,
That should do it, but you an check whether the debug compilation flags actually contain a -g, if not you can edit them
Matthias
On Aug 26, 2015, at 1:21 PM, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear Matthias. Thank you for the reply. I did the following:
I recompiled alps using new empty build directory with "-D CMAKE_BUILD_TYPE=Debug” in the cmake command, but still gdb produces the following:
Program received signal SIGSEGV, Segmentation fault. 0x00000001000e4468 in ?? () (gdb) bt #0 0x00000001000e4468 in ?? () #1 0x00007fff5fbfbed0 in ?? () #2 0x00007fff5fbfc168 in ?? () #3 0x00007fff5fbfbed0 in ?? () #4 0x000000010004cf95 in ?? () #5 0x0000000104683cc0 in ?? () #6 0x0000000104938940 in ?? () #7 0x0000000000000000 in ?? () (gdb) quit
So no debug information. I would appreciate any information of what I could be doing wrong. Is setting the flag ""-D CMAKE_BUILD_TYPE=Debug” enough?
I have noticed that there was some effect: for example mps_optim produces a lot more on the output (I’d say due to std::count << mps.description() << std::endl; ) , so I guess some debug option is being printed but this would be triggered by passing a proper flag like “-D DEBUG” to the preprocessor, but I am hoping for “-g” for the compiler.
Best, Mateusz
On 07 Aug 2015, at 16:30, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
Thank you. Indeed this option showed what is being done and “-g” was there, and now the lldb debugger shows debugging symbols. I do not understant why it did not work before. Anyway it works now.
Thanks.
Best, Mateusz
On 26 Aug 2015, at 14:42, Matthias Troyer troyer@phys.ethz.ch wrote:
This does look like -g being added. You can use the command
VERBOSE=1 make
to see what is actually being done
On Aug 26, 2015, at 2:30 PM, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear Matthias,
I think the answer is yes (I cite "ccmake .” output belop)
Is there a file which contains the full command that is used to compile a given source file? I tried to track back through cmakefiles manually, but I failed
CMAKE_BUILD_TYPE Debug CMAKE_COLOR_MAKEFILE ON CMAKE_CXX_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG -g CMAKE_CXX_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_CXX_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG CMAKE_C_COMPILER /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG -g CMAKE_C_FLAGS_MINSIZEREL -Os -DNDEBUG CMAKE_C_FLAGS_RELEASE -O3 -DNDEBUG CMAKE_C_FLAGS_RELWITHDEBINFO -O2 -g -DNDEBUG
Best, Mateusz
On 26 Aug 2015, at 13:48, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Dear Mateusz,
That should do it, but you an check whether the debug compilation flags actually contain a -g, if not you can edit them
Matthias
On Aug 26, 2015, at 1:21 PM, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear Matthias. Thank you for the reply. I did the following:
I recompiled alps using new empty build directory with "-D CMAKE_BUILD_TYPE=Debug” in the cmake command, but still gdb produces the following:
Program received signal SIGSEGV, Segmentation fault. 0x00000001000e4468 in ?? () (gdb) bt #0 0x00000001000e4468 in ?? () #1 0x00007fff5fbfbed0 in ?? () #2 0x00007fff5fbfc168 in ?? () #3 0x00007fff5fbfbed0 in ?? () #4 0x000000010004cf95 in ?? () #5 0x0000000104683cc0 in ?? () #6 0x0000000104938940 in ?? () #7 0x0000000000000000 in ?? () (gdb) quit
So no debug information. I would appreciate any information of what I could be doing wrong. Is setting the flag ""-D CMAKE_BUILD_TYPE=Debug” enough?
I have noticed that there was some effect: for example mps_optim produces a lot more on the output (I’d say due to std::count << mps.description() << std::endl; ) , so I guess some debug option is being printed but this would be triggered by passing a proper flag like “-D DEBUG” to the preprocessor, but I am hoping for “-g” for the compiler.
Best, Mateusz
On 07 Aug 2015, at 16:30, Matthias Troyer <troyer@phys.ethz.ch mailto:troyer@phys.ethz.ch> wrote:
Yes, just switch the build mode in cmake from Release to Debug
Matthias
On 07 Aug 2015, at 07:20, Mateusz Łącki <mateusz.lacki@gmail.com mailto:mateusz.lacki@gmail.com> wrote:
Dear All, I would like to ask for some practical tips how to effectively debug alps applications:
Is there a way how to build alps with debug flags switched on?. I would appreciate an ability to use a debugger such as gdb to debug the alps applications code. Does the debugging logic depend heavily on a particular alps application (meaning is debugging modifications of mps_optim moreless equivalent to debugging dwa code)?
Can this debug mode be turned on using the cmake flags?
Best, Mateusz Łącki
comp-phys-alps-users@lists.phys.ethz.ch