I'm not sure if R compiled correctly with MKL:
When I do ldd on R I don't see any reference to MKL
benjamin@benjamin-Lenovo-IdeaPad-Y510P:/opt/intel/mkl/tools$ ldd /usr/lib/R/bin/exec/R
linux-vdso.so.1 => (0x00007fff641fe000)
libR.so => /usr/lib/libR.so (0x00007ffad94d8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffad92bb000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffad8efa000)
libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007ffad8c60000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffad8964000)
libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007ffad8721000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ffad84e4000)
liblzma.so.5 => /usr/lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ffad82c2000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007ffad80b1000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ffad7ea9000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffad7ca5000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007ffad7a96000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffad9a35000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007ffad786f000)
Some info on how I compiled R with MKL:
benjamin@benjamin-Lenovo-IdeaPad-Y510P:/opt/intel/mkl/tools$ ./mkl_link_tool -check_mkl_presence
Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.0
==========================================================
Unknown mode. Specify -libs, -opts, -env or compilation line
Configuration
=============
MKL version: 11.1
OS: lnx
Architecture: intel64
Compiler: intel_f
Linking: dynamic
Interface layer: lp64
Parallel: yes
OpenMP library: iomp5
benjamin@benjamin-Lenovo-IdeaPad-Y510P:/opt/intel/mkl/tools$ ./mkl_link_tool -check_mkl_presence -libs -opts -env
Intel(R) Math Kernel Library (Intel(R) MKL) Link Tool v4.0
==========================================================
Output
======
Compiler option(s):
-I/opt/intel/composer_xe_2013_sp1.0.080/mkl/include
Linking line:
-L/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread -lm
Environment variable(s):
export LD_LIBRARY_PATH=/opt/intel/composer_xe_2013_sp1.0.080/mkl/../compiler/lib/intel64:/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64:$LD_LIBRARY_PATH;
This was the actual command I ran to configure R:
./configure --enable-R-shlib --enable-threads=posix --with-lapack --with-blas=-fopenmp -m64 -I/opt/intel/composer_xe_2013_sp1.0.080/mkl/include -L/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64 -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm
In my config.log file I do see:
configure:29696: checking whether double complex BLAS can be used
configure:29767: result: yes
However, right after that I see:
configure:29787: checking whether the BLAS is complete
conftest.c: In function 'blas_set':
conftest.c:11:3: warning: implicit declaration of function 'dasum_' [-Wimplicit-function-declaration]
conftest.c:12:3: warning: implicit declaration of function 'daxpy_' [-Wimplicit-function-declaration]
... lots more of these ...
/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64/libmkl_core.so: undefined reference to `logf'
... lots more of these ...
/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64/libmkl_core.so: undefined reference to `expf'
collect2: ld returned 1 exit status
configure:29911: result: no