Package Details: r-mkl 4.4.2-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
Submitter: giniu
Maintainer: alexanderp
Last Packager: alexanderp
Votes: 25
Popularity: 0.000082
First Submitted: 2010-05-06 00:10 (UTC)
Last Updated: 2024-11-12 19:56 (UTC)

Required by (3402)

Sources (5)

Latest Comments

« First ‹ Previous 1 .. 4 5 6 7 8 9 10 11 12 13 14 .. 21 Next › Last »

alexanderp commented on 2019-04-22 19:54 (UTC)

@alyst Thanks for the diff. You make an interesting point, especially about respecting the users' makepkg.conf.

From my own experience, linking R with the MKL is very sensitive with respect to compiler flags and requires some fine-tuning to make sure that base R and some popular libraries compile correctly and that tests do not fail or deviate from the expected value. Carrying over any custom settings set in makepkg.conf could introduce errors.

What is the output of gcc -c -Q -march=native --help=target | grep -i 'march=\|mtune='? Could you provide compilation, test and benchmark logs for comparing the current PKGBUILD with the proposed changes?

I think the way forward would be to introduce a local variable to switch between native and makepkg.conf (generic) flags. I'd also be interested in hearing others' opinion on this.

alyst commented on 2019-04-22 16:28 (UTC)

Here's the proposed changes. I have also made the dependencies dynamically depend on _CC var (so that GCC-compiled package doesn't depend on intel compilers) + removed !makeflags (it only affected MAKEFLAGS anyway):

diff --git a/PKGBUILD b/PKGBUILD
index 8a315e6..77fc4f7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,12 +13,8 @@ url='http://www.r-project.org/'
 provides=("r=${pkgver}")
 conflicts=('r' 'microsoft-r-open')
 depends=('intel-mkl'
-        'intel-compiler-base'
-        'intel-fortran-compiler'
         'bzip2'
         'desktop-file-utils'
-        'gcc-libs'
-        'gcc-fortran'
         'icu'
         'libjpeg'
         'libpng'
@@ -44,7 +40,7 @@ backup=('etc/R/Makeconf'
         'etc/R/ldpaths'
         'etc/R/repositories'
         'etc/R/javaconf')
-options=('!makeflags' '!emptydirs')
+options=('!emptydirs')
 install=r-mkl.install

 source=("http://cran.r-project.org/src/base/R-${pkgver%%.*}/R-${pkgver}.tar.gz"
@@ -65,6 +61,15 @@ sha512sums=('077cbd4bc9f19a3a2485afbd4d8e08e0754ddcb9a10164cbc8478f239d5ed0ffaf6
 # Comment the following line to build the package with GCC
 # _CC="icc"

+# update dependencies w.r.t the compiler used
+if [[ $_CC = "icc" ]]; then
+  depends+=('intel-compiler-base'
+            'intel-fortran-compiler')
+else
+  depends+=('gcc-libs'
+            'gcc-fortran')
+fi
+
 prepare() {
   cd R-${pkgver}
   # set texmf dir correctly in makefile
@@ -113,7 +118,7 @@ build() {
     export FFLAGS="${_intel_cc_opt}"
     export FCFLAGS="${_intel_cc_opt}"
   else
-    _gcc_opt=" -O3 -m64 -march=native -I${MKLROOT}/include"
+    _gcc_opt="-m64 -I${MKLROOT}/include"
     # export LDFLAGS=" -fopenmp"

     # Dynamic Linking
@@ -133,10 +138,10 @@ build() {
     export LD="ld"
     export F77="gfortran"
     export FC="gfortran"
-    export CFLAGS="${_gcc_opt}"
-    export CXXFLAGS="${_gcc_opt}"
-    export FFLAGS="${_gcc_opt}"
-    export FCFLAGS="${_gcc_opt}"
+    export CFLAGS="$CFLAGS ${_gcc_opt}"
+    export CXXFLAGS="$CXXFLAGS ${_gcc_opt}"
+    export FFLAGS="$FFLAGS ${_gcc_opt}"
+    export FCFLAGS="$FCFLAGS ${_gcc_opt}"
   fi

   ./configure  --prefix=/usr \

alyst commented on 2019-04-22 15:03 (UTC)

Currently, r-mkl overrides the -march GCC switch from "makepkg.conf" and sets it to "native". While I understand the intention, this creates problems for some scenarios.

E.g. I'm trying to make a docker image for a slightly different architecture than my local machine. So I have the proper "-march" switch in "makepkg.conf", but it would be ignored by r-mkl PKGBUILD. One possibility would be to fix the PKGBUILD from within Dockerfile, but that doesn't play well with using AUR helpers like yay or pikaur to automatically manage dependencies.

Would it be possible to implement either: 1) respect XXXFLAGS set by makepkg.conf and only minimally modify them (just append "-m64 -I...") 2) change PKGBUILD to -march=$CC_ARCH, where CC_ARCH is some envvar that defaults to "native"?

pat-s commented on 2018-08-12 17:33 (UTC)

@nessuno Well, the most recent icu is v62.1 so maybe that the reason why the fix does not work for you? Other libraries (including r-mkl) using icu need to be reinstalled after an icu update to work with the most recent version.

Anyways, r-mkl does not have any responsibility here so the discussion is actually off-topic.

nessuno commented on 2018-08-12 13:22 (UTC)

The package glibc-fix-r-and-electron-git doesn't solve the problem for me. Anyway the solution I proposed before works. Moreover, I also uploaded a new AUR package "icu61" to solve the problem of the libicuuc.so.61 libraries request. If anyone have a better and more proper solution for these problems, please let me know.

pat-s commented on 2018-08-12 08:51 (UTC)

Install this hotfix version of glibc-2.28 and you can use R again without problems and also upgrade all other libraries again: https://bugs.archlinux.org/task/59550#comment171883

nessuno commented on 2018-08-12 07:45 (UTC)

Thanks to an advice on the rstudio-desktop-bin package page I solved the aforementioned problem through

devtools::install_github('r-lib/later')

But now I've also another problem, since the libicuuc.so.61 is required. I saw there are other older icu versions on AUR, but the 61 is lacking. Is there anyone that is able to help me.

Thank you very much as always

nessuno commented on 2018-08-09 14:33 (UTC) (edited on 2018-08-09 14:34 (UTC) by nessuno)

Problem solved downgrading glibc from 2.28 to 2.27

Thanks so much for the help

alexanderp commented on 2018-08-08 06:57 (UTC)

@nessuno, probably something related to glibc.

See https://github.com/rstudio/shiny/issues/2150 and https://bugs.archlinux.org/task/59550

nessuno commented on 2018-08-07 20:40 (UTC)

After the last update of the package I have this errore when I try to install sparklyr

terminate called after throwing an instance of 'std::runtime_error'
  what():  Mutex creation failed
/usr/lib64/R/bin/INSTALL: line 34: 10596 Done                    echo 'tools:::.install_packages()'
     10597 Aborted                 (core dumped) | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --slave --args ${args}

Someone is able to help me in understanding what it means and how to solve it?

Thanks so much!