[R] R and ATLAS

Dirk Eddelbuettel edd at debian.org
Thu May 27 00:31:48 CEST 2010


Jonathan,

That would have been a good question for the r-sig-debian list ...

On 26 May 2010 at 14:16, Jonathan Greenberg wrote:
| Rhelpers:
| 
| I recently installed the 64-bit version of R on my Debian system, and
| afterwards was asked if it was compiled using ATLAS.  Is there a way
| to test to see if R is using ATLAS?

Atlas is one (accelerated, tuned) implementation of an interface called Blas.
R is built with support for whichever Blas you have -- which could be Atlas
or non-free alternative such as Goto or Intel MKL, or it could be the slower
'reference blas'.

If you also install the r-base-dev package (recommended if you build package)
you will get headers and libraries for Blas, with the Atlas package being the
default.

Lastly, on Linux, you can check which libraries are used via the ldd tool. On
my (32bit) system:

edd at ron:~> ldd /usr/lib/R/bin/exec/R 
	linux-gate.so.1 =>  (0xb786c000)
	libR.so => /usr/lib/libR.so (0xb7530000)
	libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb73e9000)
	libblas.so.3gf => /usr/lib/atlas/libblas.so.3gf (0xb706d000)
	libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0xb6fa8000)
	libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb6f82000)
	libreadline.so.6 => /lib/libreadline.so.6 (0xb6f4d000)
	libpcre.so.3 => /lib/libpcre.so.3 (0xb6f1d000)
	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb6f0c000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb6ef7000)
	libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb6ef3000)
	/lib/ld-linux.so.2 (0xb786d000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6ed5000)
	libncurses.so.5 => /lib/libncurses.so.5 (0xb6e9b000)
edd at ron:~> 

and you notice in the fourth line how the linker fills in the libblas.so.3gf
from Atlas for libblas, eg the Blas library needed here.  Similar output can
be generated for /usr/lib/R/modules/lapack.so showing that Atlas also
provides tuned Lapack libraries.

Hope this helps.  The R Install + Admin manual has more detail.

-- 
  Regards, Dirk



More information about the R-help mailing list