femtools/tests/test_multigrid.F90 needs a fix too:
#include "petscversion.h" needs to happen before the use statements too
In general, I don't like all this sprinkling of petsc version knowledge everywhere in the source tree. Can we do something like this:
file_that_needs_petsc.F90:
module foo
use bar #include "petsc_modules_maybe.h" implicit none #include "petsc_headers_maybe.h"
... Write code that is petsc version-agnostic end module foo
petsc_modules_maybe.h is something like
#ifdef HAVE_PETSC #ifdef HAVE_PETSC_MODULES use petsc #include "petscversion.h" #if PETSC_VERSION_MINOR == 0 use ... #endif #endif #endif
and so forth.
Can we then get away without sprinkling all the code with VecSqrt/VecSqrtAbs etc...?
« Back to merge proposal
femtools/ tests/test_ multigrid. F90 needs a fix too:
#include "petscversion.h" needs to happen before the use statements too
In general, I don't like all this sprinkling of petsc version knowledge everywhere in the source tree. Can we do something like this:
file_that_ needs_petsc. F90:
module foo
use bar modules_ maybe.h" headers_ maybe.h"
#include "petsc_
implicit none
#include "petsc_
...
Write code that is petsc version-agnostic
end module foo
petsc_modules_ maybe.h is something like
#ifdef HAVE_PETSC
#ifdef HAVE_PETSC_MODULES
use petsc
#include "petscversion.h"
#if PETSC_VERSION_MINOR == 0
use ...
#endif
#endif
#endif
and so forth.
Can we then get away without sprinkling all the code with VecSqrt/VecSqrtAbs etc...?