[Dune] [DUNE] "config.h" in DUNE tutorials

Jö Fahlke jorrit at jorrit.de
Fri Nov 26 16:23:59 CET 2010


Am Fri, 26. Nov 2010, 13:20:11 +0000 schrieb Andreas Dedner:
> is there any way you can find out what the order of include paths is
> that eclipse is using?
> It seems to differ from the one used by g++.
> 
> So for example if I compile something in dune-grid-howto the compile
> command used is
> 
>   g++ -std=c++0x -DHAVE_CONFIG_H -I. 
> -I/home/maths/masjal/DUNE/dune-common
> -I/home/maths/masjal/DUNE/dune-grid ....
> 
> So the first include path is . and that is where the first config.h is
> found and therefore used.
> eclipse seems to use a different ordering?

Actually, the story is a wee bit more complicated.  Instead of the "-I." which
Andreas mentioned above, my compilation commands contains something like
"-I. -I. -I../..".  This comes from the variable $(DEFAULT_INCLUDES) in the
makefiles, which in this case has the value "-I. -I$(srcdir)
-I$(top_builddir)".  This means, first search the directory that g++ was run
in, then search the source directory corresponding to the current directory
(which can be different from "-I." for out-of-source builds), the check the
root directory of the current module in the build tree (again, this can be
different from the source tree for out-of-source builds).  The last one is the
directory where config.h should be found.

There are however more traps: if you happen to have some files named config.h
in one of your dune-modules anywhere but in the top of that modules tree, it
is possible that that file is used instead und certain circumstances.  This
however should also affect your compiler and result in failing builds.

Bye,
Jö.

-- 
Kiss a non-smoker; taste the difference.
-- fortune
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20101126/fe5430c8/attachment.sig>


More information about the Dune mailing list