[R-sig-Debian] R CMD INSTALL cannot find libf77blas

Dirk Eddelbuettel edd at debian.org
Fri Jan 28 17:15:27 CET 2011

On 28 January 2011 at 09:49, Douglas Bates wrote:
| I feel like Marlon Brando in "On the Waterfront" where he's told "It's
| not your night, kid", except for me it has been the last two months
| trying to debug memory problems.  Now I can't even install an old
| version of this package on a netbook running the  Ubuntu 10.10 netbook
| remix because it can't find the libraries libf77blas and libatlas.
| I have even gone to the extent of removing the r-base-core package
| entirely and removing libatlas3gf-base then reinstalling everything.
| I still get
| bates at eeek:/var/tmp$ R CMD INSTALL lme4_0.999375-37.tar.gz
| * installing to library ‘/home/bates/R/i686-pc-linux-gnu-library/2.12’
| * installing *source* package ‘lme4’ ...
| ** libs
| gcc -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include"
| -I"/usr/lib/R/library/stats/include"   -fpic  -std=gnu99 -O3 -pipe  -g
| -c init.c -o init.o
| gcc -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include"
| -I"/usr/lib/R/library/stats/include"   -fpic  -std=gnu99 -O3 -pipe  -g
| -c lmer.c -o lmer.o
| gcc -I/usr/share/R/include   -I"/usr/lib/R/library/Matrix/include"
| -I"/usr/lib/R/library/stats/include"   -fpic  -std=gnu99 -O3 -pipe  -g
| -c local_stubs.c -o local_stubs.o
| gcc -shared -o lme4.so init.o lmer.o local_stubs.o -llapack -lf77blas
| -latlas -lgfortran -lm -L/usr/lib/R/lib -lR
| /usr/bin/ld: cannot find -lf77blas
| /usr/bin/ld: cannot find -latlas
| collect2: ld returned 1 exit status
| make: *** [lme4.so] Error 1
| ERROR: compilation failed for package ‘lme4’
| * removing ‘/home/bates/R/i686-pc-linux-gnu-library/2.12/lme4’
| The thing that seems to be missing in /usr/lib/ is a symbolic link
| from libatlas.so.3gf to libatlas.so.  All I have is
|   lrwxrwxrwx   1 root root           33 2011-01-28 09:37
| libatlas.so.3gf -> /etc/alternatives/libatlas.so.3gf
| Can someone tell me if I should see a link from libatlas.so.3gf to libatlas.so?

Weird.  This all works so reliably ... that I even wrote a CRAN package /
paper exploiting all this mechanically --- see 'gcbd'. (Did I ever send you
the paper for comments?)

It has a utilies.R in which I define purge and install wrapper to get atlas
(3.6 from Ubuntu), MKL (via REvo in Ubuntu 9.10), Atlas39 (local package) and
Goto (local package via the wondeful helper package from Tokyo).  For Atlas
these do

installAtlas <- function() {
    res <- system("sudo apt-get -y --force-yes install libatlas3gf-base", intern=TRUE, ignore.stderr=TRUE)

purgeAtlas <- function() {
    ##-- old local build wajig purge libatlas-base-dev libatlas-dev  libatlas3gf-amd64sse3  libatlas3gf-base
    res <- system("sudo apt-get -y --force-yes purge libatlas3gf-base", intern=TRUE, ignore.stderr=TRUE)

I'd be more than happy to compare notes with you.  My netbook has
libatlas3gf-base installed, it has 

edd at dexter:~$ ls -l /usr/lib/libf77blas.so* /etc/alternatives/libf77blas.so* 
lrwxrwxrwx 1 root root 33 2010-11-04 10:50 /etc/alternatives/libf77blas.so -> /usr/lib/atlas-base/libf77blas.so
lrwxrwxrwx 1 root root 37 2010-10-29 14:00 /etc/alternatives/libf77blas.so.3gf -> /usr/lib/atlas-base/libf77blas.so.3gf
lrwxrwxrwx 1 root root 31 2010-11-04 10:50 /usr/lib/libf77blas.so -> /etc/alternatives/libf77blas.so
lrwxrwxrwx 1 root root 35 2010-10-29 14:00 /usr/lib/libf77blas.so.3gf -> /etc/alternatives/libf77blas.so.3gf
edd at dexter:~$ 

The actual links are in /usr/lib/atlas-base/ which gets added to ld.so's list
of directories.  

AFAICT this mechanism hasn't really changed in years.


| _______________________________________________
| R-SIG-Debian mailing list
| R-SIG-Debian at r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-debian

Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com

More information about the R-SIG-Debian mailing list