[petsc-dev] Are there both a function AND a #define to retrieve PETSc version?

Jed Brown jed at jedbrown.org
Sun Aug 28 23:36:34 CDT 2016

Barry Smith <bsmith at mcs.anl.gov> writes:

>    We could also provide a 
>    PetscVersionRequired(major_a,minor_a,subminor_a,major_b,minor_b,subminor_b)  which does both a compile and runtime check
> that     version_a <= version < version_b. For example
>     PetscVersionRequired(3,7,3,3,8,0) says it supports 3.7.3 and all patches in 3.7.* after it.

We already have PETSC_VERSION_GE(3,7,3) for compile-time checks.  If we
make PetscInitialize check for ABI compatibility, then I think we've
covered the common case.  I'd rather people not put an upper limit in
their source code because it would mean they need to edit it to upgrade
PETSc.  I have no problem with a run-time PetscVersionRequired(3,7,3),
but I don't know if users would rather generate their own error message
in this case.  But I don't have a strong opinion either way here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160828/f25f4354/attachment.sig>

More information about the petsc-dev mailing list