Re: [R] Compiling R with multi-threaded BLAS math libraries - why not actually ?

From: Dirk Eddelbuettel <>
Date: Fri, 11 Jun 2010 22:16:52 -0500

On 11 June 2010 at 23:01, Matt Shotwell wrote:
| In the case of REvolution R, David mentioned using the Intel MKL,
| proprietary library which may not be distributed in the way R is
| distributed. Maybe REvolution has a license to redistribute the library.
| For the others, I suspect Gabor has the right idea, that the R-core team
| would rather not keep architecture dependent code in the sources,
| although there is a very small amount already (`grep -R __asm__`).
| However, I know using Linux (Debian in particular) it is fairly
| straightforward to build R with `enhanced' BLAS libraries. The R
| Administration and Installation manual has a pretty good section on
| linking with enhanced BLAS and LAPACK libs, including the Intel MKL, if
| you are willing cough up $399, or swear not to use the library
| commercially or academically.

BLAS is actually an interface standard, so there is no _rebuilding of R_ required. BLAS allows you to simply drop in a better BLAS library. The "R Inst + Admin" manual has the details.

| Maybe a short tutorial using free software, such as ATLAS would be
| suitable content for an r-bloggers post :) ?

Given the drop-in nature, on suitable platforms all it takes is

   sudo apt-get install libatlas3gf-base

which gets you there most of the way using 'base' Atlas (ie not cpu tuned). On my platform I also see


but this list will differ for different hardware platforms. Whenever I looked at this I found the different between 'base' and 'more tuned' atlas libraries to be rather small so I tend to just stick with base.

Also, Atlas on Debian/Ubuntu is still single-threaded (as opposed to the MKL). But one can drop in the Goto BLAS from U Texas which are 'free' but non-redistributable.

Lastly, as David's article said and as knowledgeable people often repeat: unless you do _lots_ of linear algebra this will not noticeably affect overall R performance as a lot of time is spent in other areas too.

  Regards, Dirk

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 12 Jun 2010 - 03:19:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 Jun 2010 - 03:20:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive