Hi,
I am encountering some difficulties when using the mpfr version of ALGLIB. There is an obscure Linker error whenever I try to use a function of the library. It says:
Code:
g++ -o "svdTest" ./source/amp.o ./source/ap.o ./source/main.o -lgmp -lmpfr
/usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: __gmpfr_emin: TLS definition in /usr/lib/gcc/i586-suse-linux/4.5/../../../libmpfr.so section .tdata mismatches non-TLS reference in ./source/main.o
/usr/lib/gcc/i586-suse-linux/4.5/../../../libmpfr.so: could not read symbols: Bad value
collect2: ld returned 1 exit status
The code works fine while I am only using the ampf objects and matrices thereof. The error occurs as soon as I am calling an ALG routine (I tried so far: rmatrixsvd and rmatrixinverse). I already tried to ask the Administrator of my System as I supposed this to be a System specific error, but he could not help either.
Below I will post an example code which produces this error:
Code:
#include <svd.h>
using namespace ap;
using namespace amp;
const int prec = 256;
int main(int argc, char **argv) {
const int prec = 256;
template_2d_array< ampf<prec> > A;
//initializing A
A.setbounds(0, 3, 0, 3);
int i, j;
for (i = 0; i < 4; ++i) for (j = 0; j < 4; ++j) {
A(i, j) = i + j*4;
}
template_2d_array< ampf<prec> > U, V;
template_1d_array< ampf<prec> > s;
U.setbounds(0, 3, 0, 3);
V.setbounds(0, 3, 0, 3);
s.setbounds(0, 3);
template_2d_array< ampf<prec> > &rU = U, &rV = V;
template_1d_array< ampf<prec> > &rs = s;
svd::rmatrixsvd(A, 4, 4, 2, 2, 2, rs, rU, rV);
return 0;
}
Without the line
svd::rmatrixsvd(A, 4, 4, 2, 2, 2, rs, rU, rV); it compiles (and links) without Problems.
Thank you for your time