Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

ifort and valgrind, missing debug symbols

MR
Beginner
1,307 Views
Hi, I'm trying to profile a medium size program with valgrind. All the source files are compiled with -g, then I run the code with valgrind --tool=callgrind my-executable When I look at the callgrind results using "kcachegrind", for the main program and for few subroutines I'm able to see the source code with profiling information, but for most subroutines I see "There is no source available for the following function ... This is because no debug information is present. Recompile source and redo the profile run". Now, I don't know whether I'm doing something wrong with ifort or with valgrind, so I'm starting asking here. Is there a way to make sure that ifort generates all debugging information about *all* the subroutines in the code, besides using -g ? Or does -g already provides all the available debug information (in which case I should look into valgrind options) ? Thank you very much, Marco Restelli
0 Kudos
1 Reply
Ron_Green
Moderator
1,307 Views
inlining can remove functions and subroutines. Either compile at -g -O0 or disable inlining.

linux: -finstrument-functions -g
Mac: finstrument-functions g save-temps

Make sure to see past cautions about valgrind use with Fortran - this tool is not Fortran friendly and will give false positives in the Fortran runtime library.

0 Kudos
Reply