debug Xyce-serial

78 views
Skip to first unread message

Rich Zhang

unread,
Feb 24, 2021, 11:51:51 PM2/24/21
to xyce-users
Hi Xyce developers/Users,
     I successfully installed Xyce-serial and Xyce-parallel and now I want to use ddd, Data Display Debugger, to take a look under the hood. 
     First question is what should I put into the configure file for building. I saw some debug options and I enabled some and reconfigured, make and make install. But when I start ddd with ddd /data1/users/liqianz/xyce/Xyce-7.2/buildserial/src/Xyce [this is the place I believe is the source code for Xyce] -d /data1/users/liqianz/xyce/Xyce-7.2/src [I believe that is the main function for Xyce]
but what I saw on the screen was the following place. 

ddd.png

My configure for serial build:

#!/bin/sh
/data1/users/liqianz/xyce/Xyce-7.2/configure \
CXXFLAGS="-O3 -std=c++11" \
ARCHDIR="/data1/users/liqianz/xyce/trilinosSerial" \
CPPFLAGS="-I/usr/include/suitesparse" \
--enable-debug_device \
--enable-debug_analysis \
--enable-debug_topology \
--enable-debug_circuit \
--enable-debug_directsolve \
--enable-debug_linear \
--enable-debug_nonlinear \
--prefix=/data1/users/liqianz/xyce/Xyce-7.2/buildserial


xyce-users

unread,
Feb 25, 2021, 12:31:13 AM2/25/21
to xyce-users
The main thing you'll want to add to configure is the "-g" option to the CXXFLAGS line.  This tells the compiler to generate debugging information.  Without it, a debugger won't be very useful.

ddd is basically just a GUI for gdb, which is the gnu debugger that comes with the gcc compiler.   I usually don't bother with ddd, and just use gdb directly.  If you are using another compiler, you'll need to use a different debugger.  For example, if you compile with clang you'll need to use lldb.

Using debuggers with parallel builds is tricky so I'd definitely try it in serial first.  In parallel, debuggers like TotalView are generally a better choice.  You can attach gdb to MPI processes, but you probably only want to do that if running with a small number of MPI processes. 

good luck!

xyce-users

unread,
Feb 25, 2021, 12:34:53 AM2/25/21
to xyce-users

I meant to also add that if I know I'm going to be using a build for debugging, I usually don't bother compiling with a high level of optimization.   Mostly, because I know I'll be stopping the code a lot anyway, so I don't care that much about runtime performance, and I'd rather have a faster compile time.  So for that case I'll usually use " -O0" instead of "-O3".

Rich Zhang

unread,
Feb 25, 2021, 12:49:05 AM2/25/21
to xyce-users
Gotcha!!! I see what you mean, and I just added  one more line " CXXFLAGS="-gdwarf-2" \ "
But I still got funny places not the main function. 

Rich Zhang

unread,
Feb 25, 2021, 2:39:22 AM2/25/21
to xyce-users
I got the serial-build figured out!!!!! Thanks!
Reply all
Reply to author
Forward
0 new messages