Linking MKL to R on Windows
š° Iām still using this on R version 4.5 and it works fine.
š¦ The Bottom Line (at the top)
Revolutions R came along around 2007 and provided more powerful R computing⦠it was freeware, but you had to register to get it. A few years later, Microsoft bought it and called it Microsoft R Open. Unfortunately, it is gone with the wind.
Here is a work around from the discussion on Stackoverflow - Linking Intelās Math Kernel Library (MKL) to R on Windows.
These notes are for Windows. If you run Linux, go to MKL4DEB for details (as mentioned there, youāll want to scroll down to the Appendix first).
Before you start, do this and record how flippinā long it takes to run:
# Singular Value Decomposition
m <- 10000
n <- 2000
A <- matrix (runif (m*n), m, n)
system.time (S <- svd (A, nu=0, nv=0))
Now close R and let the magic begin ā¦
š¦ Steps to Enhance R version 4
This is an easy update as described in the discussion on Stack Overflow previously mentioned.
-
Download the library files from here (itās an archive ~ 250 MB with 2 directories,
compilerandmkl): Intel_Libraries.zip and extract everything. -
Go to the directory where R is installed, something like
C:\Program Files\R\R-4.xxx\bin\x64\, and changeRlapack.dllandRblas.dlltoRlapack.dll.bakandRblas.dll.bak, respectively, as backups. -
From the extracted folder in step 1, paste all the content from the folders
complierandmklinto the directory where R is installed. -
Inside the destination folder, create 2 (additional) copies of
mkl_rt.dlland rename the new files asRlapack.dllandRblas.dlland keepmkl_rt.dll. -
Start R and rerun the SVD code and be amazed š at the difference in computation time.
ā