Debugging ASCEND: Difference between revisions
Jump to navigation
Jump to search
Created page with '{{missing}} Category:Development' |
|||
| (12 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{missing}} | {{missing}} | ||
{{outdated}} | |||
===Reporting a bug=== | |||
There is a '''[http://bugs.ascend4.org Bug tracker]''' for ascend outside of this wiki. | |||
Some useful additional information relating to debugging: | |||
* about test suites (see [[CUnit]]) | |||
* using [[Valgrind]] to track down segfaults and memory leaks | |||
Also to be added here: | |||
* about Buildbot (currently inactive/offline) | |||
* using GDB | |||
* correct use of SVN during debugging on the trunk | |||
* using 'pygtk/ascdev' and 'tcltk/asc4dev' from within your working folder | |||
* possible library wrong-loading issues: <tt>export LD_LIBRARY_PATH=~/ascend</tt> for example, | |||
<div style="border:solid 1pt orange;padding:10px;margin-top:10px;margin-bottom:10px"> | |||
''“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. ” (Brian Kernighan)''</div> | |||
=== Using GDB === | |||
ASCEND loads its [[solvers]] from shared libraries using <tt>dlopen</tt>. This sometimes causes difficulties with libpthread.so when using <tt>gdb</tt> for debugging. A solution that sometimes works is along these lines (the exact file location may depend on your Linux distro) is given here. | |||
For example: | |||
cd ~/ascend | |||
scons -j4 DEBUG=1 test | |||
export MYASCEND=`pwd` && export ASCENDSOLVERS=$MYASCEND/solvers/ida:$MYASCEND/solvers/ipopt:$MYASCEND/solvers/lsode:$MYASCEND/solvers/qrslv:$MYASCEND/solvers/lrslv && export ASCENDLIBRARY=$MYASCEND/models && export ^C_LIBRARY_PATH=$MYASCEND | |||
LD_PRELOAD="/lib/i386-linux-gnu/libpthread.so.0" gdb --args test/test integrator_idaevent.test1 | |||
[[Category:Development]] | [[Category:Development]] | ||
Latest revision as of 11:49, 29 April 2015
The content from this page was lost in a recent server failure. We will be working to restore this content as soon as possible.
Reporting a bug
There is a Bug tracker for ascend outside of this wiki.
Some useful additional information relating to debugging:
Also to be added here:
- about Buildbot (currently inactive/offline)
- using GDB
- correct use of SVN during debugging on the trunk
- using 'pygtk/ascdev' and 'tcltk/asc4dev' from within your working folder
- possible library wrong-loading issues: export LD_LIBRARY_PATH=~/ascend for example,
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. ” (Brian Kernighan)
Using GDB
ASCEND loads its solvers from shared libraries using dlopen. This sometimes causes difficulties with libpthread.so when using gdb for debugging. A solution that sometimes works is along these lines (the exact file location may depend on your Linux distro) is given here. For example:
cd ~/ascend scons -j4 DEBUG=1 test export MYASCEND=`pwd` && export ASCENDSOLVERS=$MYASCEND/solvers/ida:$MYASCEND/solvers/ipopt:$MYASCEND/solvers/lsode:$MYASCEND/solvers/qrslv:$MYASCEND/solvers/lrslv && export ASCENDLIBRARY=$MYASCEND/models && export ^C_LIBRARY_PATH=$MYASCEND LD_PRELOAD="/lib/i386-linux-gnu/libpthread.so.0" gdb --args test/test integrator_idaevent.test1