[petsc-users] PETSC_VERSION_GT doesn't behave as I would have expected
Eike Mueller
em459 at bath.ac.uk
Wed Jul 1 04:51:22 CDT 2026
Dear PETSc developers,
I’m using a code which checks
#if PETSC_VERSION_GT(3, 24, 5)
// do something
#endif
For my PETSc installation I have:
#define PETSC_VERSION_RELEASE 0
#define PETSC_VERSION_MAJOR 3
#define PETSC_VERSION_MINOR 24
#define PETSC_VERSION_SUBMINOR 4
Looking at petscversion.h, I believe that PETSC_VERSION_GT(3, 24, 5) will always evaluate to true since PETSC_VERSION_RELEASE==0. This confused me, since there is no mention of PETSC_VERSION_RELEASE in the documentation at https://urldefense.us/v3/__https://petsc.org/release/manual/versionchecking/__;!!G_uCfscf7eWS!fqRtEQeeX09t_o3xjWfEQaGE6FLfl_LQJL5iDNuMqoG9vC1TBTGaRNcGyGudQlPsSk2TVNBaw04iNpZYFiAKbA$
Is this intended behaviour? Is there a good way of checking the version irrespective of RELEASE? I can of course always copy and modify the definition of PETSC_VERSION_LT and remove the PETSC_VERSION_RELEASE == 1 bit, but that’s probably not the best solution.
Thanks a lot,
Eike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260701/9699b895/attachment.html>
More information about the petsc-users
mailing list