Skip to content

Instantly share code, notes, and snippets.

@masuday
Last active September 13, 2023 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masuday/98ed66a3112cf66e90b1cbccdb751a2f to your computer and use it in GitHub Desktop.
Save masuday/98ed66a3112cf66e90b1cbccdb751a2f to your computer and use it in GitHub Desktop.

R with MKL

Environment

  • AlmaLinux 8.8
  • OneAPI 2023.1 (with ifort and MKL)
# Activate ifort & MKL on bash
$ . /opt/intel/oneapi/setvars.sh

# some libraries
$ su -
su$ dnf install readline-devel libXt-devel libcurl-devel libjpeg-devel cairo-devel libtiff-devel xz-devel pcre2-devel java
su$ dnf install openssl-devel libxml2-devel harfbuzz-devel fribidi-devel
su$ exit

# Download & compile R with MKL
$ wget https://cran.r-project.org/src/base/R-4/R-4.3.1.tar.gz
$ tar xvzf R-4.3.1.tar.gz
$ cd R-4.3.1
$ FC=ifort ./configure --prefix=/opt/local/R/R-4.3.1 --with-blas=" -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl " --with-lapack
$ make
$ su
su$ make install
su$ exit

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment