You should consult an article in R-bloggers for compiling R with MKL.
See "Compiling 64-bit R 2.10.1 with MKL in Linux (April 10, 2010)" or a post in "Computing in Psychological Research" .

About R-2.15 with MKL10.3: See here

Building R-2.8.0 with Intel Compiler Suite 11.0 (icc 11, ifort 11, MKL 10)

The following is an example of building R-2.8.0 with Intel Compiler Suite 11 and MKL 10 on Linux (CentOS 5.2 x86_64).
A backward compatibility package "compat-libstdc++33" for "libstd++.so.5" is necessary for the process.

For Japanese users: You need a patch (provided by Ei-ji Nakama) for Japanese messaging system in R-2.8.0. Without the patch, the 'make check' process will be aborted at the test process of 'methods' module in ja_JP.UTF-8 environment.
Please consult
RjpWiki Q & A Chu-kyu-sya course.
I thank Ei-ji Nakama for his valuable comments on the configurations.
For R-2.9.0 with gcc4.3 and ACML4.3 , please see here.
(My work is partly supported by grant of JST/CREST 2008 Team Hibi - Harmony of Gröbner bases and the modern industrial society.)
#---- config.site ----
CC=icc
CFLAGS="-g -O2 -wd188 -ip -std=c99 -mieee-fp"
F77=ifort
FFLAGS="-mieee-fp -g -O3"
CXX=icpc
CXXFLAGS="-g -O3 -mieee-fp"
FC=ifort
FCFLAGS="-g -O3 -mieee-fp"
ICC_LIBS=/opt/intel/Compiler/11.0/074/lib/intel64
IFC_LIBS=/opt/intel/Compiler/11.0/074/lib/intel64
LDFLAGS="-L$ICC_LIBS -L$IFC_LIBS -L/usr/local/lib64"
SHLIB_CXXLD=icpc
SHLIB_CXXLDFLAGS=-shared
#----------------------------------
The command line help of Intel Compiler 11 _wrongly_ describes ieee consistent floating point option as "-ieee-fp".
January 8, 2009: The environment variable name for C-flags was wrong. The right name is CFLAGS.
# --- wrong ----
CFLAFGS="-g -O2 -wd188 -ip -std=c99"
#---------------


The installation guide of R-2.9 shows an example of dynamic link against MKL with gcc.

Configuration command (dynamic link/icc and ifort)

---- configuration script for dynamic link (for icc and ifort) --------
 source /opt/intel/Compiler/11.0/074/bin/iccvars.sh intel64
 source /opt/intel/Compiler/11.0/074/bin/ifortvars.sh intel64
 source /opt/intel/Compiler/11.0/074/mkl/tools/environment/mklvars64.sh

OMP_NUM_THREADS=8

MKL_LIB_PATH=/opt/intel/Compiler/11.0/074/mkl/lib/em64t

MKL="-L${MKL_LIB_PATH} -lmkl_intel_lp64 -lmkl_intel_thread \
 -lmkl_lapack -lmkl_core -liomp5 -lpthread"

./configure --with-blas="$MKL"  --with-lapack
---------------------------------
The option '--with-lapack' (without right hand side) orders the linker to search lapack modules in the BLAS library.

Configuration command (static link/icc and ifort)

----- local configuration script ------
#
#configuration for icc+ifort+MKL

 source /opt/intel/Compiler/11.0/074/bin/iccvars.sh intel64
 source /opt/intel/Compiler/11.0/074/bin/ifortvars.sh intel64
 source /opt/intel/Compiler/11.0/074/mkl/tools/environment/mklvars64.sh

OMP_NUM_THREADS=8

MKL_LIB_PATH=/opt/intel/Compiler/11.0/074/mkl/lib/em64t

MKL="   -L${MKL_LIB_PATH}                               \
             -Wl,--start-group                               \
                     ${MKL_LIB_PATH}/libmkl_intel_lp64.a        \
                     ${MKL_LIB_PATH}/libmkl_intel_thread.a     \
                     ${MKL_LIB_PATH}/libmkl_core.a           \
             -Wl,--end-group                                 \
             -liomp5 -lguide -lpthread"

./configure --with-lapack="$MKL" --with-blas="$MKL"  LIBM=-limf
--------------------------------------
The intallation guide of R-2.8.1 shows an example that is without -lguide option. The link options '-lguide'( and LIBM=-limf ) seems to be redundant in case of MKL10 and intel compilers, although MKL9 seems to require -lguide. (Jan 5th 2009)

Performance with 8 cores

(Dell T7400, Xeon X5472 3.00GHz Dual CPU, 16GB memory) The following elapsed times are based on R-2.8.0patch with statically linked MKL.

In the installation manual of R-system, the authors recommend that users avoid linking external lapack modules. In an 8 core linux environment, MKL lapack seems not so bad for large size matrices except general eigenvalue problem. ???


A simplified summary of the effect of --with-lapack option on elapsed time (size=4096)
Target problem With MKL lapack Without --with-lapack and -limf option
SVD of real square matrix better worse
Eigenvalue decomposition of real symmetric matrix better worse
Eigenvalue decomposition of general real matrix worse better
Inversion of general real matrix better worse
The effect of LIBM=-limf seems not clear for me. Intel Compilers seem to link against libimf without explicit specification.
----------------
> set.seed(23456)
> ksz<-  4096;
> 
> a <- matrix(rnorm(ksz*ksz),ksz);
> cat("verify a");cat(a[1,1],a[ksz,ksz],"\n");
verify a-0.0826315 0.2090599 
> 
> cat("svd of a size= ",ksz,"\n" );
svd of a size=  4096 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
511.149   4.184  77.137 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
514.810   3.882  76.973 
> 
> ata <- a+t(a)
> cat("Eigenvalues of a Real Symmetric Matrix\n");
Eigenvalues of a Real Symmetric Matrix
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
117.938   1.170  22.734 
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
117.359   1.229  22.845 
> 
> cat("Eigenvalues of a Real General Matrix\n");
Eigenvalues of a Real General Matrix
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
512.894  10.340 197.897 
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
508.038  10.068 199.287 
> 
--- another sesseion ---
> b <- matrix(rnorm(ksz4*ksz4),ksz4);
> cat("verify b");cat(b[1,1],b[ksz4,ksz4],"\n");
verify b-0.05666304 -0.568478 
> 
> cat("Inverse Matrix size=",ksz4,"\n")
Inverse Matrix size= 4096 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 22.962   0.574   4.331 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 23.576   0.558   4.297 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 22.762   0.568   4.277 

--------------

Two threads Performance ( OMP_NUM_THREADS=2 )

------
> set.seed(23456);
> # ksz <- 1024; ksz2<-200; ksz3<- 500000;
> ksz<-  4096;
> 
> a <- matrix(rnorm(ksz*ksz),ksz);
> cat("verify a");cat(a[1,1],a[ksz,ksz],"\n");
verify a-0.0826315 0.2090599 
> 
> cat("svd of a size= ",ksz,"\n" );
svd of a size=  4096 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
199.973   1.376 107.592 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
196.706   1.336 105.951 
> 
> ata <- a+t(a)
> cat("Eigenvalues of a Real Symmetric Matrix\n");
Eigenvalues of a Real Symmetric Matrix
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
 63.590   0.738  36.608 
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
 61.069   0.751  35.492 
> 
> cat("Eigenvalues of a Real General Matrix\n");
Eigenvalues of a Real General Matrix
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
284.532   2.760 219.313 
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
285.443   2.690 220.570 

-- another session ---
> b <- matrix(rnorm(ksz4*ksz4),ksz4);
> cat("verify b");cat(b[1,1],b[ksz4,ksz4],"\n");
verify b-0.05666304 -0.568478 
> 
> cat("Inverse Matrix size=",ksz4,"\n")
Inverse Matrix size= 4096 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 19.250   0.519  10.653 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 19.301   0.490  10.621 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 19.305   0.507  10.596 
> 
------------------------------

8 core Performance with a slight different configuration

(without MKL-lapack and LIBM=-limf )
--------------
> set.seed(23456)
> ksz<-  4096;
> 
> a <- matrix(rnorm(ksz*ksz),ksz);
> cat("verify a");cat(a[1,1],a[ksz,ksz],"\n");
verify a-0.0826315 0.2090599 
> 
> cat("svd of a size= ",ksz,"\n" );
svd of a size=  4096 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
649.070   4.664  94.134 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
631.953   4.568  92.363 
> 
> ata <- a+t(a)
> cat("Eigenvalues of a Real Symmetric Matrix\n");
Eigenvalues of a Real Symmetric Matrix
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
280.310   8.539  48.037 
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
275.271   8.924  47.220 
> 
> cat("Eigenvalues of a Real General Matrix\n");
Eigenvalues of a Real General Matrix
> print(system.time(a.eigen <- eigen(a)) )
    user   system  elapsed 
1026.395   15.623  140.516 
> print(system.time(a.eigen <- eigen(a)) )
    user   system  elapsed 
1073.126   15.786  146.984  

--- another session ----
> b <- matrix(rnorm(ksz4*ksz4),ksz4);
> cat("verify b");cat(b[1,1],b[ksz4,ksz4],"\n");
verify b-0.05666304 -0.568478 
> 
> cat("Inverse Matrix size=",ksz4,"\n")
Inverse Matrix size= 4096 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 31.694   0.888   5.681 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 32.415   0.913   5.669 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 32.597   0.969   5.679 
> 

---------------

Two threads Performance with a slight different configuration

(without MKL-lapack and LIBM=-limf )
---------------
> set.seed(23456);
> ksz<-  4096;
> 
> a <- matrix(rnorm(ksz*ksz),ksz);
> cat("verify a");cat(a[1,1],a[ksz,ksz],"\n");
verify a-0.0826315 0.2090599 
> 
> cat("svd of a size= ",ksz,"\n" );
svd of a size=  4096 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
213.110   1.375 114.060 
> print(system.time(a.svd <- svd(a)))
   user  system elapsed 
209.036   1.395 112.093 
> 
> ata <- a+t(a)
> cat("Eigenvalues of a Real Symmetric Matrix\n");
Eigenvalues of a Real Symmetric Matrix
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
 98.774   1.953  56.199 
> print(system.time(ata.eigen <- eigen(ata)) )
   user  system elapsed 
 97.414   1.813  55.330 
> 
> cat("Eigenvalues of a Real General Matrix\n");
Eigenvalues of a Real General Matrix
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
414.948   3.356 215.160 
> print(system.time(a.eigen <- eigen(a)) )
   user  system elapsed 
412.441   3.338 214.042 

--- another session ----
> b <- matrix(rnorm(ksz4*ksz4),ksz4);
> cat("verify b");cat(b[1,1],b[ksz4,ksz4],"\n");
verify b-0.05666304 -0.568478 
> 
> cat("Inverse Matrix size=",ksz4,"\n")
Inverse Matrix size= 4096 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 22.044   0.575  12.098 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 22.112   0.605  12.064 
> system.time(b.solve <- solve(b))
   user  system elapsed 
 21.576   0.577  11.938 
> 

--------