[Rd] --enable-R-shlib and external BLAS/LAPACK libraries

Bjørn-Helge Mevik b.h.mevik at usit.uio.no
Fri Oct 19 09:53:33 CEST 2012

A couple of years ago (in 2008, using R 2.7.x, I believe) I noted that
using the configure switch --enable-R-shlib when buildig R made
configure ignore any specified external LAPACK library and use the
internal one insted. I asked why, and was told it was intentional.

Now, with R 2.15.1, I see that it at least appears that this is no
longer the case.  I've run configure like this:

fast="-ip -O3 -opt-mem-layout-trans=3 -xHost -mavx"
export CC="icc"
export CFLAGS="$fast -wd188 -fp-model precise"
export F77="ifort"
export FFLAGS="$fast -fp-model precise"
export CXX="icpc"
export CXXFLAGS="$fast -fp-model precise"
export FC="ifort"
export FCFLAGS="$fast -fp-model precise"

./configure --with-blas='-mkl=parallel' --with-lapack --enable-R-shlib

(in addition, paths to the intel compilers and librareis are set up).

The output from configure says:

  Interfaces supported:      X11, tcltk
  External libraries:        readline, BLAS(generic), LAPACK(in blas)
  Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo
  Options enabled:           shared R library, R profiling, Java

After make install, we get a libR.so linked to MKL libraries (see below
for details).

Am I correct in assuming that this R will use the intel MKL libraries
for BLAS and LAPACK routines?  (That would be very nice, because we want
to use the fast libraries, but some of our uses need to have libR.so, so
up to now, we've had to build to versions of R.)

# ldd libR.so 
        linux-vdso.so.1 =>  (0x00007ff52bcf8000)
        libifport.so.5 => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libifport.so.5 (0x00007ff52b47d000)
        libifcore.so.5 => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libifcore.so.5 (0x00007ff52b238000)
        libimf.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libimf.so (0x00007ff52ae6d000)
        libsvml.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libsvml.so (0x00007ff52a6f3000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff52a45a000)
        libirc.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libirc.so (0x00007ff52a30b000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff52a0ee000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007ff529ee9000)
        libreadline.so.6 => /lib64/libreadline.so.6 (0x00007ff529ca6000)
        librt.so.1 => /lib64/librt.so.1 (0x00007ff529a9e000)
        libmkl_intel_lp64.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007ff5292b7000)
        libmkl_intel_thread.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/mkl/lib/intel64/libmkl_intel_thread.so (0x00007ff528238000)
        libmkl_core.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/mkl/lib/intel64/libmkl_core.so (0x00007ff5271c2000)
        libiomp5.so => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libiomp5.so (0x00007ff526ecf000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff526cb9000)
        libintlc.so.5 => /cluster/software/VERSIONS/intel-2011.10/composer_xe_2011_sp1/lib/intel64/libintlc.so.5 (0x00007ff526b6a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff5267d7000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003445200000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007ff5265b6000)

Bjørn-Helge Mevik

More information about the R-devel mailing list