[Trilinos-Users] Tpetra: multiple definitions

Chris Baker cgbaker at gmail.com
Tue Oct 13 11:35:00 MDT 2009

Hi Nico.

The cause of this is that the class Tpetra::Distributor used to be
templated, but is no longer. However, the implementation was never moved out
of the header into a compiled-once library file, so multiple inclusions of
Tpetra_Distributor (which is included by many Tpetra classes) will cause the
Tpetra::Distributor methods to be compiled.

The solution is straightforward. I will get to this right away and send you
a patch. We never noticed this bug because we haven't tried linking multiple
object files.


On Tue, Oct 13, 2009 at 11:48, Nico Schlömer <nico.schloemer at ua.ac.be>wrote:

> Hi,
> I came across something awkward when trying to link with Tpetra. There's
> tons
> of multiple definitions, such as
> ================== *snip* ==================
> [...]
> classA.cpp:(.text+0x3134): multiple definition of
> `Tpetra::Distributor::computeReceives()'
> tpetraTest.o:tpetraTest.cpp:(.text+0x29a0): first defined here
> classA.o: In function
> `Tpetra::Distributor::createFromSends(Teuchos::ArrayView<int const>
> const&)':
> [...]
> ================== *snap* ==================
> when, e.g., Tpetra_MultiVector.hpp is included twice (I think).
> A minimalistic example reproducing the error is appended.
> Cheers,
> Nico
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20091013/0fb1cf12/attachment.html 

More information about the Trilinos-Users mailing list