[petsc-users] Disable PETSC_HAVE_CLOSURE
Jed Brown
jed at jedbrown.org
Thu Aug 20 10:19:43 CDT 2020
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)?
The issue may be that you test with a C compiler and it gets included in C++ source.
Fande Kong <fdkong.jd at gmail.com> writes:
> Hi All,
>
> We (moose team) hit an error message when compiling PETSc, recently. The
> error is related to "PETSC_HAVE_CLOSURE." Everything runs well if I am
> going to turn this flag off by making the following changes:
>
>
> git diff
> diff --git a/config/BuildSystem/config/utilities/closure.py
> b/config/BuildSystem/config/utilities/closure.py
> index 6341ddf271..930e5b3b1b 100644
> --- a/config/BuildSystem/config/utilities/closure.py
> +++ b/config/BuildSystem/config/utilities/closure.py
> @@ -19,8 +19,8 @@ class Configure(config.base.Configure):
> includes = '#include <stdio.h>\n'
> body = 'int (^closure)(int);'
> self.pushLanguage('C')
> - if self.checkLink(includes, body):
> - self.addDefine('HAVE_CLOSURE','1')
> +# if self.checkLink(includes, body):
> +# self.addDefine('HAVE_CLOSURE','1')
> def configure(self):
> self.executeTest(self.configureClosure)
>
>
> I was wondering if there exists a configuration option to disable "Closure"
> C syntax? I did not find one by running "configuration --help"
>
> Please let me know if you need more information.
>
>
> Thanks,
>
> Fande,
>
>
> In file included from
> /Users/milljm/projects/moose/scripts/../libmesh/src/solvers/petscdmlibmesh.C:25:
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:29:
> warning: 'PetscVFPrintfSetClosure' initialized and declared 'extern'
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const
> char*));
> | ^~~~~~~~~~~~~~~~~~~~~~~
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:53:
> error: expected primary-expression before 'int'
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const
> char*));
> | ^~~
> CXX src/systems/libmesh_opt_la-equation_systems_io.lo
> In file included from
> /Users/milljm/projects/moose/petsc/include/petsc/private/dmimpl.h:7,
> from
> /Users/milljm/projects/moose/scripts/../libmesh/src/solvers/petscdmlibmeshimpl.C:26:
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:29:
> warning: 'PetscVFPrintfSetClosure' initialized and declared 'extern'
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const
> char*));
> | ^~~~~~~~~~~~~~~~~~~~~~~
> /Users/milljm/projects/moose/petsc/include/petsc/private/petscimpl.h:15:53:
> error: expected primary-expression before 'int'
> 15 | PETSC_EXTERN PetscErrorCode PetscVFPrintfSetClosure(int (^)(const
> char*));
More information about the petsc-users
mailing list