[Trilinos-Users] Linking problems with LOCA and Anasazi

Phipps, Eric T etphipp at sandia.gov
Tue Aug 26 08:51:30 MDT 2008


Hi Jonas,

What compiler are you using?  Usually multiple symbol definitions resulting from template instantiations are not a problem if the compiler is using "GNU" mode for template instantiation, where the symbols are declared "weak".  However, for GNU mode the symbols do need to be the same size, and it appears they aren't in the linker errors you showed:

/usr/bin/ld: Warning: size of symbol
`_ZN7Anasazi14sortRitzValuesERKSt6vectorIdSaIdEES4_PS0_INS_5ValueISt7complexIdEEESaIS8_EEPS0_IiSaIiEESE_'
changed from 396 in ./libtrilinos_thcm.a(SolverFactory.o) to 452 in
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o)

This is probably resulting from out-of-date definitions in libtrilinos_thcm.a (which I presume is a library you have created?), possibly after updating Trilinos.  Try wiping out the library and object files, and recompiling the source code for that library and see if your linker errors go away.

-Eric


On 8/26/08 1:47 AM, "Jonas Thies" <J.Thies at rug.nl> wrote:

Hi all,

I encounter a problem when trying to use loca and anasazi independently
in the same program. More specifically, the loca headers are included in
the .C file with the main() routine. In another .C file, which I want to
link to later, I recently added the line

#include "AnasaziBlockKrylovSchurSolMgr.hpp"

whereupon the linker produced the error at the end of this message.
It looks like some templates are instantiated twice, what can I do to
avoid this?
Thanks,
Jonas



libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o): In function
`Anasazi::sortRitzValues(std::vector<double, std::allocator<double> >
const&, std::vector<double, std::allocator<double> > const&,
std::vector<Anasazi::Value<std::complex<double> >,
std::allocator<Anasazi::Value<std::complex<double> > > >*,
std::vector<int, std::allocator<int> >*, std::vector<int,
std::allocator<int> >*)':
./LOCA_Eigensolver_AnasaziStrategy.C:(.opd+0x48): multiple definition of
`Anasazi::sortRitzValues(std::vector<double, std::allocator<double> >
const&, std::vector<double, std::allocator<double> > const&,
std::vector<Anasazi::Value<std::complex<double> >,
std::allocator<Anasazi::Value<std::complex<double> > > >*,
std::vector<int, std::allocator<int> >*, std::vector<int,
std::allocator<int> >*)'
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
...
...
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
/usr/bin/ld: Dwarf Error: mangled line number section (bad file number).
./libtrilinos_thcm.a(SolverFactory.o):/home/djansen/jonas/Trilinos/8.0.5/include/Teuchos_RCP.hpp:76:
first defined here
/usr/bin/ld: Warning: size of symbol
`_ZN7Anasazi14sortRitzValuesERKSt6vectorIdSaIdEES4_PS0_INS_5ValueISt7complexIdEEESaIS8_EEPS0_IiSaIiEESE_'
changed from 396 in ./libtrilinos_thcm.a(SolverFactory.o) to 452 in
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o)
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o):
In function `Anasazi::scaleRitzVectors(std::vector<double,
std::allocator<double> > const&, Teuchos::SerialDenseMatrix<int,
std::complex<double> >*)':
./LOCA_Eigensolver_AnasaziStrategy.C:(.opd+0x90): multiple definition of
`Anasazi::scaleRitzVectors(std::vector<double, std::allocator<double> >
const&, Teuchos::SerialDenseMatrix<int, std::complex<double> >*)'
./libtrilinos_thcm.a(SolverFactory.o):/usr/include/c++/4.1.2/bits/allocator.h:105:
first defined here
/usr/bin/ld: Warning: size of symbol
`_ZN7Anasazi16scaleRitzVectorsERKSt6vectorIdSaIdEEPN7Teuchos17SerialDenseMatrixIiSt7complexIdEEE'
changed from 564 in ./libtrilinos_thcm.a(SolverFactory.o) to 376 in
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o)
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o):
In function `Anasazi::computeRitzResiduals(std::vector<double,
std::allocator<double> > const&, Teuchos::SerialDenseMatrix<int,
std::complex<double> > const&, std::vector<double,
std::allocator<double> >*)':
./LOCA_Eigensolver_AnasaziStrategy.C:(.opd+0xf0): multiple definition of
`Anasazi::computeRitzResiduals(std::vector<double,
std::allocator<double> > const&, Teuchos::SerialDenseMatrix<int,
std::complex<double> > const&, std::vector<double,
std::allocator<double> >*)'
./libtrilinos_thcm.a(SolverFactory.o):/usr/include/c++/4.1.2/bits/allocator.h:105:
first defined here
/usr/bin/ld: Warning: size of symbol
`_ZN7Anasazi20computeRitzResidualsERKSt6vectorIdSaIdEERKN7Teuchos17SerialDenseMatrixIiSt7complexIdEEEPS2_'
changed from 488 in ./libtrilinos_thcm.a(SolverFactory.o) to 352 in
/home/djansen/jonas/Trilinos/8.0.5/lib/libloca.a(libloca_a-LOCA_Eigensolver_AnasaziStrategy.o)


_______________________________________________
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: http://software.sandia.gov/mailman/private/trilinos-users/attachments/20080826/9dbab30a/attachment-0001.html 


More information about the Trilinos-Users mailing list