[petsc-dev] PETSC_UNUSED broken needs repair

Matthew Knepley knepley at gmail.com
Sun Aug 21 03:48:50 CDT 2011


On Sun, Aug 21, 2011 at 4:47 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>  Matt,
>
>     How do I fix this?  You want a release, you have to help us with all
> these bugs.


Okay, I will explain the fix and push it. You are only getting a warning for
this missing
attribute, and we agreed not to fail on warnings. However, we do search for
particular
warnings and fail. This logic is in BuildSystem/config/setCompilers.py:870

  def containsInvalidFlag(self, output):
    '''If the output contains evidence that an invalid flag was used, return
True'''
    if (output.find('Unrecognized command line option') >= 0 or
output.find('Unrecognised command line option') >= 0 or
        output.find('unrecognized command line option') >= 0 or
output.find('unrecognized option') >= 0 or output.find('unrecognised
option') >= 0 or
        output.find('not recognized') >= 0 or output.find('not recognised')
>= 0 or
        output.find('unknown option') >= 0 or output.find('unknown flag') >=
0 or output.find('Unknown switch') >= 0 or
        output.find('ignoring option') >= 0 or output.find('ignored') >= 0
or
        output.find('argument unused') >= 0 or
        # When checking for the existence of 'attribute'
        output.find('is unsupported and will be skipped') >= 0 or
        output.find('illegal option') >= 0 or output.find('Invalid option')
>= 0 or
        (output.find('bad ') >= 0 and output.find(' option') >= 0) or
        output.find('linker input file unused because linking not done') >=
0 or
        output.find('PETSc Error') >= 0 or
        output.find('Unbekannte Option') >= 0 or
        output.find('no se reconoce la opci') >= 0) or output.find('non
reconnue') >= 0:
      return 1
    return 0

  Thanks,

     Matt


>   Barry
>
> On Aug 20, 2011, at 9:43 PM, Jed Brown wrote:
>
> > On Thu, Aug 18, 2011 at 18:15, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> >  It happily sets the attribute even though the attribute does not exist.
> >
> > Well, you wrote that code. ;-)
> >
> > I think you only need checkCompile() and I guess it should check for
> warnings about unsupported attributes.
> >
> >
> >
> > TEST configureUnused from
> PETSc.Configure(/export/home/petsc/petsc-dev-3/config/PETSc/Configure.py:528)
> > TESTING: configureUnused from
> PETSc.Configure(/export/home/petsc/petsc-dev-3/config/PETSc/Configure.py:528)
> >  Sees if __attribute((unused)) is supported
> >        Pushing language Cxx
> > sh: /export/home/petsc/soft/mpich2-1.2.1p1/bin/mpicxx -c -o
> /tmp/petsc-VAqamh/PETSc.Configure/conftest.o
> -I/tmp/petsc-VAqamh/config.setCompilers -I/tmp/petsc-VAqamh/config.compilers
> -I/tmp/petsc-VAqamh/config.functions -I/tmp/petsc-VAqamh/config.types
> -I/tmp/petsc-VAqamh/PETSc.utilities.missing
> -I/tmp/petsc-VAqamh/config.libraries -I/tmp/petsc-VAqamh/PETSc.Configure
> -I/tmp/petsc-VAqamh/PETSc.utilities.scalarTypes  -g
> /tmp/petsc-VAqamh/PETSc.Configure/conftest.cc
> > Executing: /export/home/petsc/soft/mpich2-1.2.1p1/bin/mpicxx -c -o
> /tmp/petsc-VAqamh/PETSc.Configure/conftest.o
> -I/tmp/petsc-VAqamh/config.setCompilers -I/tmp/petsc-VAqamh/config.compilers
> -I/tmp/petsc-VAqamh/config.functions -I/tmp/petsc-VAqamh/config.types
> -I/tmp/petsc-VAqamh/PETSc.utilities.missing
> -I/tmp/petsc-VAqamh/config.libraries -I/tmp/petsc-VAqamh/PETSc.Configure
> -I/tmp/petsc-VAqamh/PETSc.utilities.scalarTypes  -g
> /tmp/petsc-VAqamh/PETSc.Configure/conftest.cc
> > sh:
> > Possible ERROR while running compiler: error message =
> {"/tmp/petsc-VAqamh/PETSc.Configure/conftest.cc", line 3: Warning: attribute
> unused is unsupported and will be skipped..
> > 1 Warning(s) detected.
> > }
> > Source:
> > #include "confdefs.h"
> > #include "conffix.h"
> > __attribute((unused)) static int myfunc(void){ return 1;}
> >
> > int main() {
> > int i = myfunc();
> > ;
> >  return 0;
> > }
> >                Pushing language CXX
> >                Popping language CXX
> > sh: /export/home/petsc/soft/mpich2-1.2.1p1/bin/mpicxx  -o
> /tmp/petsc-VAqamh/PETSc.Configure/conftest    -g
>  /tmp/petsc-VAqamh/PETSc.Configure/conftest.o  -ldl
> > Executing: /export/home/petsc/soft/mpich2-1.2.1p1/bin/mpicxx  -o
> /tmp/petsc-VAqamh/PETSc.Configure/conftest    -g
>  /tmp/petsc-VAqamh/PETSc.Configure/conftest.o  -ldl
> > sh:
> >        Defined "UNUSED" to "__attribute((unused))"
> >        Popping language Cxx
> >
> >
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110821/f5dcd8ff/attachment.html>


More information about the petsc-dev mailing list