<div dir="ltr"><div>This is a know issue with that old GCC v4.8. </div><div><br></div><div>Perhaps we should add some code checking for the GCC version macros in the complex workaround implementation file to skip offending lines (or everything) ?</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 16 May 2021 at 18:41, Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I checked and found PetscComplex was correctly defined to std::complex, and clang-6.0 was also fine to use GNU C++ library.  The problem was the gcc-4.8.5 C++ library clang picked up was a bit old, which conformed to C++11. However clang-6.0's default uses C++14, which changed the rules of <i>constexpr.</i><br></div><div>Workarounds include:<br></div><ul><li>define PETSC_SKIP_CXX_COMPLEX_FIX  in the offending *.cxx file.</li><li>add CXXOPTFLAGS=-std=c++11 </li><li>update clang-6.o or gcc-4.8.5 (of 2015) on that machine. </li></ul><div><div dir="ltr"><div dir="ltr">--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 14, 2021 at 10:42 AM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You can login to: <a href="http://isdp001.cels.anl.gov" rel="noreferrer" target="_blank">isdp001.cels.anl.gov</a> - using your MCS account credentials [and then setup ~/.ssh/authorized_keys]<br>
<br>
Satish<br>
<br>
On Fri, 14 May 2021, Junchao Zhang wrote:<br>
<br>
> Satish, how to access this machine? I want to know why complex is screwed<br>
> up.<br>
> <br>
> --Junchao Zhang<br>
> <br>
> <br>
> On Thu, May 13, 2021 at 7:08 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
> <br>
> > Nope. I will use your fix.<br>
> ><br>
> >   Thanks,<br>
> ><br>
> >      Matt<br>
> ><br>
> > On Thu, May 13, 2021 at 7:55 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
> ><br>
> >> I am going to try just including petscsys.h and see if it works.<br>
> >><br>
> >>   Thanks,<br>
> >><br>
> >>      Matt<br>
> >><br>
> >> On Thu, May 13, 2021 at 6:23 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> >><br>
> >>> This gets the build going...<br>
> >>><br>
> >>> diff --git a/src/sys/dll/cxx/demangle.cxx b/src/sys/dll/cxx/demangle.cxx<br>
> >>> index 31810ea15f..793a97d285 100644<br>
> >>> --- a/src/sys/dll/cxx/demangle.cxx<br>
> >>> +++ b/src/sys/dll/cxx/demangle.cxx<br>
> >>> @@ -1,3 +1,4 @@<br>
> >>> +#define PETSC_SKIP_COMPLEX<br>
> >>>  #include <petsc/private/petscimpl.h><br>
> >>><br>
> >>>  #ifdef PETSC_HAVE_CXXABI_H<br>
> >>><br>
> >>> Satish<br>
> >>><br>
> >>> On Thu, 13 May 2021, Satish Balay wrote:<br>
> >>><br>
> >>> > >         CXX arch-ci-linux-clang-avx/obj/sys/dll/cxx/demangle.o<br>
> >>> ><br>
> >>> > It is built with a c++ compiler - so __cplusplus should be defined.<br>
> >>> [PETSC_HAVE_CXXABI is not defined]<br>
> >>> ><br>
> >>> > Do you need to build this sourcefile file in a clanguage=C build?<br>
> >>> ><br>
> >>> > I'm not sure if a c++/complex build  is checked with this compiler.<br>
> >>> ><br>
> >>> > [eventhough its clang build - I see the compiler is using system<br>
> >>> incldues aka from gcc-4.8.5 - so perhaps some things don't work?]<br>
> >>> ><br>
> >>> > One option is to add the following to this sourcefile:<br>
> >>> ><br>
> >>> > #define PETSC_SKIP_COMPLEX<br>
> >>> ><br>
> >>> > Satish<br>
> >>> ><br>
> >>> ><br>
> >>> > On Thu, 13 May 2021, Matthew Knepley wrote:<br>
> >>> ><br>
> >>> > > In this CI run (linux-clang-avg):<br>
> >>> > ><br>
> >>> > >   <a href="https://gitlab.com/petsc/petsc/-/jobs/1260342204" rel="noreferrer" target="_blank">https://gitlab.com/petsc/petsc/-/jobs/1260342204</a><br>
> >>> > ><br>
> >>> > > The compile fails building a C++ file, demangle.cxx. It fails at the<br>
> >>> first<br>
> >>> > > line,<br>
> >>> > > including <petsc/private/petscimpl.h>, down in petscsystypes.h. It<br>
> >>> bombs<br>
> >>> > > during the definition of complex because it looks like the compiler<br>
> >>> is not<br>
> >>> > > defining __cplusplus, and thus takes the wrong branch. Is this what<br>
> >>> is<br>
> >>> > > happening?<br>
> >>> > > I cannot access this machine.<br>
> >>> > ><br>
> >>> > >   Thanks,<br>
> >>> > ><br>
> >>> > >       Matt<br>
> >>> > ><br>
> >>> > ><br>
> >>> ><br>
> >>> ><br>
> >>><br>
> >>><br>
> >><br>
> >> --<br>
> >> What most experimenters take for granted before they begin their<br>
> >> experiments is infinitely more interesting than any results to which their<br>
> >> experiments lead.<br>
> >> -- Norbert Wiener<br>
> >><br>
> >> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
> >> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
> >><br>
> ><br>
> ><br>
> > --<br>
> > What most experimenters take for granted before they begin their<br>
> > experiments is infinitely more interesting than any results to which their<br>
> > experiments lead.<br>
> > -- Norbert Wiener<br>
> ><br>
> > <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
> > <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
> ><br>
> <br>
<br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Senior Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>