Debian stretch / release 2.6: dune-grid fails to compile with only default system installed uggrid available
Just tested on my new Debian stretch machine. I have the Debian dune packages (including dune-uggrid) installed on the system. When I try to build the release branch in my home directory without dune-uggrid lying around, it seems like dune-uggrid 2.5 gets used and the compilation fails with:
[ 2%] Building CXX object lib/CMakeFiles/dunegrid.dir/__/dune/grid/io/file/dgfparser/dgfug.cc.o
In file included from ...uggrid.hh:63:0,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
...uggrid/ugwrapper.hh: In static member function ‘static void* Dune::UG_NS<2>::CreateDomain(const char*, int, int)’:
...uggrid/ugwrapper.hh:1083:65: error: invalid conversion from ‘int’ to ‘const DOUBLE* {aka const double*}’ [-fpermissive]
return UG_NAMESPACE ::CreateDomain(name, segments, corners);
^
...uggrid/ugwrapper.hh:1083:65: error: too few arguments to function ‘void* UG::D2::CreateDomain(const char*, const DOUBLE*, UG::DOUBLE, UG::INT, UG::INT, UG::INT)’
In file included from ...uggrid/ugincludes.hh:16:0,
from ...uggrid.hh:58,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
/usr/include/ug/std_domain.h:97:27: note: declared here
void *CreateDomain (const char *name, const DOUBLE *MidPoint,
^~~~~~~~~~~~
In file included from ...uggrid.hh:63:0,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
...uggrid/ugwrapper.hh: In static member function ‘static void* Dune::UG_NS<2>::CreateBoundarySegment(const char*, int, int, int, UG::INT*, const double*, const double*, UG::D2::BndSegFuncPtr, void*)’:
...uggrid/ugwrapper.hh:1109:59: error: invalid conversion from ‘UG::INT* {aka int*}’ to ‘UG::INT {aka int}’ [-fpermissive]
userData);
^
...uggrid/ugwrapper.hh:1109:59: error: cannot convert ‘const double*’ to ‘const INT* {aka const int*}’ for argument ‘7’ to ‘void* UG::D2::CreateBoundarySegment(const char*, UG::INT, UG::INT, UG::INT, UG::D2::BoundaryType, UG::INT, const INT*, const DOUBLE*, const DOUBLE*, UG::D2::BndSegFuncPtr, void*)’
In file included from ...uggrid.hh:102:0,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
...uggrid/ugwrapper.hh: In static member function ‘static void* Dune::UG_NS<3>::CreateDomain(const char*, int, int)’:
...uggrid/ugwrapper.hh:1083:65: error: invalid conversion from ‘int’ to ‘const DOUBLE* {aka const double*}’ [-fpermissive]
return UG_NAMESPACE ::CreateDomain(name, segments, corners);
^
...uggrid/ugwrapper.hh:1083:65: error: too few arguments to function ‘void* UG::D3::CreateDomain(const char*, const DOUBLE*, UG::DOUBLE, UG::INT, UG::INT, UG::INT)’
In file included from ...uggrid/ugincludes.hh:16:0,
from ...uggrid.hh:97,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
/usr/include/ug/std_domain.h:97:27: note: declared here
void *CreateDomain (const char *name, const DOUBLE *MidPoint,
^~~~~~~~~~~~
In file included from ...uggrid.hh:102:0,
from ...io/file/dgfparser/dgfug.hh:19,
from ...io/file/dgfparser/dgfug.cc:7:
...uggrid/ugwrapper.hh: In static member function ‘static void* Dune::UG_NS<3>::CreateBoundarySegment(const char*, int, int, int, UG::INT*, const double*, const double*, UG::D3::BndSegFuncPtr, void*)’:
...uggrid/ugwrapper.hh:1109:59: error: invalid conversion from ‘UG::INT* {aka int*}’ to ‘UG::INT {aka int}’ [-fpermissive]
userData);
^
...uggrid/ugwrapper.hh:1109:59: error: cannot convert ‘const double*’ to ‘const INT* {aka const int*}’ for argument ‘7’ to ‘void* UG::D3::CreateBoundarySegment(const char*, UG::INT, UG::INT, UG::INT, UG::D3::BoundaryType, UG::INT, const INT*, const DOUBLE*, const DOUBLE*, UG::D3::BndSegFuncPtr, void*)’
lib/CMakeFiles/dunegrid.dir/build.make:158: die Regel für Ziel „lib/CMakeFiles/dunegrid.dir/__/dune/grid/io/file/dgfparser/dgfug.cc.o“ scheiterte
make[2]: *** [lib/CMakeFiles/dunegrid.dir/__/dune/grid/io/file/dgfparser/dgfug.cc.o] Fehler 1
CMakeFiles/Makefile2:4059: die Regel für Ziel „lib/CMakeFiles/dunegrid.dir/all“ scheiterte
make[1]: *** [lib/CMakeFiles/dunegrid.dir/all] Fehler 2
Makefile:160: die Regel für Ziel „all“ scheiterte
make: *** [all] Fehler 2
$ grep uggrid CMakeCache.txt
dune-uggrid_DIR:UNINITIALIZED=/usr/lib/x86_64-linux-gnu/cmake/dune-uggrid
$grep UG config.h
#define HAVE_DUNE_UGGRID 1
#define DUNE_MINIMAL_DEBUG_LEVEL 4
#define DUNE_UGGRID_VERSION "2.5.0"
#define DUNE_UGGRID_VERSION_MAJOR 2
#define DUNE_UGGRID_VERSION_MINOR 5
#define DUNE_UGGRID_VERSION_REVISION 0
/* If this is set, the operating system heap is used instead of UG's own heap
/* #undef UG_USE_SYSTEM_HEAP */
/* UG memory allocation model */
#define PACKAGE_BUGREPORT "dune-devel@lists.dune-project.org"
/* This is only true if UG was found by configure _and_ if the application
uses the UG_CPPFLAGS */
#define HAVE_UG ENABLE_UG
/* UGGRID not available, enable with cmake variable DUNE_GRID_GRIDTYPE_SELECTOR=ON */
The problem is that we suggest dune-uggrid without any version. Unfortunately, if we just adding the version information to dune.module Suggests: dune-uggrid (>=2.6)
, cmake errors out with
CMake error at /.../dune-common/cmake/modules/DuneMacros.cmake:261 (message):
Could not find requested version of module dune-uggrid. Requested version
was >=2.6, found version is 2.5.0
Call Stack (most recent call first):
/.../dune-common/cmake/modules/DuneMacros.cmake:421 (find_dune_package)
/.../dune-common/cmake/modules/DuneMacros.cmake:468 (dune_process_dependency_leafs)
/.../dune-common/cmake/modules/DuneMacros.cmake:488 (dune_create_dependency_leafs)
/.../dune-common/cmake/modules/DuneMacros.cmake:638 (dune_create_dependency_tree)