Dear Eike PETSC_VERSION_RELEASE is 1 only for tarballs or if you track/branched off the release branch Otherwise, if you branched off main, it is 0. The model behind is that new developments won't need to care about older versions. This means that, if you use a development version of PETSc obtained from git, we assume you'll keep updating it. Does it make sense to you? Il giorno mer 1 lug 2026 alle ore 11:51 Eike Mueller via petsc-users < [email protected]> ha scritto:
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/... <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
-- Stefano