[petsc-dev] CFLAGS and COPTFLAGS

Barry Smith bsmith at mcs.anl.gov
Fri Jan 17 19:00:25 CST 2014


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

> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>   The problem is that CFLAGS can have all kind of flags having
>>   nothing to do with optimization. 
> 
> Right.  Do we really need to classify and do things differently?

   Yes, What if they just set a single flag having nothing to do with optimization. This will turn off PETSc’s attempt to provide any kind of optimization flag (even with —with-debugging=0). I think this is bad. *

* yes we do a crummy job of selecting optimization flags, we should do better, but we shouldn’t leave no optimization just because they passed some CFLAG.

> 
>>   Could we do the following?
>> 
>>   Look through any provided CFLAGS (FFLAGS, CXXFLAGS) if we detect
>>   something that looks like optimization then act as if COPTFLAGS was
>>   set and do not set our own optimization default flag? We can also
>>   keep support for the COPTFLAGS stuff
>> 
>>   We can look for -O%d , are there other things to look for?  This seems easy enough to add.
> 
> -ftree-vectorize, -fast, -qhot -qsimd=auto

   So if they pass -fast then we simply don’t set any optimization flags ourself? We could do that.

   Barry





More information about the petsc-dev mailing list