[petsc-dev] configureLibrary fails for c++11 projects

Junchao Zhang junchao.zhang at gmail.com
Tue Mar 23 10:17:00 CDT 2021


I would rather directly change the project to use CXXFLAGS instead of
CXXPPFLAGS.

--Junchao Zhang


On Tue, Mar 23, 2021 at 10:01 AM Satish Balay via petsc-dev <
petsc-dev at mcs.anl.gov> wrote:

> On Tue, 23 Mar 2021, Stefano Zampini wrote:
>
> > Just tried out of main, and and the include tests of a c++11 project fail
> > Below my fix, if we agree on, I'll make a MR
> >
> > diff --git a/config/BuildSystem/config/compilers.py
> > b/config/BuildSystem/config/compilers.py
> > index c96967e..44e4657 100644
> > --- a/config/BuildSystem/config/compilers.py
> > +++ b/config/BuildSystem/config/compilers.py
> > @@ -527,6 +527,8 @@ class Configure(config.base.Configure):
> >          if self.setCompilers.checkCompilerFlag(flag, includes,
> > body+body14):
> >            newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' +
> flag #
> > append flag to the old
> >            setattr(self.setCompilers,LANG+'FLAGS',newflag)
> > +          newflag = getattr(self.setCompilers,LANG+'PPFLAGS') + ' ' +
> flag
> > # append flag to the old
> > +          setattr(self.setCompilers,LANG+'PPFLAGS',newflag)
>
>
> https://gitlab.com/petsc/petsc/commit/ead1aa4045d7bca177e78933b9ca25145fc3c574
>
>           self.setCompilers.CXXPPFLAGS += ' ' + flag
>           newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' + flag #
> append flag to the old
>           setattr(self.setCompilers,LANG+'FLAGS',newflag)
>
> So the old code was setting 'PPFLAGS' - but this commit changed to
> 'FLAGS'. Maybe this flag is needed at both compile time and link time?
>
> So this project is somehow using CXXPPFLAGS - but not CXXFLAGS?
>
> I'm fine with adding it to PPFLAGS - duplicate listing hopefully shouldn't
> cause grief.
>
> Satish
>
> >            cxxdialect = 'C++14'
> >            self.addDefine('HAVE_'+LANG+'_DIALECT_CXX14',1)
> >            self.addDefine('HAVE_'+LANG+'_DIALECT_CXX11',1)
> > @@ -546,6 +548,8 @@ class Configure(config.base.Configure):
> >          if self.setCompilers.checkCompilerFlag(flag, includes, body):
> >            newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' +
> flag #
> > append flag to the old
> >            setattr(self.setCompilers,LANG+'FLAGS',newflag)
> > +          newflag = getattr(self.setCompilers,LANG+'PPFLAGS') + ' ' +
> flag
> > # append flag to the old
> > +          setattr(self.setCompilers,LANG+'PPFLAGS',newflag)
> >            cxxdialect = 'C++11'
> >            self.addDefine('HAVE_'+LANG+'_DIALECT_CXX11',1)
> >            break
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20210323/68b620a9/attachment.html>


More information about the petsc-dev mailing list