Hi,
I just got the comment on gretl_f2c.h. I react on that. I find that my
lapack seems to be working.
lapack of /usr/lib and /usr/lib64 are identical:
helgi@localhost /usr/lib $
diff /usr/lib/liblapack.so.0 /usr/lib64/liblapack.so.0
helgi@localhost /usr/lib $
./configure --with-lapack-prefix=/usr/lib64
gives the same result as just ./configure.
My R is not linked against libRblas.a
helgi@localhost /usr/lib $ ldd /usr/lib/R/bin/exec/R
libR.so => /usr/lib64/R/lib/libR.so (0x00002ad96c5dd000)
libc.so.6 => /lib/libc.so.6 (0x00002ad96c96e000)
libblas.so.0 => /usr/lib/libblas.so.0 (0x00002ad96cba9000)
libatlas.so.0 => /usr/lib/libatlas.so.0 (0x00002ad96ccc8000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00002ad96d3bf000)
libgfortran.so.1
=> /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libgfortran.so.1
(0x00002ad96d4d9000)
libm.so.6 => /lib/libm.so.6 (0x00002ad96d672000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00002ad96d7c7000)
libreadline.so.5 => /lib/libreadline.so.5 (0x00002ad96d8d4000)
libpcre.so.0 => /usr/lib/libpcre.so.0 (0x00002ad96da0d000)
libbz2.so.1 => /lib/libbz2.so.1 (0x00002ad96db2d000)
libz.so.1 => /lib/libz.so.1 (0x00002ad96dc3c000)
libdl.so.2 => /lib/libdl.so.2 (0x00002ad96dd51000)
/lib64/ld-linux-x86-64.so.2 (0x00002ad96c4c0000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00002ad96de55000)
* helgi@localhost /usr/lib
$
I compile and run the following c-test program for "dgeev", with
gcc test_lapack.c -llapack
and get
A):
[ 0.0] [ 0.8] [ 1.0] [ 0.8]
[ 0.9] [ 1.8] [ 2.4] [ 0.9]
[ 1.7] [ 2.6] [ 3.4] [ 0.9]
[ 2.6] [ 3.3] [ 4.4] [ 0.8]
test_lapack.c
int main()
{
// --------------------------- test values
double A[] =
{0,1,2,3,
1,2,3,4,
1,3,4,5,
1,1,1,1 };
int n = 4;
// ---------------------------------------------
char jobv_ = 'V';
double *wi,*wr,*U,*work,work_size,*Ui,*D;
int lwork,info;
wi = (double*) malloc( n*sizeof(double));
wr = (double*) malloc( n*sizeof(double));
U = (double*) calloc( n*n,sizeof(double));
D = (double*) calloc( n*n,sizeof(double));
Ui = (double*) calloc( n*n,sizeof(double));
lwork = -1;
dgeev_(&jobv_,&jobv_,&n,A,&n,wr,wi,U,&n,Ui,&n,&work_size,&lwork,&info);
if( info == 0 ) {
lwork = (int)work_size;
work = (double*) calloc( lwork , sizeof( double) );
dgeev_(&jobv_,&jobv_,&n,A,&n,wr,wi,U,&n,Ui,&n,work,&lwork,&info);
if( info == 0 ) {
mk_diag(wr,D, n,n); //create diagonal matrix
} else { return 0; }
free( work );
} else { return 0; }
double *UD, *UDUi, a = 1,b=0;
char ntran_ = 'N';
char ytran_ = 'T';
char ctran_ = 'C';
UD = (double*) malloc( n*n*sizeof(double));
dgemm_(
&ntran_,&ntran_,&n,&n,&n,&a,U,&n,D,&n,&b,UD,&n );
UDUi = (double*) malloc( n*n*sizeof(double));
dgemm_(
&ntran_,&ytran_,&n,&n,&n,&a,UD,&n,Ui,&n,&b,UDUi,&n
);
int i,j;
printf ("\n(A):\n\t");
for (i=0; i<n; ++i) {
for (j=0; j<n; ++j){
printf("[%6.1f] ", UDUi[i*n+j]);
}
printf("\n\t");
}
return 0;
}
I intend to try to insert a print-command into gretl_matrix.c and see
which values it is trying to pass to dgeev. I have an old amd64 which
runs ubuntu-64. That one cannot do the johansen-test either. That gretl
is version 1.5 and precompiled with the ubuntu. I.e. it was installed
with apt-get install gretl.
Best regards
Helgi
On Tue, 2008-02-26 at 22:06 -0500, Allin Cottrell wrote:
On Mon, 25 Feb 2008, Helgi Tomasson wrote:
> Diagnostics on compilaton of GRETL on saybayon(gentoo)-64 linux. Fast
> fourier transform works (and a lot of things I have tested) where as
> johansen-test does not. There is lapack in /usr/lib64 which is the same
> as in the one in /usr/lib.
>
> Lapack is working in R, and in test programs (R and c++).
Is your R binary in fact linked against your system liblapack? I
find that's not the case on my own system:
allin@myrtle:~/src$ locate lib/liblapack.so
/usr/lib/liblapack.so.3.0
/usr/lib/liblapack.so.3
/usr/lib/liblapack.so
allin@myrtle:~/src$ LD_LIBRARY_PATH=/opt/R/lib/R/lib ldd \
/opt/R/lib/R/bin/exec/R
linux-gate.so.1 => (0xffffe000)
libR.so => /opt/R/lib/R/lib/libR.so (0xb7c75000)
libRblas.so => /opt/R/lib/R/lib/libRblas.so (0xb7c4b000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7aef000)
libgfortran.so.1 => /usr/lib/libgfortran.so.1 (0xb7a76000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7a51000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7a46000)
libreadline.so.5 => /lib/libreadline.so.5 (0xb7a15000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7a11000)
/lib/ld-linux.so.2 (0xb7f54000)
libncurses.so.5 => /lib/libncurses.so.5 (0xb79cc000)
Note no linkage to /usr/lib/liblapack.so: R seems to prefer to use
its own lapack implementation (built into libR, I suspect).
Allin.
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users