I have been scratching my head for more than a week, with no answer to my issue. I want to build R from cran source with Intel MKL1 as a shared library. Here is the small script I use to test my configuration:
#! /bin/sh
export MKL=/opt/intel/compilers_and_libraries_2016.0.109/linux/mkl
MKL=" -L${_mkllibpath} \
-Wl,--start-group \
-lmkl_gf_lp64 \
-lmkl_gnu_thread \
-lmkl_core \
-Wl,--end-group \
-lgomp -lpthread"
./configure --prefix=/usr \
--libdir=/usr/lib \
--datarootdir=/usr/share \
rsharedir=/usr/share/R/ \
rincludedir=/usr/include/R/ \
rdocdir=/usr/share/doc/R/ \
--with-blas="${MKL}" \
--with-lapack \
--enable-R-shlib
make -j4
This small script do the following:
- build R with gcc and gfortran on x86_64
- build R with gnu threads
- export the path to Intel MKL libraries
- dynamically link BLAS to intel MKL
Now the part where I start getting mad. On one system, Archlinux, the build will let me with the following output from ldd ran inside the build directory
$ ldd bin/exec/R
.....
libmkl_gf_lp64.so => /opt/intel/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007f7707797000)
libmkl_core.so => /opt/intel/mkl/lib/intel64/libmkl_core.so (0x00007f7705c2a000)
libmkl_gnu_thread.so => /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007f7704ed3000)
libimf.so => /opt/intel/lib/libimf.so (0x00007f7704814000)
libintlc.so.5 => /opt/intel/lib/libintlc.so.5 (0x00007f770284b000)
.......
This is exactly what I am looking for. Now, same script with Intel MKL installed in same path, run on Fedora22.
$ ldd bin/exec/R
linux-vdso.so.1 (0x00007ffe9a9c5000)
libR.so => /usr/lib64/R/lib/libR.so (0x00007f45d9b69000)
libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f45d9947000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f45d972a000)
libc.so.6 => /lib64/libc.so.6 (0x00007f45d936a000)
libblas.so.3 => /lib64/libblas.so.3 (0x00007f45d9111000)
libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f45d8de5000)
......
As seen, not links at all to Intel MKL.
I have played with all kinds of make options, with LD_PATHS, with linker options etc; I have checked environment varaibles; I have checked ldconfig cache; etc. Still impossible to get the correct linking with Fedora.
I would appreciate any hints, where to look at for finding the root of my issue.