[R-sig-Debian] How to used MKL (not revolution-mkl) with Debian packages

Gong-Yi Liao gongyi.liao at gmail.com
Thu Nov 3 01:24:31 CET 2011


(please ignore previous mail) 

Hi folks,

  if you want to use MKL (the fast BLAS I have tested on my Thinkpad
T410)
with the R 2.14.0 built as Debian/Ubuntu packages available on CRAN
mirror,
the following tricks may work for those who want to use MKL without some
known side-effects (likes
openmp breaking issues), you may try to build your own libblas.so.3gf.0
with following command:


$ gfortran -L/opt/intel/lib/intel64 -liomp5 -L/opt/intel/mkl/lib/intel64
-lmkl_rt -lmkl_core -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_gf_ilp64 -lgomp
-lpthread -shared -Wl,-soname,libblas.so.3gf -o libblas.so.3gf.

$ sudo mkdir /usr/local/lib/MKL
$ sudo cp libblas.so.3gf.0 /usr/local/lib/MKL/.
$ cd /usr/local/lib/MKL
$ sudo ln -s libblas.so.3gf.0 libblas.so.3gf
$ sudo -s
$ echo "/usr/local/lib/MKL" > /etc/ld.so.conf.d/MKL.conf
$ exit
$ sudo ldconfig

then test your R with some benchmarks, here I am using
"R-benchmark-25.R",
which is available at http://r.research.att.com/benchmarks/.

Note: I assume that your MKL is installed under /opt/intel/.

-- 
Gong-Yi Liao

Department of Statistics
University of Connecticut
215 Glenbrook Road  U4120
Storrs, CT 06269-4120



More information about the R-SIG-Debian mailing list