[petsc-dev] Extra compiler flags for debugging
Satish Balay
balay at mcs.anl.gov
Mon Mar 23 11:26:06 CDT 2020
That's weird. Perhaps its related to using ccache..
you can verify by flushing its cache:
ccache -c -C
<recompile>
Satish
On Mon, 23 Mar 2020, Jacob Faibussowitsch wrote:
> > Because the code doesn't get recompiled when there are no changes.
> Subsequent recompiles of the code with any changes also don’t reproduce the warning. The only way the warning pops up again is if I change the problematic code to correct code, compile, change it back to problematic then compile again. And then the warning only ever “stays around” for one compile.
>
> Best regards,
>
> Jacob Faibussowitsch
> (Jacob Fai - booss - oh - vitch)
> Cell: (312) 694-3391
>
> > On Mar 23, 2020, at 11:16 AM, Satish Balay <balay at mcs.anl.gov> wrote:
> >
> > On Mon, 23 Mar 2020, Jacob Faibussowitsch wrote:
> >
> >> Hello all,
> >>
> >> I’m wondering if you guys use any extra compiler flags when debugging (other than -g3). I have noticed for example that when compiling I am only warned about something (i.e. wrong argument type for a function) once, so if I recompile the same program with no changes, the second compilation doesn’t reproduce the warning.
> >
> > Because the code doesn't get recompiled when there are no changes.
> >
> > You can use -Werror - this will force to fix all warnings. [This is what we do in the test pipelines for some of the jobs]
> >
> > Satish
> >
> >> Currently I use the default compiler flags that petsc generates for debugging support with MPICH:
> >>
> >> C Compiler: /Users/jacobfaibussowitsch/NoSync/petscpackages/bin/mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -g3
> >>
> >> Version: Apple clang version 11.0.0 (clang-1100.0.33.17)
> >>
> >> I’m mainly trying to find a 64-bit bug, so I have now added the “-ftrapv” flag to trap for integer overflows but there are probably more flags out there.
> >>
> >> Best regards,
> >>
> >> Jacob Faibussowitsch
> >> (Jacob Fai - booss - oh - vitch)
> >> Cell: (312) 694-3391
> >>
> >>
>
>
More information about the petsc-dev
mailing list