[Mrtrix-discussion] Debugging environment for MRtrix
Robert Smith
r.smith at brain.org.au
Thu Apr 11 18:08:02 PDT 2013
Hi Fernando & Jesse
Myself, I tend to do my debugging the old-school way; print statements for
checking variable values (make sure you use fprintf (stderr, ...) or std::cerr
<< ... as these are un-buffered), gdb for hunting down segmentation faults
and setting breakpoints, and valgrind for checking memory issues; I'm
pretty sure Donald is in the same boat. The TEST, VAR and TRACE macros
provided in the file lib/mrtrix.h also come in handy.
If you do want to use a GUI debugger (such as the one in Eclipse) it's
possible, though sometimes a little finicky. Rather than trying to
configure the software you are using to do the compilation, it's much
easier to specify MRtrix's build script as an 'external builder'. Depending
on how you normally set your LD_LIBRARY_PATH environment variable, you may
also have to explicitly include the lib/ folder of MRtrix in the debugging
software. The Eclipse CDT debugger is actually just an interface and
interpreter for gdb though, so I tend to find it more trouble than it's
worth.
Also just a reminder, regardless of whether you use an IDE such as Eclipse
for debugging or command-line debugging tools, it is essential that MRtrix
be compiled in debug mode. If it is currently compiled in 'release' mode
(i.e. default), you will need to run build clean to remove any and all
object files, binaries, and the shared library. Then when you re-compile
with build you must specify the -debug option.
Best regards
Rob
--
*Robert Smith*
Post-Doctoral Researcher, Imaging Division
The Florey Institute of Neuroscience and Mental Health
Melbourne Brain Centre - Austin Campus
245 Burgundy Street
Heidelberg Vic 3084
Ph: +61 3 9035 7128
Fax: +61 3 9035 7301
www.florey.edu.au
On Wed, Apr 10, 2013 at 9:03 PM, Fernando Garcia <
fernandogarcia.jm at gmail.com> wrote:
> Dear MRtrix Group,
>
> I start to work on fiber tracking and I would like to use MRtrix to make
> some test and experiments. I was trying to compile the code in windows
> following the instruction in:
> http://www.brain.org.au/software/mrtrix/install/windows.html but without
> any success. I tried in linux and I can make the build, however I want to
> use a debugging environment for example eclipse to get a better
> understanding and hopefully make some test with other algorithms. I have
> problems compiling the code using eclipse, and I was wondering if somebody
> might help me with some instructions to do that or which debugging
> environment I could use.
>
> Many thanks for your time and effort.
>
> your sincerely,
>
> Fernando Garcia
>
> --
> García, Fernando
> ------------------------------------
> MSc. in Informationstechnik
> Diplom.- Elektronik Ingenieur
> Hochschule Mannheim - University of Applied Sciences
> Paul-Wittsack-Str. 10, 68163 Mannheim
> Institut für Prozessmesstechnik und innovative Energiesysteme
> John-Deere-Str. 85/87, 68163 Mannheim
> Büro:+49 0621-761508-33
> Tel.: +49 (0) 176 25755924
> Festnetz: +49 0621 15208932
> Mail: fernandogarcia.jm at gmail.com
>
> _______________________________________________
> Mrtrix-discussion mailing list
> Mrtrix-discussion at www.nitrc.org
> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20130412/a677de92/attachment.html
More information about the Mrtrix-discussion
mailing list