Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Build R with Intel MKL shared library

$
0
0

I build sucessfully R 3.2.2 with Intel MKL and ICC. Now I am wondering if library linking are indeed correct. Here is the output:

% R CMD ldd BUILD/R-3.2.2/bin/exec/R
	linux-vdso.so.1 (0x00007ffdbddba000)
	libR.so => /usr/lib64/R/lib/libR.so (0x00007fc76f767000)
	libRblas.so => not found
	libm.so.6 => /lib64/libm.so.6 (0x00007fc76f452000)
	libiomp5.so => /opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin/libiomp5.so (0x00007fc76f111000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc76eef9000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc76ecdd000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fc76e91d000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fc76e718000)
	libblas.so.3 => /lib64/libblas.so.3 (0x00007fc76c674000)
	libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007fc76c349000)
	libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007fc76c109000)
	libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fc76bebf000)
	libtre.so.5 => /lib64/libtre.so.5 (0x00007fc76bcaf000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fc76ba3e000)
	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fc76b818000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fc76b608000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fc76b3f1000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fc76b1e9000)
	libicuuc.so.54 => /lib64/libicuuc.so.54 (0x00007fc76ae58000)
	libicui18n.so.54 => /lib64/libicui18n.so.54 (0x00007fc76aa00000)
	libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fc76a7de000)
	/lib64/ld-linux-x86-64.so.2 (0x000055986b173000)
	libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fc76a5b3000)
	libicudata.so.54 => /lib64/libicudata.so.54 (0x00007fc768b88000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc768806000)

As you can see,  libblas.so.3 is linked to  /lib64/libblas.so.3 (0x00007fc76c674000), the library installed on my system. I was expecting something like this (the output comes from another machine with an already built package for R with MKL installed)

libmkl_gf_lp64.so => /opt/intel/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007f3bdfef9000)
libmkl_core.so => /opt/intel/mkl/lib/intel64/libmkl_core.so (0x00007f3bde38c000)
libmkl_gnu_thread.so => /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007f3bdd635000)

Here is part of my package build configuration:

%global _omp_lib /opt/intel/lib/intel64
%global _mkllibs " -fopenmp -wl,--no-as-needed -L%{_mkllibpath} -L%{_omp_lib} -lmkl_intel_ilp64 -lmkl_core -lmkl_intel _intel_thread -liomp5 -lpthread"
%global _mklroot /opt/intel/compilers_and_libraries_2016.0.109/linux/mkl


# Not sure it is needed as all libs are defined in ld.so.conf.d/
source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/bin/ifortvars.sh intel64

export CC="icc -std=c99"
export F77="ifort"
export CXX="icpc"
export FC="ifort"
export AR="xiar"
export LD="xild"

export CFLAGS="-ip -ipo -opt-mem-layout-trans=3 -xHost -mavx -fp-model precise -wd188 -DMKL_ILP64 -qopenmp -parallel -I%{_mklroot}/include"

%configure \
.......
         --with-blas=%{_mkllibs} \
         --with-lapack \
         --enable-R-shlib \
         --enable-memory-profiling \
         --enable-BLAS-shlib \
................

What am I doing wrong (if doing wrong) and why this liblas.so.3 in my ldd output? Why no libmkl_*   => /opt/intel/...

I have tried various settings, with always same result.

Thank you for help


Viewing all articles
Browse latest Browse all 2652

Trending Articles