[Insight-users] gprof and ccmake

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Jun 26 07:01:25 EDT 2007


Hi debbie,


  [Why are you sending an email on both ITK and VTK for a question
about CMake ?]

  Anyway you can set your user option for c/c++ compiler on the
CMAKE_C(XX)_FLAGS (advanced options). Or simply:

export CXXFLAGS='-pg'
ccmake /path/to/project
make
(you may need -fprofile-arcs on some gcc version).

As a side note, gprof will not profile your shared lib. You should
instead use valgrind (tool=callgrind), which is much easier to use,
and on top of that, you do not need to recompile anything.

HTH
-Mathieu

On 6/26/07, Tomáš Kazmar <Tomash.Kazmar at seznam.cz> wrote:
> Hi Deb,
>
>   you need to add the -pg switch like this:
>
> SET_TARGET_PROPERTIES(target_name PROPERTIES COMPILE_FLAGS -pg LINK_FLAGS -pg)
>
> Tomas
>
> # Hi,
> #
> # I would like to profile code generated through ccmake with gprof. What flags
> # do I need to set up when I run ccmake?
> # Thanks
> #
> # Deb
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


-- 
Mathieu


More information about the Insight-users mailing list