From nate at verse.com  Tue Sep 29 20:11:59 2015
From: nate at verse.com (Nathan Kurz)
Date: Tue, 29 Sep 2015 11:11:59 -0700
Subject: [Rd] Build R with MKL and ICC
In-Reply-To: <CAK1hC9sZKdaWTGxCDQhhPa-nJARfd-WG=ivi8gWpLiL-4BA8VQ@mail.gmail.com>
References: <CAK1hC9uLYSyA-7W92TwD4J9adcxDRE1a2ig1iDDPSyN43kikyg@mail.gmail.com>
	<CAK1hC9u0btbbXGR3+OAcAd5n3SbFwUHoH+YsT5FzVpaeyZWdEQ@mail.gmail.com>
	<1441382281.4083.26.camel@iarc.fr>
	<CAK1hC9vg0SePBhEbp-Xpt8W1BDH-kY3XTLr39ZHCp2k2MHxUhA@mail.gmail.com>
	<1441621388.4083.54.camel@iarc.fr>
	<CAFAN8vw53p+dCnr_LroKZbQMw66kwMiXypNBJAZVHhW998Di2g@mail.gmail.com>
	<CAK1hC9sZKdaWTGxCDQhhPa-nJARfd-WG=ivi8gWpLiL-4BA8VQ@mail.gmail.com>
Message-ID: <CAFAN8vz0H9TZ4Q3+dkoaMWvrJvK9O9g3=ioXWDS6zCM+YFqfbA@mail.gmail.com>

Hi Arnaud --

I'm glad it's working for you.  I'm not sure I understand your final
answer.  Are you saying that the version I posted worked for you as
given, or that you had to remove some of the other options?

Perhaps you could post the full final recipe in a way that others can
copy and paste if they find this thread in the future?

Also, did you determine if the the same approach worked for linking to
MKL worked when using a non-Intel compiler?   That is, can you
substitute the gcc or clang tool names and get the same result?

--nate

On Tue, Sep 29, 2015 at 9:07 AM, arnaud gaboury
<arnaud.gaboury at gmail.com> wrote:
> On Wed, Sep 9, 2015 at 11:26 PM, Nathan Kurz <nate at verse.com> wrote:
>>
>> As a short and simple approach, I just compiled the current R release
>> on Ubuntu with ICC and MKL using just this:
>>
>> $ tar -xzf R-3.2.2.tar.gz
>> $ cd R-3.2.2
>> $ CC=icc CXX=icpc AR=xiar LD=xild CFLAGS="-g -O3 -xHost" CXXFLAGS="-g
>> -O3 -xHost" ./configure --with-blas="-lmkl_rt -lpthread" --with-lapack
>> --enable-memory-profiling --enable-R-shlib
>> $ make
>> $ sudo make install
>> $ R --version
>> R version 3.2.2 (2015-08-14) -- "Fire Safety"
>
>
> That is exactly the right combo: with-blas="-lmkl_rt -lpthread"
> Nothing more for $MKL
>
> now
> $ ldd bin/exec/R
> linux-vdso.so.1 (0x00007ffe305f9000)
> libmkl_rt.so => /opt/intel/mkl/lib/intel64_lin/libmkl_rt.so (0x00007f216c9e3000)
>         .................................



[Rd] Build R with MKL and ICC
Nathan Kurz