Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conda install r-essentials with MKL

On my RHEL-server I do not have admin rights, but I can create Conda environments. I would like to create a Conda environment running R with Intel MKL (Intel® Math Kernel Library).

I create the environment with R_defaults.yml, running $> conda env create --file R_defaults.yml:

name: R_defaults
channels:
  - defaults
  - conda-forge
dependencies:
  - pkgs/r::r-essentials=3.6.0=r36_0

Activating the environment, starting R, and sessionInfo() I get that MKL is not used:

R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.7 (Maipo)

Matrix products: default
BLAS/LAPACK: /home/geiringe/miniconda3/envs/R_r/lib/R/lib/libRblas.so

Microsoft R Open (https://mran.microsoft.com/download) can be installed with MKL.

It seems Anaconda has changed opinions about Microsoft R Open. In June 2018 it was said to become default R for the Anaconda distribution (https://www.anaconda.com/introducing-microsoft-r-open-as-default-r-for-anaconda-distribution/). Now they want us to migrate away from Microsoft R Open, and they will not update MRO packages (https://docs.anaconda.com/anaconda/user-guide/tasks/using-r-language/#switch-an-environment-from-r-to-mro). The latest version of r::mro-base is 3.5.1, and is more than 1 year old. The latest version of r::r-essentials is 3.6.0

Is there a way for me to create a Conda environment with an updated version of R and with MKL?

like image 688
Geir Inge Avatar asked Nov 13 '19 10:11

Geir Inge


1 Answers

Prioritizing Conda Forge and explicitly specifying a libblas build get's it working for me (osx-64). E.g.,

YAML

name: R_mkl
channels:
  - conda-forge
  - defaults
dependencies:
  - conda-forge::r-essentials=3.6
  - conda-forge::libblas=3.8.0=14_mkl

Output from R -e "sessionInfo()" in activated env:

R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS/LAPACK: /Users/mfansler/miniconda3/envs/r_mkl/lib/libmkl_rt.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.1

Hopefully it's similar for linux-64.

like image 97
merv Avatar answered Sep 18 '22 00:09

merv