From plummer at iarc.fr  Tue Mar 17 10:39:35 2009
From: plummer at iarc.fr (Martyn Plummer)
Date: Tue, 17 Mar 2009 10:39:35 +0100
Subject: [Rd] [R] R with MKL
In-Reply-To: <dc41e1260903162012y2d3d2414o41fbe5082945b7ae@mail.gmail.com>
References: <fb1538e20903161533u599d8c00mef61f71bf2427a39@mail.gmail.com>
	<dc41e1260903162012y2d3d2414o41fbe5082945b7ae@mail.gmail.com>
Message-ID: <1237282775.3044.14.camel@localhost.localdomain>

On Tue, 2009-03-17 at 12:12 +0900, Ei-ji Nakama wrote:
> Hi
> 
> > I have seen a lot of problems from people trying to compile R with
> > MKL. So I am writing my experience in case it helps and to ask one
> > question. I installed R-2.8.1.patched in Ubuntu 9.04 (gcc 4.3.3) using
> > MKL 10.1.1.019.
> 
> Do you use gcc and gfortran?
> 
> > I configured correctly (following MKL userguide) with :
> >
> > sudo ./configure --with-blas="-I/opt/intel/mkl/10.1.1.019/include
> > -L/opt/intel/mkl/10.1.1.019/lib/em64t -lmkl_intel_lp64
> > -lmkl_intel_thread -lmkl_core -liomp5 -lpthread"
> > --with-lapack="-I/opt/intel/mkl/10.1.1.019/include
> > -L/opt/intel/mkl/10.1.1.019/lib/em64t -lmkl_intel_lp64
> > -lmkl_intel_thread -lmkl_core -liomp5 -lpthread"
> 
> cited reference https://svn.r-project.org/R/trunk/doc/manual/R-admin.texi
> | You are strongly encouraged to read the MKL User's Guide
> | <snip>
> | @example
> | MKL="   -L$@{MKL_LIB_PATH@}                               \
> |         -Wl,--start-group                               \
> |                 $@{MKL_LIB_PATH@}/libmkl_gf_lp64.a        \
> |                 $@{MKL_LIB_PATH@}/libmkl_gnu_thread.a     \
> |                 $@{MKL_LIB_PATH@}/libmkl_core.a           \
> |         -Wl,--end-group                                 \
> |         -liomp5 -lpthread"
> | @end example
> 
> However, It is a little different.( -lgomp and configure line)
> 
> MKL="   -L$@{MKL_LIB_PATH@}                               \
>         -Wl,--start-group                               \
>                 $@{MKL_LIB_PATH@}/libmkl_gf_lp64.a        \
>                 $@{MKL_LIB_PATH@}/libmkl_gnu_thread.a     \
>                 $@{MKL_LIB_PATH@}/libmkl_core.a           \
>         -Wl,--end-group                                 \
>         -lgomp -lpthread"
> ./configure --with-blas="$MKL" --with-lapack="$MKL"

Yes I see. If you are statically linking to MKL, you want to link to the
GNU OMP runtime for portability. Sorry about that.

> > But in order to compile had to edit src/modules/lapack/vecLibg95c.c
> > and comment out the include. Weird, since I am not building for Mac.
> 
> Please note the thing that ABI of fortran is different with Intel compiler
> and GNU compiler.
> difficult to detect the mistake.

-----------------------------------------------------------------------
This message and its attachments are strictly confidenti...{{dropped:8}}



[Rd] [R] R with MKL
Martyn Plummer