On Nov 28, 2012, at 2:30 PM, Roy Stogner <royst...@ices.utexas.edu> wrote:

> On Wed, 28 Nov 2012, Kirk, Benjamin (JSC-EG311) wrote:
> 
>> If at all possible I'd rather treat that as --enable-gprof and add
>> the flags to the existing dbg, devel, opt flags
> 
> The trouble with this is that the gprof and oprof flags aren't without
> cost.  IIRC "-pg" adds in extra code (including synchronous writes to
> disk!!); "-fno-omit-frame-pointer" turns off an optimization that even
> "-O" includes by default; and I suppose even "-g" must have some cost
> or we'd have added it to METHOD=opt already.
> 
> So if you mix profiling with optimization, the result isn't really
> optimized.
> 
> But if you mix profiling with debug/devel modes, then your runtime
> data is all swamped by the costs of internal tests and disabled
> optimizations, so the result isn't really profiling.

Yeah, but with a --prefix you can put a pure opt somewhere and a gprof, 
oprofile, vtune, and whatever else comes along somewhere else.  To me anyway 
this is much preferable to maintaining multiple method rules and targets.

opt,dbg, and devel are materially different not so much because of the compiler 
flags (important, but doesn't change the fundamental nature of the code being 
compiled) but rather the CPPFLAGS - -DNDEBUG, -DDEBUG, <> respectively.

Aside - my understanding is the only cost to "-g" is file size, and there are 
'make install-strip' targets for that for those who care - it will strip the 
symbols at install time.  That's why the default CXXFLAGS unless you do 
something special become '-g -O2'.

-Ben


------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to