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

Compiling R with serial MKL (failed due to zdotu error?)

$
0
0

Hi!

I'm trying to get R 3.0.1 to compile using composer_xe_2013.2.146 using the serial MKL. I followed the instructions from http://software.intel.com/en-us/articles/using-intel-mkl-with-r , yet at the configure-step, I get

checking whether double complex BLAS can be used... no

configure then goes on to compile R without linking the MKL (i.e., the resulting binary uses R's own BLAS implementation, which offers subpar performance).

Searching around the web, it would appear that I am far from the only one having run this issue, yet I was unable to find any solutions for it. (I found an old discussion about the topic here: http://software.intel.com/en-us/forums/topic/326016  ... yet it didn't include any solution steps, and in fact I believe in the end the user ended up with an R version that didn't even link with the MKL).

I investigated the configure-failure, and it stems from the following failed test:

a Fortran-file (the attached conftestf.f) calls zdotu, and checks the results against a manual dot-product. It sets a failure flag if the zdotu-result and the manual dot-product don't match. This is then called from the C file  conftest.c (I'm assuming to test Fortran<>C interfacing or something), which returns the failure-flag as a return code.

I've attached the files to this post (slightly modified so the failure flag gets printed to stdout). I compile the files with:

export LIBDIR="/apps/intel/compiler/composer_xe_2013.2.146/mkl/lib/intel64/:/apps/intel/compiler/composer_xe_2013.2.146/compiler/lib/intel64/"

ifort -c conftestf.f -L$LIBDIR -lmkl_gf_lp64 -lmkl_sequential -lmkl_core
icc -c conftest.c -L$LIBDIR -lmkl_gf_lp64 -lmkl_sequential -lmkl_core
icc conftestf.o conftest.o -o conftest -L$LIBDIR -lmkl_gf_lp64 -lmkl_sequential -lmkl_core
./conftest

The call to ./conftest will print out the failure flag, which on my machine will always output 1. This makes the configure-test fail and leads R to ignore the MKL I want to link it with.

For full reference, this is how I call ./configure:

/apps/intel/compiler/composer_xe_2013.2.146/bin/compilervars_global.sh intel64
/apps/intel/compiler/composer_xe_2013.2.146/mkl/bin/vars/mklvars.sh intel64
export CC='icc -std=c99 '
export F77='ifort '
export CXX='icpc '
export FC='ifort '
export CPPFLAGS="-O3 -DNDEBUG -g -march=native "
export CFLAGS=$CPPFLAGS
export FCFLAGS=$CPPFLAGS
export FFLAGS=$CPPFLAGS

export MKL_LIB_PATH=/apps/intel/compiler/composer_xe_2013.2.146/mkl/lib/intel64:/apps/intel/compiler/composer_xe_2013.2.146/compiler/lib/intel64/
export LD_LIBRARY_PATH=$MKL_LIB_PATH
export MKL=" -L${MKL_LIB_PATH} -lmkl_gf_lp64 -lmkl_sequential -lmkl_core "
./configure --with-blas="$MKL" --enable-threads=posix --with-lapack --enable-memory-profiling --enable-R-shlib

AttachmentSize
Downloadconftest.c847 bytes
Downloadconftestf.f415 bytes

Viewing all articles
Browse latest Browse all 2652

Trending Articles