[Dune] [#1216] DGFGridInfo and ALUConformGrid

Christoph GrĂ¼ninger christoph.grueninger at iws.uni-stuttgart.de
Wed Dec 5 06:48:37 CET 2012


Hi Martin,
this behavior is intended and is not a bug.

HAVE_ALUGRID is defined by the configure test from
dune-gird/m4/alugrid.m4 (or in the CMake branch the equivalent
dune-grid/cmake/modules/FindALUGrid.cmake) and indicates
whether ALUGrid was found (i. e. the header and the library).
If it is not found, any call to ALUGrid is suppressed in
alugrid.hh to avoid compiler or linker errors. All HAVE_*
macros are stored in the config.h that is generated by the
configure run. I advise you to generate a config.h by
configure and use that; maybe you must modify it by hand.

ENABLE_ALUGRID must be set for every program that should use
ALUGRID. The idea of the ENABLE_* macros is, that you can
easily switch features on and off, without modifing config.h
or Makefiles.
It is set in the Makefile.am (in Cmake it is CMakeLists.txt)
in the same directory. If you do not want to use these, you
would add -DENABLE_ALUGRID to your compile flags.

Your code example looks that ugly because you want to bypass
the Dune mechanism. It is intended to include only config.h
and to add the right flags.

Why do you not want to use the dune build tools? Have you
tried to call automake directly without dunecontrol? Do you
want to try the CMake branch?

Bye
Christoph


Dune <flyspray at dune-project.org> schrieb:
>Hi,
>I'm not sure if it is a bug, but:
>"dune/grid/alugrid.hh" uses "#if HAVE_ALUGRID"
>"dune/grid/io/file/dgfparser/dgfalu.hh" uses "#if defined ENABLE_ALUGRID"
>
>therefore something like:
>
>#define HAVE_ALUGRID 1
>#define ENABLE_ALUGRID 1
>#include <dune/grid/alugrid.hh>
>#include <dune/grid/io/file/dgfparser/dgfalu.hh>
>
>will always require both defines. As far as I have understood this enable_foo and have_foo things, one of them should only occur in the cxxflags?!? as im not using the dune build tools for my own project i set those defines my self in the source files.
>
>greetings martin




More information about the Dune mailing list