dune-grid-2.4.1 fails to build with UG 3.13.0
I wanted to build DUNE with the official tarballs (2.4.1), using UG (3.13.0) but dunecontrol fails to build dune-grid. I attached the error log.
I investigated the problem and line 348 of the error log shows:
In file included from /usr/local/include/ug/gm.h:62:0, from /home/misg/gsoc2016/dune/dune-grid-2.4.1/dune/grid/uggrid/ugincludes.hh:15, from /home/misg/gsoc2016/dune/dune-grid-2.4.1/dune/grid/uggrid.hh:46, from /home/misg/gsoc2016/dune/dune-grid-2.4.1/dune/grid/io/file/dgfparser/dgfug.hh:19, from /home/misg/gsoc2016/dune/dune-grid-2.4.1/dune/grid/io/file/dgfparser/dgfug.cc:5: /usr/local/include/ug/dimension.h:31:2: error: #error **** define at least dimension two OR three **** #error **** define at least dimension two OR three **** ^
After some researches, It appears that UG did the following change in its last version:
Rename macros _2 and _3 to UG_DIM_2 and UG_DIM_3 respectively, to avoid clashes with symbols of the same name in libc++. but
dune-grid-2.4.1/dune/grid/uggrid.hh still uses the
_3 macros instead of
UG_DIM_3 and thus causes the bug mentioned above.
Just replacing all
_3 macros respectively by
uggrid.hh fixes the bug and makes the build passes successfully.