<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hmm, would a pull request that required the compiler be C during the compile work? <div class=""><br class=""></div><div class=""> #if defined(PETSC_HAVE_CLOSURE) && !defined(__cplusplus)</div><div class=""><br class=""></div><div class="">Barry</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 24, 2020, at 11:29 AM, Fande Kong <<a href="mailto:fdkong.jd@gmail.com" class="">fdkong.jd@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Thanks for your reply, Jed.<div class=""><br class=""></div><div class=""><br class=""></div><div class="">Barry, do you have any comment?</div><div class=""><br class=""></div><div class="">Fande,</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 20, 2020 at 9:19 AM Jed Brown <<a href="mailto:jed@jedbrown.org" class="">jed@jedbrown.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Barry, this is a side-effect of your Swift experiment. Does that need to be in a header (even if it's a private header)?<br class="">
<br class="">
The issue may be that you test with a C compiler and it gets included in C++ source.<br class="">
<br class="">
Fande Kong <<a href="mailto:fdkong.jd@gmail.com" target="_blank" class="">fdkong.jd@gmail.com</a>> writes:<br class="">
<br class="">
> Hi All,<br class="">
><br class="">
> We (moose team) hit an error message when compiling PETSc, recently. The<br class="">
> error is related to "PETSC_HAVE_CLOSURE." Everything runs well if I am<br class="">
> going to turn this flag off by making the following changes:<br class="">
><br class="">
><br class="">
> git diff<br class="">
> diff --git a/config/BuildSystem/config/utilities/closure.py<br class="">
> b/config/BuildSystem/config/utilities/closure.py<br class="">
> index 6341ddf271..930e5b3b1b 100644<br class="">
> --- a/config/BuildSystem/config/utilities/closure.py<br class="">
> +++ b/config/BuildSystem/config/utilities/closure.py<br class="">
> @@ -19,8 +19,8 @@ class Configure(config.base.Configure):<br class="">
> includes = '#include <stdio.h>\n'<br class="">
> body = 'int (^closure)(int);'<br class="">
> self.pushLanguage('C')<br class="">
> - if self.checkLink(includes, body):<br class="">
> - self.addDefine('HAVE_CLOSURE','1')<br class="">
> +# if self.checkLink(includes, body):<br class="">
> +# self.addDefine('HAVE_CLOSURE','1')<br class="">
> def configure(self):<br class="">
> self.executeTest(self.configureClosure)<br class="">
><br class="">
><br class="">
> I was wondering if there exists a configuration option to disable "Closure"<br class="">
> C syntax? I did not find one by running "configuration --help"<br class="">
><br class="">
> Please let me know if you need more information.<br class="">
><br class="">
><br class="">
> Thanks,<br class="">
><br class="">
> Fande,<br class="">
><br class="">
><br class="">
> In file included from<br class="">
> /Users/milljm/projects/moose/scripts/../libmesh/src/solvers/petscdmlibmesh.C:25:<br class="">
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:29:<br class="">
> warning: 'PetscVFPrintfSetClosure' initialized and declared 'extern'<br class="">
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const<br class="">
> char*));<br class="">
> | ^~~~~~~~~~~~~~~~~~~~~~~<br class="">
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:53:<br class="">
> error: expected primary-expression before 'int'<br class="">
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const<br class="">
> char*));<br class="">
> | ^~~<br class="">
> CXX src/systems/libmesh_opt_la-equation_systems_io.lo<br class="">
> In file included from<br class="">
> /Users/milljm/projects/moose/petsc/include/petsc/private/dmimpl.h:7,<br class="">
> from<br class="">
> /Users/milljm/projects/moose/scripts/../libmesh/src/solvers/petscdmlibmeshimpl.C:26:<br class="">
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:29:<br class="">
> warning: 'PetscVFPrintfSetClosure' initialized and declared 'extern'<br class="">
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const<br class="">
> char*));<br class="">
> | ^~~~~~~~~~~~~~~~~~~~~~~<br class="">
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:53:<br class="">
> error: expected primary-expression before 'int'<br class="">
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const<br class="">
> char*));<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>