Thanks Jed, the PETSC_VERSION_GE macro will do the trick. I understand not wanting to be eternally backwards compatible; see Excel's wrong handling of leap years due to backwards compatibility with DOS-era Lotus Notes.
Regards, Åsmund Sent from my VT-102 Jed Brown <[email protected]> skrev: Åsmund Ervik <[email protected]> writes: > Ok, so PETSC_DEFAULT_REAL works fine with master but not with 3.4. > What are my options if I want to keep this simple? I can pretty much > guarantee that my colleagues and the test server won't all switch to > 3.5 simultaneously. Is there a better fix than hardcoding in the > default values? KSPSetTolerances is the only place where we use these. Historically, we have made a handful of interface changes in each PETSc release. It's expensive to maintain complete source compatibility (in general; not in this case) due to internal refactoring of interfaces, the fact that people never update their code if not forced to, and user confusion attempting to mix old and new ways of doing things. In C with supported compilers, I have been using deprecated "attributes" to mark deprecated functions that are relatively easy to preserve. (More major change, such as splitting SNESLineSearch into its own object, can't easily be handled this way.) Most users only have to change a few lines to upgrade to a new version. In this case, we could leave PETSC_DEFAULT_DOUBLE_PRECISION as an alias, though the misleading name may cause some confusion and since I don't know a general way to mark it deprecated in Fortran, people will continue to use it indefinitely. The general approach you can always use is #if PETSC_VERSION_GE(3,5,0) ... PETSC_DEFAULT_REAL #else ... PETSC_DEFAULT_DOUBLE_PRECISION #endif Unreleased versions of PETSc are +Infinity in the version comparison macros, so this works now and once petsc-3.5 is released.
