[Dune] Dune-cornerpoint migration to Windows
Atgeirr Rasmussen
Atgeirr.Rasmussen at sintef.no
Tue Mar 29 15:17:19 CEST 2011
Dear Mr. Montilla,
Please note that dune-cornerpoint is not a core dune module, and is as such not maintained by the dune core developers. Any questions regarding the module should be directed to Bård Skaflestad (bard.skaflestad at sintef.no<mailto:bard.skaflestad at sintef.no>) or myself, Atgeirr Flø Rasmussen (atgeirr at sintef.no<mailto:atgeirr at sintef.no>).
Since I happen to read the dune mailing list, you are in luck...
Den 29. mars 2011 kl. 14.26 skrev Guillermo Montilla:
Dear Dune subscribers;
I am writing to request your support, which I will appreciate greatly.
I'm migrating dune-cornerpoint to Visual C++ (Microsoft Windows), using the version of the following link
https://public.ict.sintef.no/openrs/svn/trunk/dune-cornerpoint/common/
You should be aware that we have switched to a new version control system, mercurial (Hg). The new repository is at
https://public.ict.sintef.no/opm/hg/dune-cornerpoint/, and contains some changes since we stopped updated the svn repo,
in particular unit conversions in the GRDECL reader.
We will remove the old svn repo, but have not done so yet.
You should have a fairly new version of hg (at least version 1.6). This is for the subrepo feature to work correctly.
I have separated the work of migration in two phases:
1. GRDECL Parser
2. Grid building
The first phase works great.
In the second phase I have encountered a compiler error within buildTopo() function, located in the file readEclipseFormat.cpp
The error occurs when calling the function makeInverseRelation(), there are two calls to this function.
This error produces the following compiler reports (twice)
Error C2664: 'std::allocator<_Ty>::construct' :
Cannot convert parameter 2 from 'int' to 'const Dune::cpgrid::EntityRep<codim> &'
File : C:\Program Files\Microsoft Visual Studio 8\VC\include\memory
Line : 130
Error C2679: binary '='
No operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
File : C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility
Line : 2266
Analyzing the error I have found that comes from the line 70 of SparceTable.h, which contains the following code
: data_(data_beg, data_end)
When I remove this line of code the compiler errors disappear.
I greatly appreciate if you can give me any suggestions to correct this error.
It appears to be caused by initializing a std::vector<EntityRep<codim> > with two iterators with 'int' as their value type.
At the moment I am a bit surprised by the fact that this compiles with g++ (which I use), and not VC++, perhaps the g++ STL
copy constructs the vector elements (which works since EntityRep has an explicit constructor from 'int') and the VC++ STL assigns the elements (which will not work, since there is no assignment operator for EntityRep that takes an 'int').
Since this is a symptom of abusing the internal representation of EntityRep (the 'int' constructor will be removed at some point), I have tried to resolve the issue. Please check out the latest version (in the hg repo) and see if that fixed your problem.
I would also appreciate knowing what you plan to use Dune and dune-cornerpoint for. Build scripts for windows would also be a nice contribution to the community!
Atgeirr Flø Rasmussen
More information about the Dune
mailing list