[petsc-users] Cannot convert error

Barry Smith bsmith at mcs.anl.gov
Wed Sep 19 07:55:55 CDT 2012


On Sep 19, 2012, at 6:49 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Wed, Sep 19, 2012 at 6:25 AM, Eduardo <erocha.ssa at gmail.com> wrote:
> Is there a macro I can get the Petsc release? I'd like to link my code
> with libraries that are using a old version of Petsc. However, in the
> future these libraries may change to a newer version. So I want to
> write my code with ifdefs so that I can change from one version to the
> other easily.
> 
> See include/petscversion.h
> 
> Starting in petsc-3.3, there are convenience macros PETSC_VERSION_LT() and PETSC_VERSION_LE(). You can add to your headers:
> 
> #if !defined(PETSC_VERSION_LT)
> #  define PETSC_VERSION_LT (... copy from petscversion.h)
> #endif
> 
> then in your source,
> 
> #if PETSC_VERSION_LE(3,3,0) /* last version doing it the old way */
>   the old way
> #else
>   the new way
> #endif

  Since PETSc is user installable we don't recommend taking this route. We recommend just always developing and user your code with the latest PETSc release.

    Barry



More information about the petsc-users mailing list