-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi again guys,
Our nightly Jenkins run revealed that PETSC_VERSION_GE does not work well with ifort (version 14.0). (It works fine with gfortran and pgf90.) ifort produces the error message petscmod.F90(232): #error: #if: syntax error. I couldn't figure out much from this error message, but the following seems to work on all our compilers: #if (PETSC_MAJOR >= 3) && (PETSC_MINOR >= 5) ... PETSC_DEFAULT_REAL #else ... PETSC_DEFAULT_DOUBLE_PRECISION #endif Best regards, Åsmund On 06. feb. 2014 17:06, Jed Brown wrote: > Å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. > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS+z0OAAoJED+FDAHgGz19PZ4IAKIIvdj8JhK6QHM3kyCH32Q8 pmQ2oI1N4Ua2hlJMiHefixwVE8vbT68QD9cr3h//wDMgM0JKYYyvsmH2KDmUeRbS VL64SlK+dAnVdTYfqNqDKKEUErznjy/YyByM8IznlYEstgBU3aEoVCb1SHRRQPIF Q64yTqmGVmxmRkvlUqP4dMxgYjhKf5fI7tZXfpHNLrin7sCpl0VUM56N5+J/hKZ5 Cj2GFeoiTAccxaM6pyRn9M4yWuZbXpdK4SA6jqyZmbwhJMiM1zUF4Mod/QzlUdeU 4ygmSyWQeD/h+6pffv0NxGaegpc/fXErrwBYn4P27BRrYzQNSY5UMLpstg89z+w= =yB9t -----END PGP SIGNATURE-----
