Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config.h.in: use PETSc/SLEPc macros to determine PETSc/SLEPc version #15770

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 17 additions & 31 deletions include/deal.II/base/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -390,41 +390,27 @@
/*
* PETSc:
*
* Note: The following definitions will be set in petscconf.h and
* petscversion.h, so we don't repeat them here.
*
* PETSC_VERSION_MAJOR
* PETSC_VERSION_MINOR
* PETSC_VERSION_SUBMINOR
* PETSC_VERSION_PATCH
* PETSC_VERSION_RELEASE
* PETSC_USE_COMPLEX
*/

#define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
((PETSC_VERSION_MAJOR * 10000 + \
PETSC_VERSION_MINOR * 100 + \
PETSC_VERSION_SUBMINOR) \
< \
(major)*10000 + (minor)*100 + (subminor))
* Note: The following macros are defined in petscversion.h
* so we don't repeat them here.
*/

#define DEAL_II_PETSC_VERSION_GTE(major,minor,subminor) \
((PETSC_VERSION_MAJOR * 10000 + \
PETSC_VERSION_MINOR * 100 + \
PETSC_VERSION_SUBMINOR) \
>= \
(major)*10000 + (minor)*100 + (subminor))
#ifdef DEAL_II_WITH_PETSC
# define DEAL_II_PETSC_VERSION_LT(major,minor,subminor) \
PETSC_VERSION_LT(major,minor,subminor)
# define DEAL_II_PETSC_VERSION_GTE(major,minor,subminor) \
PETSC_VERSION_GE(major,minor,subminor)
#endif
Comment on lines +397 to +402
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have these been around for a long time? I believe that they didn't exist when I first wrote the interfaces for PETSc, but that was in 2004/2005. We've long not supported such old versions any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference is that the PETSc macros also test for PETSC_VERSION_RELEASE which is 1 for a release, 0 for any other commit which is not a tag. For example PETSC_VERSION_LT will always expand to 0 when developing, while PETSC_VERSION_GE will always expand to 1 in the same case.


/*
* SLEPC
* see slepcversion.h
* SLEPC:
*/
#define DEAL_II_SLEPC_VERSION_GTE(major,minor,subminor) \
((SLEPC_VERSION_MAJOR * 10000 + \
SLEPC_VERSION_MINOR * 100 + \
SLEPC_VERSION_SUBMINOR) \
>= \
(major)*10000 + (minor)*100 + (subminor))

#ifdef DEAL_II_WITH_SLEPC
# define DEAL_II_SLEPC_VERSION_LT(major,minor,subminor) \
SLEPC_VERSION_LT(major,minor,subminor)
# define DEAL_II_SLEPC_VERSION_GTE(major,minor,subminor) \
SLEPC_VERSION_GE(major,minor,subminor)
#endif

/*
* Trilinos:
Expand Down