From b.h.mevik at usit.uio.no  Fri Sep  4 09:22:41 2015
From: b.h.mevik at usit.uio.no (=?utf-8?Q?Bj=C3=B8rn-Helge_Mevik?=)
Date: Fri, 4 Sep 2015 09:22:41 +0200
Subject: [Rd] Build R with MKL and ICC
In-Reply-To: <CAK1hC9uLYSyA-7W92TwD4J9adcxDRE1a2ig1iDDPSyN43kikyg@mail.gmail.com>
	(arnaud gaboury's message of "Wed, 2 Sep 2015 19:35:27 +0200")
References: <CAK1hC9uLYSyA-7W92TwD4J9adcxDRE1a2ig1iDDPSyN43kikyg@mail.gmail.com>
Message-ID: <s3szj12y7ge.fsf@slagelg.uio.no>

arnaud gaboury <arnaud.gaboury at gmail.com> writes:

> After a few days of reading and headache, I finally gave a try at
> building R from source with Intel MKL and ICC. Documentation and posts
> on this topic are rather incomplete, sometime fantasist et do not give
> much explanations about configure options.
> As I am not sure if mine is correct, I would appreciate some advices and hints.

This is how we build R with the Intel compilers and MKL on CentOS 6.x,
with different versions of R (latest version: 3.2.1) and Intel compilers
(latest version: 2015.3) on Intel SandyBridge CPUs:

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 --prefix=$destdir --with-blas='-mkl=parallel' --with-lapack --enable-BLAS-shlib


## Notes (they might not be true anymore):
## -static and -ipo break compilation
## -no-prec-div breaks make check
## -fp-model precise is needed for make check
## -wd188 removes a lot of warnings (see R Inst. & Adm. manual)

We have successfully used this setup for a couple of years now.

-- 
Regards,
Bj?rn-Helge Mevik



[Rd] Build R with MKL and ICC
=?utf-8?Q?Bj=C3=B8rn-Helge_Mevik?=