Link R with an optimized version of the BLAS library (OpenBLAS).

ropenblas(x = NULL, restart_r = TRUE)

Arguments

x

OpenBLAS library version to be considered. By default, x = NULL.

restart_r

If TRUE, a new section of R is started after compiling and linking the OpenBLAS library.

Value

Returns a warning message informing you if the procedure occurred correctly. You will also be able to receive information about missing dependencies.

Details

The ropenblas() function will only work on Linux systems. When calling the ropenblas() function on Windows, no settings will be made. Only a warning message will be issued informing you that the configuration can only be performed on Linux systems.

The function will automatically download the latest version of the OpenBLAS library. However, it is possible to inform olds versions to the single argument of ropenblas(). The ropenblas() function downloads, compiles and link R to use of the OpenBLAS library. Everything is done very simply, just loading the library and invok the function ropenblas().

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.

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

  1. GNU Make;

  2. GNU GCC Compiler (C and Fortran).

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. Other details you may also find here.

Note

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.

Author

Pedro Rafael D. Marinho (e-mail: pedro.rafael.marinho@gmail.com)

Examples

# ropenblas()