Learn R Programming

⚠️There's a newer version (0.4.0) of this package.Take me there.

ropenblas package

The ropenblas is a package designed to facilitate the linking of the library OpenBLAS with the language R. The package, which works only for Linux systems, will automatically download the latest source code from the OpenBLAS library and compile the code. The package will automatically bind the language R to use the OpenBLAS library. Everything will be done automatically regardless of the Linux distribution you are using.

You can also specify older versions of the OpenBLAS library. Automatically, if no version is specified, the ropenblas package will consider the latest version of the library OpenBLAS.

Considering using the OpenBLAS library rather than the BLAS may bring extra optimizations for your code and improved computational performance for your simulations, since OpenBLAS is an optimized implementation of the library BLAS.

Some of the reasons why it is convenient to link R language to the use of BLAS optimized alternatives can be found here. Several other benchmarks that point to improved computing performance by considering the library OpenBLAS can be found on the internet.

Dependencies

You must install the following dependencies on your operating system (Linux):

1 - make: GNU make utility to maintain groups of programs;

2 - gcc: The GNU Compiler Collection - C and C++ frontends;

3 - gcc-fortran: The GNU Compiler Collection - Fortran frontends.

Installation

Installing the ropenblas library is easy and will require you to have installed the devtools package. This will allow you to install the ropenblas package directly from GitHub. To install, after installing the devtools package, do:

devtools::install_github(repo = "prdm0/ropenblas", force = TRUE)

Use

Installing, compiling, and linking the OpenBLAS version 0.3.7 library to the R language:

library(ropenblas)
ropenblas(x = "0.3.7")

Notes:

  • You do not have to in every section of R make use of the ropenblas() function. Once the function is used, R will always consider using the OpenBLAS library in future sections.

  • OpenBLAS versions tested: 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6 and 0.3.7. These are the values that will be passed to x in ropenblas(x).

Details

Your linux operating system may already be configured to use the OpenBLAS library. Therefore, most likely R will already be linked to this library. To find out if the R language is using the OpenBLAS library, at R, do:

extSoftVersion()["BLAS"]

If R is using the OpenBLAS library, something like /any_directory/libopenblas.so should be returned. Therefore, there should be the name openblas in the shared object returned (file extension .so).

If the ropenblas() function can identify that the R language is using the version of OpenBLAS you wish to configure, a warning message will be returned asking if you really would like to proceed with the configuration again.

The ropenblas() function will download the desired version of the library OpenBLAS, compile and install the library in the /opt directory of your operational system. If the directory does not exist, it will be created so that the installation can be completed. Subsequently, files from the version of BLAS used in R will be symbolically linked to the shared object files of the library version OpenBLAS compiled and installed in /opt.

You must be the operating system administrator to use this library. Therefore, do not attempt to use it without telling your system administrator. If you have the ROOT password, you will be responsible for everything you do on your operating system.

Advantages

Some advantages of using the ropenblas library:

  • Everything is done within the R language;

  • The procedure will be the same for any Linux distribution;

  • The OpenBLAS library will be compiled and you will choose which build version to bind to R, regardless of your Linux distribution;

  • If your GNU/Linux distribution does not have updated versions of OpenBLAS, it matters little. The ropenblas package fetches the latest stable release of the OpenBLAS library development account on GitHub;

  • You do not need to know Linux well. In some distributions, it may not be so simple for a less experienced user to compile and link the library to the OpenBLAS library with the R language;

  • It is much easier to direct a person to link OpenBLAS with R saying "run ropenblas() within R" than asking that person to verify that an unoptimized version of BLAS installed on the system. Then you have to guide the removal of the unoptimized version of BLAS and guide it to the installation of the library OpenBLAS through the most diverse procedures depending on the GNU/Linux distribution used;

  • As stated earlier, the procedure works for any Linux and this includes Android. If your Android is capable of running privileged commands (ROOT) and if you have R installed via Termux with the required dependencies, you can compile and link OpenBLAS with R using ropenblas.

Copy Link

Version

Install

install.packages('ropenblas')

Monthly Downloads

468

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Pedro Rafael Diniz Marinho

Last Published

December 2nd, 2019

Functions in ropenblas (0.1.0)

ropenblas

Download, Compile and Link OpenBLAS Library with R