[Rd] compiler flags for performance

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Fri Jun 14 15:44:36 CEST 2019

On 14 June 2019 at 15:22, arnaud gaboury wrote:
| I have build R with Intel MKL.The libraries are free for one year (maybe
| did it change). The build is far from being trivial. Please find on my
| github[0] some details

Gee, when oh when does this "meme" of "I built R with MKL" die?

BLAS/LAPACK are _an interface_ and once you tell R to configure with BLAS as
a shared library, _all_ matching BLAS/LAPACK libraries become _pluggable_. My
gcbd package and vignette demonstrated that a decade+ ago (then using Goto).
It also holds for MKL, and these days Intel tries harder with a) friendlier
licenses and b) better packaging -- they even give .deb (and I believe .rpm).

So now you just drop MKL in/out with a single script which you can find here
https://github.com/eddelbuettel/mkl4deb with supporting blog posts at

So please, let's not repeat this 'you have to use Revolution / Microsoft /
$whatever R to get MKL' or 'you have to recompile R for MKL'.

Lastly, if it matters is up to the beholder. Because the optmization in the
MKL appears to come from _many_ explicit code paths for many Intel cpu
(micro-)architectures, the installed footprint is sizeable -- IIRC it was 2gb
when I wrote the blog post above.  My linear algebra use (at home) is light
so I just kept OpenBLAS which is almost as fast, and proper free software
with a smaller installation footprint. Your mileage, as they say, may vary.


http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org

More information about the R-devel mailing list