[Dune] FW: Problems with installation of DUNE core modules (in particular, with dune-grid-howto)

Christian Engwer christian.engwer at uni-muenster.de
Sun Nov 6 11:39:17 CET 2011


Hi Andrea, dear all,

I had a look into the example, the problem is that the current
implementation of persistentmap does improperly use the allocator of
the value_type instead of the proper allocator the internal data
structure. The linux gcc does allow this usage, in general you have to
use a rebind.

I fix this in the trunk, but I assume you are using 2.1.0. Could you
please test the attached patch with your code.

Christian

On Sun, Nov 06, 2011 at 10:10:12AM +0000, Sacconi, Andrea wrote:
> Hi all,
> 
> I'm trying to install DUNE core modules, but I have still a problem.
> I downloaded the six core modules, I put them in the same folder and then typed
> 
>   ./dune-common/bin/dunecontrol all
> 
> as per instructions. All works well for dune-common, dune-grid and dune-istl, but the process fails with dune-grid-howto.
> This is the message that appears on my screen:
> 
> finitevolumeadapt.hh:132:   instantiated from ‘bool finitevolumeadapt(G&, M&, V&, int, int, int) [with G = Dune::YaspGrid<2>, M = Dune::LeafMultipleCodimMultipleGeomTypeMapper<Dune::YaspGrid<2>, Dune::MCMGElementLayout>, V = std::vector<double, std::allocator<double> >]’
> adaptivefinitevolume.cc:34:   instantiated from ‘void timeloop(G&, double, int, int) [with G = Dune::YaspGrid<2>]’
> adaptivefinitevolume.cc:122:   instantiated from here
> /usr/include/c++/4.0.0/bits/stl_tree.h:367: error: no matching function for call to ‘std::allocator<RestrictedValue>::construct(std::pair<const Dune::bigunsignedint<58>, RestrictedValue>*, const std::pair<const Dune::bigunsignedint<58>, RestrictedValue>&)’
> /usr/include/c++/4.0.0/ext/new_allocator.h:103: note: candidates are: void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const _Tp&) [with _Tp = RestrictedValue]
> make[2]: *** [adaptivefinitevolume-adaptivefinitevolume.o] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> --- Failed to build dune-grid-howto ---
> Terminating dunecontrol due to previous errors!
> 
> I can't understand where I'm doing wrong.
> Yesterday I created a very simple project, containing only one source file (Hello world), and it worked perfectly. Maybe it did since it didn't require dependencies I'm not able to install.
> Other info: MAC OS 10.5.8, gcc 4.2.1.
> 
> Cheers,
> 
> Andrea
> 
> 
> _____________________________________
> Andrea Sacconi
> PhD student, Applied Mathematics
> Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk

> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-------------- next part --------------
commit 406b191be041ec52ef51cd9936b083bb1775740c
Author: christi <christi at f82f27de-4411-0410-b156-930a902cda50>
Date:   Sun Nov 6 10:38:24 2011 +0000

    [persistentcontainer]
    
    properly rebind the allocator.
    
    git-svn-id: https://svn.dune-project.org/svn/dune-grid/trunk@7729 f82f27de-4411-0410-b156-930a902cda50

diff --git a/dune/grid/utility/persistentcontainer.hh b/dune/grid/utility/persistentcontainer.hh
index fb4ac16..19745a5 100644
--- a/dune/grid/utility/persistentcontainer.hh
+++ b/dune/grid/utility/persistentcontainer.hh
@@ -425,14 +425,17 @@ namespace Dune
   class PersistentContainer
   : public PersistentContainerMap< Grid, typename Grid::Traits::LocalIdSet, 
              std::map<const typename Grid::Traits::LocalIdSet::IdType, Data, 
-                      std::less<const typename Grid::Traits::LocalIdSet::IdType>, Allocator> >
+                      std::less<const typename Grid::Traits::LocalIdSet::IdType>,
+                      typename Allocator::rebind<const typename Grid::Traits::LocalIdSet::IdType>::other > >
   {
   public:  
     typedef Grid GridType;
   protected:  
     typedef typename Grid::Traits::LocalIdSet IdSet;
     typedef typename IdSet::IdType IdType;
-    typedef std::map<const IdType, Data, std::less<const IdType>, Allocator> Map;
+    typedef typename Allocator::rebind<IdType>::other > Allocator;
+    typedef std::map<const IdType, Data, std::less<const IdType>,
+                     Allocator> Map;
     typedef PersistentContainerMap< Grid, IdSet, Map > BaseType;
 
   public:


More information about the Dune mailing list