[Dune-devel] dune-common update seems to cause error in my ParMetis routine
Aleksejs Fomins
aleksejs.fomins at lspr.ch
Fri Jan 22 13:41:43 CET 2016
Dear Christian,
Thank you for your advice. After a brief look at the commit tree, I have found a commit
93f16b5ecdb60704cc9c369a9ee14f24708c506a
by Lars Lubkoll as of 2015-12-07 16:08:42, which adds the line
using real_t = typename FieldTraits<Type>::real_type;
to namespace Dune.
Since curvilinear grid is inside namespace Dune, I suppose that including parmetis.h creates a name clash.
Do you think that
namespace MyParmetis{
#include <parmetis.h>
}
would be a good solution?
Best,
Aleksejs
On 22.01.2016 13:14, Christian Engwer wrote:
> Easiest wuld be a git bisect to identify te commit that caused the
> problems.
>
> Alternatively you can look at the preprocessor output.
>
> Christian
>
> On Fri, Jan 22, 2016 at 12:13:58PM +0100, Aleksejs Fomins wrote:
>> Dear Markus,
>>
>> real_t is a datatype that is essentially float or double, as defined in <parmetis.h>, which is included in the file in question.
>>
>> In fact, the error disappears if I manually type
>>
>> typedef float real_t;
>>
>> inside of my code. However, this same line is already written in parmetis.h, and the compiler clearly sees this file, because it does not complain about other parmetis functions I use. What puzzles me is that the code compiles no problem with previous version of dune-common.
>>
>> Thanks,
>> Aleksejs
>>
>>
>> On 22.01.2016 12:07, Markus Blatt wrote:
>>> Hi,
>>>
>>> On Fri, Jan 22, 2016 at 11:55:31AM +0100, Aleksejs Fomins wrote:
>>>> My Parmetis code, which used to compile before, includes the following lines:
>>>>
>>>> ------------------------------------------------------------------------------
>>>> #if PARMETIS_MAJOR_VERSION < 4
>>>> typedef idxtype idx_t;
>>>> typedef float real_t;
>>>> #endif
>>>>
>>>> std::vector<real_t> tpwgts(ncon*nparts, 1./nparts);
>>>> ------------------------------------------------------------------------------
>>>>
>>>> With the latest pull of dune-common, I get the following error
>>>>
>>>> ------------------------------------------------------------------------------
>>>> /home/fomins/gitwork/hades-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/io/file/curvilineargmshreader.hh:1124:25: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Alloc> class std::vector’
>>>> std::vector<real_t> tpwgts(ncon*nparts, 1./nparts);
>>>> ^
>>>> /home/fomins/gitwork/hades-lspr-ag/dune-curvilineargrid/dune/curvilineargrid/io/file/curvilineargmshreader.hh:1124:25: note: expected a type, got ‘real_t’
>>>> ------------------------------------------------------------------------------
>>>>
>>>> Would you be so kind as to suggest what caused this error and how to correct it?
>>>
>>> The error message is pretty clear: The compiler does not know real_t
>>> for whatever reason. What is it supposed to be?
>>>
>>> Cheers,
>>>
>>> Markus
>>>
>>
>> _______________________________________________
>> Dune-devel mailing list
>> Dune-devel at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-devel
>
More information about the Dune-devel
mailing list