[Trilinos-Users] Compile problem Visual Studio 2010 and 11.0

Einar Sørheim einar at ife.no
Fri Oct 26 06:02:55 MDT 2012


The problematic file in xpetra is Xpetra_EpetraMap.cpp, and it fails in this section of the code:
  EpetraMap::EpetraMap(global_size_t numGlobalElements, size_t numLocalElements, int indexBase,
                       const Teuchos::RCP<const Teuchos::Comm<int> > &comm, const Teuchos::RCP<Node> &node)
  {
    // This test come from Tpetra
    using Teuchos::outArg;

    const size_t  L0 = Teuchos::OrdinalTraits<size_t>::zero();
    const size_t  L1 = Teuchos::OrdinalTraits<size_t>::one();
    const global_size_t GST0 = Teuchos::OrdinalTraits<global_size_t>::zero();
    const global_size_t GST1 = Teuchos::OrdinalTraits<global_size_t>::one();
    const global_size_t GSTI = Teuchos::OrdinalTraits<global_size_t>::invalid();

However it fails only on the definition of L0 and GST0 , not on L1 and GST1, something seems wrong with the definition of zero() as opposed to one()
Regards
Einar
-----Original Message-----
From: Hoemmen, Mark [mailto:mhoemme at sandia.gov] 
Sent: 24. oktober 2012 17:54
To: Einar Sørheim
Cc: trilinos-users at software.sandia.gov; Baker, Christopher G.
Subject: Re: [EXTERNAL] Re: [Trilinos-Users] Compile problem Visual Studio 2010 and 11.0

This sounds like a Windows issue we've seen before.  The OrdinalTraits specializations might be relying on equivalence of size_t to some other unsigned integer type.  Windows uses a different integer / pointer model than Linux or Mac, so developers don't usually encounter this.  I've written some C preprocessor magic to deal with issues like this; I'll dig it up as soon as I can.  Hopefully this is the problem, as it's not too hard to fix.  

(I'm surprised this didn't come up in our Windows nightly testing, though.  Does that not text Xpetra?)

Einar -- thanks for doing the extra work for us to help out.  As Chris mentioned, it would still be helpful to find out what code is invoking this, so that we can test the above hypothesis and also add that code to the nightly Windows tests.

Thanks!
mfh


On Oct 24, 2012, at 9:32 AM, Baker, Christopher G. wrote:

> Can you give us the rest of the error? This is pretty far down the 
> stack, and it would be helpful to know what code is invoking this 
> response from OrdinalTraits.
> 
> Chris
> 
> On 10/24/12 5:27 AM, "Einar Sørheim" <einar at ife.no> wrote:
> 
>> I have now changed to the public git-version of trilinos and it 
>> compiles without problems when only using epetra and packages 
>> supported by epetra, however enabling e.g muelu which needs xpetra, I still get errors.
>> Have also switched to Intels C compiler as it gives better error 
>> messages, currently I now get the following error compiling xpetra:
>> 
>> 23>D:/Programming/publicTrilinos/packages/teuchos/src/Teuchos_Ordinal
>> 23>Trait
>> s.hpp(77): error : name followed by "::" must be a class or namespace 
>> name
>> 23>      static inline T notDefined() { return
>> T::this_type_is_missing_a_specialization(); }
>> 23>                                            ^
>> 23>            detected during:
>> 23>              instantiation of "T
>> Teuchos::UndefinedOrdinalTraits<T>::notDefined() [with 
>> T=size_t={unsigned __int64}]" at line 87
>> 23>              instantiation of "T 
>> 23> Teuchos::OrdinalTraits<T>::zero()
>> [with T=size_t={unsigned __int64}]" at line 117 of 
>> "..\..\..\..\packages\xpetra\src\Map\Xpetra_EpetraMap.cpp"
>> 23>  
>> I get a number of these errors also in muleu and thyraepetra.
>> Regards
>> Einar
>> -----Original Message-----
>> From: Hoemmen, Mark [mailto:mhoemme at sandia.gov]
>> Sent: 23. oktober 2012 20:22
>> To: <trilinos-users at software.sandia.gov>
>> Cc: Einar Sørheim
>> Subject: Re: Compile problem Visual Studio 2010 and 11.0
>> 
>> On Oct 23, 2012, at 12:00 PM, 
>> <trilinos-users-request at software.sandia.gov>
>> wrote:
>>> Message: 1
>>> Date: Tue, 23 Oct 2012 11:47:33 +0000
>>> From: Einar S?rheim <einar at ife.no>
>>> Subject: [Trilinos-Users] Compile problem Visual Studio 2010 and 
>>> 11.0
>>> To: "trilinos-users at software.sandia.gov"
>>> 	<trilinos-users at software.sandia.gov>
>>> Message-ID:
>>> 	
>>> <6640B0F04B3B1049AD994802A59E39D99C50E940 at kj-exch-02.Kjeller.ife.no>
>>> Content-Type: text/plain; charset="iso-8859-1"
>>> 
>>> Hi
>>> I have a problem compiling trilinos on the windows platform using 
>>> Visual Studio 2010, I have used the cmake-gui to configure the 
>>> solution files. The problem occurs when reaching the tpetra package 
>>> in the build process, where I get the following error compiling the 
>>> Tpetra_Distributor.cpp file :
>>> 
>>> Error      486         error C2825: 'T': must be a class or namespace
>>> when followed by '::'
>>> d:\programming\gittrilinos\publictrilinos\packages\teuchos\src\Teuchos_Or
>>> dinalTraits.hpp       76           1                tpetra
>>> The offending line in Teuchos_OrdinalTraits.hpp    is:
>>> static inline T notDefined() { return 
>>> (T::this_type_is_missing_a_specialization()); }
>>> 
>>> Any ideas as to what the problem is?
>>> Regards
>>> Einar Sorheim
>> 
>> This looks like a problem that has been fixed recently.  Would you 
>> happen to know what version of Trilinos you are using?  Also, could 
>> you figure out what type T is causing the compile error?
>> 
>> mfh
>> 
>> 
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>> 
> 
> 






More information about the Trilinos-Users mailing list