User Ronny on tmv-discuss reported the following problem:
Simple program with Matrix<int> determinant produces compiler errors.
#include <TMV.h>
#include <iostream>
int main()
{
int mV[9] = {1,2,3,0,4,5,0,0,6};
tmv::Matrix<int> M(3,3, mV);
std::cout << "Determinante:" << Det(M);
}
Compiled with:
g++ -o main.o -c -fno-strict-aliasing -DNDEBUG -I/usr/local/include main.cpp
g++ -o main -fopenmp main.o -L/usr/local/lib -ltmv -llapack -lblas -lpthread
First produced the linking error:
ld: duplicate symbol bool tmv::TMV_Underflow<int>(int) in
/usr/local/lib/libtmv.a(TMV_BaseMatrix.o) and
/usr/local/lib/libtmv.a(TMV_Matrix.o)
collect2: ld returned 1 exit status
When this bug is fixed (adding inline to TMV_Underflow<int> function in
TMV_Base.h) a lot more linking problems show up. Starting with:
Undefined symbols:
"void tmv::RCCMultMM<true, std::complex<double>, std::complex<double>, double>(std::complex<double>, tmv::GenMatrix<std::complex<double> > const&, tmv::GenMatrix<double> const&, tmv::MatrixView<std::complex<double>, (tmv::IndexStyle)0> const&)", referenced from:
void tmv::BlockMultMM<true, std::complex<double>, std::complex<double>, double>(std::complex<double>, tmv::GenMatrix<std::complex<double> > const&, tmv::GenMatrix<double> const&, tmv::MatrixView<std::complex<double>, (tmv::IndexStyle)0> const&) in libtmv.a(TMV_MultMM_Block.o)
"void tmv::RCCMultMM<true, std::complex<float>, std::complex<float>, float>(std::complex<float>, tmv::GenMatrix<std::complex<float> > const&, tmv::GenMatrix<float> const&, tmv::MatrixView<std::complex<float>, (tmv::IndexStyle)0> const&)", referenced from:
void tmv::BlockMultMM<true, std::complex<float>, std::complex<float>, float>(std::complex<float>, tmv::GenMatrix<std::complex<float> > const&, tmv::GenMatrix<float> const&, tmv::MatrixView<std::complex<float>, (tmv::IndexStyle)0> const&) in libtmv.a(TMV_MultMM_Block.o)
....
Using g++ 4.4.2 on Snow Leopard 10.6.4.