Package 'ropenblas'

Title: Download, Compile and Link 'OpenBLAS' Library with R
Description: The 'ropenblas' package (<https://prdm0.github.io/ropenblas/>) is useful for users of any 'GNU/Linux' distribution. It will be possible to download, compile and link the 'OpenBLAS' library (<https://www.openblas.net/>) with the R language, always by the same procedure, regardless of the 'GNU/Linux' distribution used. With the 'ropenblas' package it is possible to download, compile and link the latest version of the 'OpenBLAS' library even the repositories of the 'GNU/Linux' distribution used do not include the latest versions of 'OpenBLAS'. If of interest, older versions of the 'OpenBLAS' library may be considered. Linking R with an optimized version of 'BLAS' (<https://netlib.org/blas/>) may improve the computational performance of R code. The 'OpenBLAS' library is an optimized implementation of 'BLAS' that can be easily linked to R with the 'ropenblas' package.
Authors: Pedro Rafael D. Marinho [aut, cre] (ORCID: <https://orcid.org/0000-0003-1591-8300>), Enes Ahmeti [ctb]
Maintainer: Pedro Rafael D. Marinho <[email protected]>
License: GPL-3
Version: 0.4.0
Built: 2026-05-24 09:29:34 UTC
Source: https://github.com/prdm0/ropenblas

Help Index


OpenBLAS library versions

Description

OpenBLAS library versions

Usage

last_version_openblas()

Details

This function automatically searches OpenBLAS library versions in the official GitHub project.

  1. last_version: Returns the latest stable version of the OpenBLAS library.

  2. versions: All stable versions of the OpenBLAS library.

  3. n: Total number of versions.

See Also

last_version_r, ropenblas, rcompiler

Examples

# last_version_openblas()

R language versions

Description

R language versions

Usage

last_version_r()

See Also

ropenblas, rcompiler

Examples

# last_version_r()

Compile a version of R on GNU/Linux systems

Description

This function is responsible for compiling a version of the R language.

Usage

rcompiler(x = NULL)

Arguments

x

Version of R you want to compile. By default (x = NULL) the latest stable version of the R language will be compiled. For example, x = "4.5.0" will compile and link R-4.5.0 as the major version on your system.

Details

This function is responsible for compiling a version of the R language. The x argument is the version of R that you want to compile. For example, x = "4.5.1" will compile and link the R-4.5.1 version as the major version on your system. By default (x = NULL), the latest stable version of R will be compiled.

For example, to compile the latest stable version of the R language, do:

 rcompiler()

Regardless of your GNU/Linux distribution and what version of R is in your repositories, you can have the latest stable version of the R language compiled into your computer's architecture.

You can use the rcompiler() function to compile different versions of R. For example, running rcompiler(x = "3.6.3") and rcompiler() will install versions 3.6.3 and 4.0.0 on your GNU/Linux distribution, respectively. If you are on version 4.0.0 of R and run the code rcompiler(x = "3.6.3") again, the function will identify the existence of version 3.6.3 on the system and give you the option to use the binaries that were built in a previous compilation. This avoids unnecessary compilations.

Value

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

See Also

ropenblas, last_version_r

Examples

# rcompiler()

R News file

Description

Returns the contents of the NEWS.html file in the standard browser installed on the operating system.

Usage

rnews(pdf = FALSE, dev = FALSE)

Arguments

pdf

If FALSE (default), the NEWS.html file will open in the browser, otherwise NEWS.pdf will be opened.

dev

If FALSE (default), it will not show changes made to the language development version. To see changes in the development version, do dev = TRUE.

Details

The NEWS.html file contains the main changes from the recently released versions of the R language. The goal is to facilitate the query by invoking it directly from the R command prompt. The rnews function is analogous to the news function of the utils package. However, using the news command in a terminal style bash shell, it is possible to receive a message like:

news()
starting httpd help server ... done
Error in browseURL(url) : 'browser' must be a non-empty character string

This is an error that may occur depending on the installation of R. Always prefer the use of the news function, but if you need to, use the rnews function.


Download, Compile and Link OpenBLAS Library with R

Description

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

Usage

ropenblas(x = NULL, restart_r = TRUE)

Arguments

x

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

restart_r

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

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 old versions to the single argument of ropenblas(). The ropenblas() function downloads, compiles and links R to use the OpenBLAS library. Everything is done very simply, just by loading the library and invoking the function ropenblas().

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

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, R will most likely already be linked to this library. To find out if R is using the OpenBLAS library, in R, do:

extSoftVersion()["BLAS"]

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

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

The ropenblas() function will download the desired version of the OpenBLAS library, compile and install it in the /opt directory of your operating 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 OpenBLAS library version 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 can also be found here.

Value

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

Note

You do not have to use the ropenblas() function in every R session. Once the function is used, R will always consider using the OpenBLAS library in future sessions.

Author(s)

Pedro Rafael D. Marinho (e-mail: [email protected])

See Also

rcompiler, last_version_r

Examples

# ropenblas()