Package Details: r-mkl 3.6.3-1

Git Clone URL: https://aur.archlinux.org/r-mkl.git (read-only, click to copy)
Package Base: r-mkl
Description: Language and environment for statistical computing and graphics, linked to the Intel(R) MKL.
Upstream URL: http://www.r-project.org/
Keywords: hpc mathematics modelling r statistics
Licenses: GPL
Conflicts: microsoft-r-open, r
Provides: r=3.6.3
Submitter: giniu
Maintainer: alexanderp
Last Packager: alexanderp
Votes: 19
Popularity: 0.70
First Submitted: 2010-05-06 00:10
Last Updated: 2020-03-28 12:34

Dependencies (25)

Required by (312)

Sources (4)

Pinned Comments

alexanderp commented on 2020-02-17 18:36

@laborat, the recent (two days old) community/intel-mkl package lacks a lot of content from the split package.

Please keep on using aur/intel-mkl as part of aur/intel-parallel-studio-xe until the relevant scripts are ported to community.

Also, as a general note, those with Ryzen processors could obtain even better performance by setting an environment variable. Please see https://www.reddit.com/r/MachineLearning/comments/f2pbvz/discussion_workaround_for_mkl_on_amd/

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.

leonardof commented on 2015-06-04 00:06

I wasn't able to compile this package. Starting build(), I got this message:

/tmp/yaourt-tmp-leonardof/aur-r-mkl/./PKGBUILD: line 62: /opt/intel/mkl/bin/mklvars.sh: Arquivo ou diretório não encontrado

"Arquivo ou diretório não encontrado" means "file or directory not found". That's because the script is in /opt/intel/composer_xe_2015.3.187/mkl/bin/mklvars.sh.

I guess it's not really r-mkl's fault, but I thought you might want to know. Anyway, I created a symlink between the real and the expected "mkl" directory, and at last build took a little longer to fail.

This time I got this message in the start of buid:

/tmp/yaourt-tmp-leonardof/aur-r-mkl/./PKGBUILD: line 69: [: =: esperado operador unário

"esperado operador unário" means "expected unary operator". The compilation went on, and eventually ended with this:

gcc -shared -fopenmp -Wl,-O1,--sort-common,--as-needed,-z,relro -L/opt/intel/composerxe/compiler/lib/intel64 -o libR.so CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o `ls ../unix/*.o ../appl/*.o ../nmath/*.o` ../extra/tre/libtre.a -lblas -lgfortran -limf -lm -lquadmath -lreadline -lpcre -llzma -lbz2 -lz -lrt -ldl -limf -lm -licuuc -licui18n
/usr/bin/ld: cannot find -limf
/usr/bin/ld: cannot find -limf
collect2: error: ld returned 1 exit status
Makefile:185: recipe for target 'libR.so' failed
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory '/tmp/yaourt-tmp-leonardof/aur-r-mkl/src/R-3.2.0/src/main'
Makefile:143: recipe for target 'R' failed
make[2]: *** [R] Error 2
make[2]: Leaving directory '/tmp/yaourt-tmp-leonardof/aur-r-mkl/src/R-3.2.0/src/main'
Makefile:28: recipe for target 'R' failed
make[1]: *** [R] Error 1
make[1]: Leaving directory '/tmp/yaourt-tmp-leonardof/aur-r-mkl/src/R-3.2.0/src'
Makefile:59: recipe for target 'R' failed
make: *** [R] Error 1

halfhorn commented on 2015-05-06 08:08

This package is being maintained at https://github.com/m-wells/r-mkl if you would like to submit pull requests and help contribute to the maintenance of this package.

jdarch commented on 2014-12-13 19:52

I will orphan this package.

This package depends on intel-mkl, which I have orphaned as my license is moving towards its end and I have not yet decided if I would take a license for Intel Parallel Studio XE. I suppose someone with a clear future outlook with regard to MKL/Parallel might be able to take over maintenence.

It might also be possible to script use of Intel's compiler, as most people using MKL should have that available in the future.

tetonedge commented on 2014-11-04 03:02

R 3.1.2 was released, please update when you can. Thanks!