[petsc-users] Disable PETSC_HAVE_CLOSURE

Fande Kong fdkong.jd at gmail.com
Thu Aug 20 10:09:14 CDT 2020


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*));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200820/668cc36f/attachment.html>


More information about the petsc-users mailing list