[petsc-dev] CFLAGS and COPTFLAGS

Barry Smith bsmith at mcs.anl.gov
Sun Jan 19 19:24:53 CST 2014


On Jan 19, 2014, at 7:16 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Sun, Jan 19, 2014 at 7:13 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> On Jan 19, 2014, at 6:23 PM, Satish Balay <balay at mcs.anl.gov> wrote:
> 
> > On Sun, 19 Jan 2014, Jed Brown wrote:
> >
> >> Barry Smith <bsmith at mcs.anl.gov> writes:
> >>
> >>>   Nope because in my previous assignment I asked Satish to check for
> >>>   -O stuff in compiler wrappers as well as CFLAGS.
> >>
> >> So if a user builds with MPICH, they'll get different optimization
> >> options than building with Open MPI, simply because MPICH includes -O2
> >> in the wrapper?
> >>
> >>>> and some compilers have funny names for
> >>>> optimization flags.
> >>>
> >>>   This is a small possibility because normally there is a -Od as well
> >>>   as the funny named other stuff. If we come upon another funny name
> >>>   that replaces -Od we can incorporate that as well.
> >>
> >> I'm just not wild about being in the business of classifying which
> >> options are related to optimization.
> >
> > Perhaps swapping the order from '$CFLAGS $COPTFLAGS' to '$COPTFLAGS
> > $CFLAGS' will suffice.
> 
>    No, this needs to be done right. Turn off PETSc setting optimization flags if mpicc or CFLAGS attempts to set them.
> 
> I agree with Jed that this is problematic. We will end up fixing false positives with this,

   What do you mean fix false positives? We look for -O, if it is in mpicc or CFLAGS we don’t set our own, how will there be false positives?

> only it will not
> be a user error anymore (using CFLAGS instead of COPTFLAGS as indicated in the docs), it will be
> our error, and it will waste our time looking for it.

   We will keep COPTFLAGS for people who want to use it and keep the documentation as is. But by handling -O in CFLAGS we will correctly handle 99% of the autoconf gear heads who automatically type CFLAGS=“-O3”   (As if they have a clue what optimization flag should be set)

   Look it is configuration, there is never a perfect answer. 

   Barry



> 
>    Matt
>  
>    Barry
> 
> >
> > Satish
> 
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list