[petsc-users] PETSC_VERSION_GT doesn't behave as I would have expected

Stefano Zampini stefano.zampini at gmail.com
Wed Jul 1 04:57:03 CDT 2026


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 <
petsc-users at mcs.anl.gov> 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/__;!!G_uCfscf7eWS!eXtIe5AlCt-M_9NTY6mTYUFfAOSlre4lUJNgNeQL-KzEpNIlkhB-nENTTXc73Pm2jCf-mrxbN-EiQGg4BJEOajxm692uuQo$ 
> <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260701/6eb40e5c/attachment.html>


More information about the petsc-users mailing list