[petsc-dev] CFLAGS and COPTFLAGS

Barry Smith bsmith at mcs.anl.gov
Sun Jan 19 16:34:49 CST 2014


  
On Jan 19, 2014, at 2:05 PM, Jed Brown <jed at jedbrown.org> wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>   Summary
>> 
>>   The reason for the current model is that in the original plan
>>   —with-debugging=0 would providing good compiler optimization flags
>>   (for each system) without the user having to set them; if the user
>>   set them via COPTFLAGS then we did set them ourselves.
>> 
>>   Observations
>> 
>>    1) The “standard” for passing optimization flags to ./configure is
>>    CFLAGS=“-O3 crap” we don’t support this and this confuses users
>> 
>>    2) If we followed the standard and the user only set
>>    non-optimization flags with CFLAGS we would not turn on
>>    optimization when user might expect it (does this ever happen?)
> 
> Does it happen and would it be confusing?  I think it is not confusing,
> especially since it's what everyone else does.

   User runs

     —with-cc=cc CFLAGS=“-m64” —with-debugging=0  

   gets the same performance as 

     —with-cc=cc CFLAGS=“-m64” —with-debugging=1

    Can’t understand why.

    

    I don’t understand the problem with doing a little bit better than “what ever one else does”. The logic is trivial, just look for -O in CFLAGS and there is nothing to explain since users will get what they expect if they use CFLAGS=“-O3 -fast"

   Barry


> 
>>    3) We provide a different, “better" way of providing optimization
>>    flags and other CFLAGS, but know one knows about it.
>> 
>>    4) Our —with-debugging=0 optimization flags are pretty bad, we
>>    should improve them
>> 
>>    So choices are
>> 
>>     A) follow standard
> 
> I'm inclined to do this because it's less code and simpler logic, thus
> the easiest to explain.  If they don't set CFLAGS, of course we have to
> automatically choose reasonable defaults based on --with-debugging.




More information about the petsc-dev mailing list