From p.dalgaard at biostat.ku.dk  Wed Sep 28 16:53:43 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: 28 Sep 2005 16:53:43 +0200
Subject: [Rd] looks in liblapack.a not liblapack.so
In-Reply-To: <dhe8cr$tbm$1@sea.gmane.org>
References: <mailman.9.1126951201.11292.r-devel@r-project.org>
	<20050917221902.GA10806@stat.umn.edu> <1127119440.3624.5.camel@seurat>
	<x23bo15c13.fsf@turmalin.kubism.ku.dk>
	<1127144443.18426.14.camel@seurat> <dgpari$a96$1@sea.gmane.org>
	<x2mzm5lbtx.fsf@turmalin.kubism.ku.dk> <dhe8cr$tbm$1@sea.gmane.org>
Message-ID: <x2k6h1451k.fsf@viggo.kubism.ku.dk>

Jos? Matos <jamatos at fc.up.pt> writes:

> Peter Dalgaard wrote:
> 
> > Hmm. Doesn't look like it is actually working, though. Install
> > lapack-devel, configure --with-lapack, and make check dies with
> > 
> > running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1
> > make[4]: Leaving directory `/home/pd/r-devel/BUILD/tests/Examples'
> > make[3]: *** [test-Examples-Base] Error 2
> > ....
> > [pd at titmouse BUILD]$ tail tests/Examples/base-Ex.Rout.fail
> >> kappa(x2 <- cbind(x1,2:11))# high! [x2 is singular!]
> > [1] 8.351867e+16
> >>
> >> hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
> >> sv9 <- svd(h9 <- hilbert(9))$ d
> >> kappa(h9)# pretty high!
> > [1] 728289254735
> >> kappa(h9, exact = TRUE) == max(sv9) / min(sv9)
> > Error in La.svd(x, nu, nv) : BLAS/LAPACK routine 'DGEBRD' gave error code
> > -10 Execution halted
> > 
> > This happens on both x86_64 and x86 installs of FC4.
> 
>   I am sorry Peter, I am trying really hard to replicate this bug but I have
> not been able to see the same result, no matter what I try.
> 
>   I have download the latest tar ball and then I run:
> 
> $ ./configure --with-lapack="-llapack -lblas"
> ...
> R is now configured for x86_64-unknown-linux-gnu
> 
>   Source directory:          .
>   Installation directory:    /usr/local
> 
>   C compiler:                gcc  -g -O2
>   C++ compiler:              g++  -g -O2
>   Fortran compiler:          gfortran  -g -O2
> 
>   Interfaces supported:      X11
>   External libraries:        readline
>   Additional capabilities:   PNG, JPEG, iconv, MBCS, NLS
>   Options enabled:           R profiling
> 
>   Recommended packages:      yes
> 
> $ make -j8
> $ make check
> 
>   It works.
> 
>   OTOH I am not sure that configure is accepting my options. Looking into
> config.log I don't see that value being used, and I noticed that the lapack
> module it is still being built.
> 
>   I read docs/manual/R-admin.html but without any difference. I have tried
> different forms:
> 
> --with-lapack
> --with-lapack="-llapack -lcblas"
> --with-lapack="-llapack -lblas"
> 
>   What am I missing?

-L/usr/lib64  I think. I have 

#LAPACK_LIBS="-L/usr/lib64 -llapack"

(commented out now) in config.site.

../R/configure --with-lapack="-L/usr/lib64 -llapack"

seems to work with FC4/Opteron (even with the configure line, you
still need to have at least "--with-lapack" on the command line, which
is a bit of a bug -- or will be one, once we stop advising against
using external lapack libs in the first place...).

A line like

External libraries:        readline, BLAS(ATLAS), LAPACK(generic)

shows that R is not using the internal versions of BLAS/LAPACK. (Of
course, the ATLAS bit required more work...)

The latest updates to lapack seem not to have worked.
 
> > I have a strong sense of deja vu regarding this error.
> 
>   Thanks,
> -- 
> Jos?? Ab??lio
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



[Rd] looks in liblapack.a not liblapack.so
Peter Dalgaard