[R] Problem with lm4 and lapack library

Javier Bustamante jbustamante at ebd.csic.es
Mon Nov 15 12:18:01 CET 2010

I have R under Linux Kubuntu Hardy Heron 8.04 LTS.
I am trying to install package 'lme4' and get the following error:
* installing *source* package ‘lme4’ ...
** libs
gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include" -I"/usr/lib/R/library/stats/include"   -fpic  -g -O2 -c 
init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include" -I"/usr/lib/R/library/stats/include"   -fpic  -g -O2 -c 
lmer.c -o lmer.o
gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include" -I"/usr/lib/R/library/stats/include"   -fpic  -g -O2 -c 
local_stubs.c -o local_stubs.o
gcc -std=gnu99 -shared -o lme4.so init.o lmer.o 
local_stubs.o -L/usr/lib64/R/lib -lRlapack -lblas -lgfortran -lm -lgcc_s -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lRlapack
collect2: ld devolvió el estado de salida 1
make: *** [lme4.so] Error 1
ERROR: compilation failed for package ‘lme4’
* removing ‘/usr/local/lib/R/site-library/lme4’

The downloaded packages are in
Mensajes de aviso perdidos
In install.packages("lme4") :
  installation of package 'lme4' had non-zero exit status

Surfing on internet and R hel system it seems the problem is related to 
LAPACK, LBAS. ATLAS libraries. R tries to find unsuccessfully " -lRlapack "

I have checked which libraries R is pointing to:
busta at temisto:~$ ldd /usr/lib/R/bin/exec/R
        linux-vdso.so.1 =>  (0x00007fff1e100000)
        libR.so => /usr/lib/R/lib/libR.so (0x00007f9157c54000)
        libc.so.6 => /lib/libc.so.6 (0x00007f91578f2000)
        libblas.so.3gf => /usr/lib/atlas/libblas.so.3gf (0x00007f9156f42000)
        libgfortran.so.2 => /usr/lib/libgfortran.so.2 (0x00007f9156c83000)
        libm.so.6 => /lib/libm.so.6 (0x00007f9156a02000)
        libreadline.so.5 => /lib/libreadline.so.5 (0x00007f91567c2000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0x00007f915659c000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f9156385000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f9156181000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f91581c0000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x00007f9155f46000)

Also if I have the LAPACK and ATLAS libraries installed:

busta at temisto:~$ dpkg -l | grep lapack
ii  lapack3    	3.0.20000531a-6.1ubuntu1  
ii  liblapack-dev   3.1.1-0.3ubuntu2 
ii  liblapack3gf     3.1.1-0.3ubuntu2  

busta at temisto:~$ dpkg -l | grep atlas
ii  atlas3-base                                3.6.0-20.6                                
ii  libatlas-base-dev                          3.6.0-21.1ubuntu3                         
ii  libatlas-headers                           3.6.0-21.1ubuntu3                         
ii  libatlas3gf-base                           3.6.0-21.1ubuntu3                         


-L/usr/lib64/R/lib -lRlapack

R seems to be looking for LAPACK in "/usr/lib64/R/lib -lRlapack", probably the 
wrong place.

Can somebody point me to a possible solution?

Dr Javier Bustamante
Estación Biológica de Doñana, CSIC
Dept. Wetland Ecology
Américo Vespucio s/n
41092 - Sevilla

voice: +34 954 466700 ext. 1217
fax: +34 954 621125
e-mail: jbustamante at ebd.csic.es


-----other links-------

More information about the R-help mailing list