Package Details: r-mkl 3.3.0-1

Git Clone URL: https://aur.archlinux.org/r-mkl.git (read-only)
Package Base: r-mkl
Description: Language and environment for statistical computing and graphics, set up to use Intel's MKL by default.
Upstream URL: http://www.r-project.org/
Licenses: GPL
Conflicts: r
Provides: r=3.3.0,r-mkl=3.3.0
Submitter: giniu
Maintainer: alexanderp
Last Packager: alexanderp
Votes: 13
Popularity: 0.491363
First Submitted: 2010-05-06 00:10
Last Updated: 2016-05-03 21:58

Required by (70)

Sources (4)

Latest Comments

alexanderp commented on 2016-05-04 12:55

Warning: The newest version of the Intel Composer XE 2016 (update 3) breaks compatibility when using the Intel compilers (icc + ifort). With GCC and GFortran it compiles fine.

alexanderp commented on 2016-02-04 23:59

Hi tetonedge and adalardo.

I've fixed the url error.

I've also fixed the compilation with gcc to correctly use the MKL now and disabled the shared BLAS lib to speed up R. As a consequence, external libraries will need to be recompiled.

Additionally, OpenMP is now enabled by default for both icc and gcc (using Intel's libiomp5.)

On my laptop (i7-2640m), I get the following benchmark scores using http://r.research.att.com/benchmarks/R-benchmark-25.R :

* R 3.2.3 + intel-mkl-2016_update1 + r-mkl (icc/ifort)
Total time for all 15 tests_________________________ (sec): 6.072
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.387

* R 3.2.3 + intel-mkl-2016_update1 + r-mkl (gcc/gfortran)
Total time for all 15 tests_________________________ (sec): 6.309
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.405

adalardo commented on 2016-02-03 19:52

Thank for the package alexanderp!
I found an error in PKGBUILD, to fix it just change line:

url=('http://www.r-project.org/')

to

url="http://www.r-project.org/"

This is the bug commented by tetonedge.

I was not able to compile the package using icc. I comment the line:

#_CC="icc" # comment to build without the Intel compiler

and works!
Best,
Alexandre

tetonedge commented on 2016-02-01 14:20

I get ==> ERROR: url should not be an array
with the new PKGBUILD

alexanderp commented on 2016-01-20 20:59

I updated the PKGBUILD for R-3.2.3. The compilation uses Intel's MKL by default now, unless if commented out in the PKGBUILD.

I also added OpenMP support when compiling with gcc.

alexanderp commented on 2015-12-20 15:30

Hi. I had trouble compiling with the Intel compilers since some old and non-optimized options were used in your PKGBUILD. Here is a patch which fixes the PKGBUILD and compiles with Intel MKL, Intel BLAS (multi-threaded) and compiler optimizations:

diff --git a/PKGBUILD b/PKGBUILD
index c50e724..a7934a6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,7 +15,7 @@ conflicts=('r')
depends=('intel-mkl' 'bzip2' 'libpng' 'libjpeg' 'libtiff'
'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs'
'libxt' 'libxmu' 'pango' 'xz' 'desktop-file-utils' 'zip' 'unzip')
-makedepends=('jdk8-openjdk' 'gcc-fortran' 'tk')
+makedepends=('jdk8-openjdk-infinality' 'gcc-fortran' 'tk')
optdepends=('tk: tcl/tk interface' 'texlive-bin: latex sty files'
'icc: intel compiler' 'icpc: intel compiler' 'xiar: intel compiler'
'xild: intel compiler')
@@ -39,13 +39,13 @@ sha512sums=('71ba470875262b9f00fb6970f209788df4dad30e0a28373b824b60d8bc6401afb77

if [ "$CARCH" == "x86_64" ]; then
_intel_arch=intel64
- _intel_lib=mkl_gf_lp64
+ _intel_lib=mkl_intel_lp64
elif [ "$CARCH" == "i686" ]; then
_intel_arch=ia32
_intel_lib=mkl_gf
fi

-#_CC="icc" # uncomment to build with the Intel compiler
+_CC="icc" # uncomment to build with the Intel compiler

prepare() {
cd R-${pkgver}
@@ -60,10 +60,17 @@ prepare() {
build() {
# Set up the environment for MKL
source /opt/intel/mkl/bin/mklvars.sh ${_intel_arch}
+ source /opt/intel/composerxe/linux/bin/ifortvars.sh ${_intel_arch}
_icclibpath=$(echo $MKLROOT | sed "s%mkl%compiler%g")/lib/${_intel_arch}
_mkllibpath=$MKLROOT/lib/${_intel_arch}
- _mkllibs=" -fopenmp -Wl,--no-as-needed -L${_mkllibpath} -l${_intel_lib} -lmkl_core -lmkl_gnu_thread -ldl -lpthread -lm"
+ _openmplibpath=${PROD_DIR}/compiler/lib/intel64
+ _mkllibs="-L${_mkllibpath} -L${_openmplibpath} -Wl,--no-as-needed \
+ -l${_intel_lib} \
+ -lmkl_intel_thread \
+ -lmkl_core \
+ -liomp5 -ldl -lpthread -lm"
LDFLAGS="${LDFLAGS} -L${_icclibpath}"
+ export MAIN_LDFLAGS="-qopenmp"


if [ $_CC = "icc" ]; then
@@ -73,6 +80,10 @@ build() {
export LD="xild"
export _F77="ifort"
export _FC="ifort"
+ export CFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include"
+ export CXXFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include"
+ export FFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include"
+ export FCFLAGS="-O3 -ipo -qopenmp -parallel -xHost -fp-model strict -qopt-mem-layout-trans=3 -I${MKLROOT}/include"
else
export _F77="gfortran"
export _FC="gfortran"
@@ -87,11 +98,14 @@ build() {
rincludedir=/usr/include/R/ \
rdocdir=/usr/share/doc/R/ \
--with-x \
- --enable-R-shlib \
- --with-blas="${_mkllibs}" \
- --with-lapack \
- F77=${_F77} \
- FC=${_FC} \
+ --with-blas="${_mkllibs}" \
+ --with-lapack \
+ --enable-R-shlib \
+ --enable-memory-profiling \
+ --enable-BLAS-shlib \
+ --enable-openmp \
+ F77=${_F77} \
+ FC=${_FC} \
LIBnn=lib

# Place Intel's basic math library prior to GLIBC libm

jdarch commented on 2015-09-08 11:54

gabx, Intel's basic math library contains an performance-optimized subset of libm. By linking to it before linking to libm some operations might have slightly higher performance, as the call will then be handled by Intel's library. AMD has a similar library: http://developer.amd.com/tools-and-sdks/cpu-development/libm/

gabx commented on 2015-09-06 11:42

For information, what reason behind:
# Place Intel's basic math library prior to GLIBC libm

Thank you

gabx commented on 2015-07-29 14:18

It seems I have a mess with my ICC compiler.
$ makepkg
.....
checking for gcc... icc
checking whether the C compiler works... no
*********************************
$ cat src/R-3.2.1/config.log
............
configure:5941: checking for gcc
configure:5968: result: icc
configure:6197: checking for C compiler version
configure:6206: icc --version >&5
./configure: line 6208: icc: command not found
configure:6217: $? = 127
configure:6206: icc -v >&5
./configure: line 6208: icc: command not found
configure:6217: $? = 127
configure:6206: icc -V >&5
./configure: line 6208: icc: command not found
configure:6217: $? = 127
configure:6206: icc -qversion >&5
./configure: line 6208: icc: command not found
configure:6217: $? = 127
configure:6237: checking whether the C compiler works
configure:6259: icc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-O1,--sort-common,--as-needed,-z,relro -L/opt/intel/composerxe/compiler/lib/intel64 conftest.c >&5
./configure: line 6261: icc: command not found
*******************
$ ls /opt/intel
....
drwxr-xr-x 9 root root 4.0K Jul 11 18:51 composer_xe_2015.3.187/
lrwxrwxrwx 1 root root 17 Jul 11 18:37 composerxe -> ./composerxe-2015/
lrwxrwxrwx 1 root root 24 Jul 11 18:37 composerxe-2015 -> ./composer_xe_2015.3.187/
************************
$ ls /opt/intel/composer_xe_2015.3.187/bin/intel64
....
-rwxr-xr-x 1 root root 4.1M Jul 11 18:37 icc*
********************************

Thank you for help

halfhorn commented on 2015-06-27 17:39

@ leonardof

That looks like you have a problem with your mkl installation/configuration.

All comments