<div dir="ltr"><div>I would rather directly change the project to use CXXFLAGS instead of CXXPPFLAGS.</div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 23, 2021 at 10:01 AM Satish Balay via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@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">On Tue, 23 Mar 2021, Stefano Zampini wrote:<br>
<br>
> Just tried out of main, and and the include tests of a c++11 project fail<br>
> Below my fix, if we agree on, I'll make a MR<br>
> <br>
> diff --git a/config/BuildSystem/config/compilers.py<br>
> b/config/BuildSystem/config/compilers.py<br>
> index c96967e..44e4657 100644<br>
> --- a/config/BuildSystem/config/compilers.py<br>
> +++ b/config/BuildSystem/config/compilers.py<br>
> @@ -527,6 +527,8 @@ class Configure(config.base.Configure):<br>
> if self.setCompilers.checkCompilerFlag(flag, includes,<br>
> body+body14):<br>
> newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' + flag #<br>
> append flag to the old<br>
> setattr(self.setCompilers,LANG+'FLAGS',newflag)<br>
> + newflag = getattr(self.setCompilers,LANG+'PPFLAGS') + ' ' + flag<br>
> # append flag to the old<br>
> + setattr(self.setCompilers,LANG+'PPFLAGS',newflag)<br>
<br>
<a href="https://gitlab.com/petsc/petsc/commit/ead1aa4045d7bca177e78933b9ca25145fc3c574" rel="noreferrer" target="_blank">https://gitlab.com/petsc/petsc/commit/ead1aa4045d7bca177e78933b9ca25145fc3c574</a><br>
<br>
self.setCompilers.CXXPPFLAGS += ' ' + flag<br>
newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' + flag # append flag to the old<br>
setattr(self.setCompilers,LANG+'FLAGS',newflag)<br>
<br>
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?<br>
<br>
So this project is somehow using CXXPPFLAGS - but not CXXFLAGS?<br>
<br>
I'm fine with adding it to PPFLAGS - duplicate listing hopefully shouldn't cause grief.<br>
<br>
Satish<br>
<br>
> cxxdialect = 'C++14'<br>
> self.addDefine('HAVE_'+LANG+'_DIALECT_CXX14',1)<br>
> self.addDefine('HAVE_'+LANG+'_DIALECT_CXX11',1)<br>
> @@ -546,6 +548,8 @@ class Configure(config.base.Configure):<br>
> if self.setCompilers.checkCompilerFlag(flag, includes, body):<br>
> newflag = getattr(self.setCompilers,LANG+'FLAGS') + ' ' + flag #<br>
> append flag to the old<br>
> setattr(self.setCompilers,LANG+'FLAGS',newflag)<br>
> + newflag = getattr(self.setCompilers,LANG+'PPFLAGS') + ' ' + flag<br>
> # append flag to the old<br>
> + setattr(self.setCompilers,LANG+'PPFLAGS',newflag)<br>
> cxxdialect = 'C++11'<br>
> self.addDefine('HAVE_'+LANG+'_DIALECT_CXX11',1)<br>
> break<br>
> <br>
> <br>
> <br>
<br>
</blockquote></div>