[petsc-dev] reminder never use #include "mylocalinclude.h" in PETSc source

Jed Brown jed at 59A2.org
Sun Mar 13 23:34:10 CDT 2011


On Mon, Mar 14, 2011 at 05:01, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote:

> So it is okay to include headers from the source tree other than from
> under $PETSC_DIR/include?
> I thought the subject of this thread expressly banned that.
>

That is a style decision that is up to Barry and not something I was trying
to address in this latest patch.

Currently, most things uses <../src/path/to/localinclude.h> but there are a
handful of exceptions. I actually prefer using the "localinclude.h" instead
of <../src/path/to/localinclude.h> because the former is easier to relocate
and recompile (perhaps with a prefix-install where $PETSC_DIR/src is no
longer around). In other words, using "localinclude.h" makes stuff in
src/pkg/impls/xxx/ appear more like a standalone plugin which I think is a
good thing.

This email thread is pretty old now, I think there was some misunderstanding
of whether the compiler's $PWD affected header resolution (it doesn't) and
recall some possible IDE issues but don't know if they were resolved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110314/ece7f20b/attachment.html>


More information about the petsc-dev mailing list