<div class="gmail_quote">On Wed, Sep 19, 2012 at 6:25 AM, Eduardo <span dir="ltr"><<a href="mailto:erocha.ssa@gmail.com" target="_blank">erocha.ssa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":2rj">Is there a macro I can get the Petsc release? I'd like to link my code<br>
with libraries that are using a old version of Petsc. However, in the<br>
future these libraries may change to a newer version. So I want to<br>
write my code with ifdefs so that I can change from one version to the<br>
other easily.</div></blockquote></div><br><div>See include/petscversion.h</div><div><br></div><div>Starting in petsc-3.3, there are convenience macros PETSC_VERSION_LT() and PETSC_VERSION_LE(). You can add to your headers:</div>
<div><br></div><div>#if !defined(PETSC_VERSION_LT)</div><div># define PETSC_VERSION_LT (... copy from petscversion.h)</div><div>#endif</div><div><br></div><div>then in your source,</div><div><br></div><div>#if PETSC_VERSION_LE(3,3,0) /* last version doing it the old way */</div>
<div> the old way</div><div>#else</div><div> the new way</div><div>#endif</div>