Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

an opinionated environment for compiling R

License

NotificationsYou must be signed in to change notification settings

rstudio/r-builds

Repository files navigation

This repository orchestrates tools to produce R binaries. The binaries are available as acommunity resource,they are not professionally supported by Posit.The R language is open source, please see the official documentation athttps://www.r-project.org/.

These binaries are not a replacement to existing binary distributions for R.The binaries were built with the following considerations:

These binaries have been extensively tested, and are used in production everydayonPosit Cloud andshinyapps.io. Please open an issue to report a specificbug, or ask questions onPosit Community.

Supported Platforms

R binaries are built for the following Linux operating systems:

  • Ubuntu 20.04, 22.04, 24.04
  • Debian 12, 13
  • CentOS 7
  • Red Hat Enterprise Linux 7, 8, 9, 10
  • openSUSE 15.6
  • SUSE Linux Enterprise 15 SP6
  • Fedora 41, 42

Operating systems are supported until their vendor end-of-support dates, whichcan be found on thePosit Platform Supportpage. When an operating system has reached its end of support, builds for itwill be discontinued, but existing binaries will continue to be available.

Supported R Versions

R binaries are primarily supported for the current R version and previous four minor versions of R.Older R versions down to R 3.0.0 are also built when possible, but support for older R versions is best effort and not guaranteed.

R versions 4.0.0 through 4.3.3 have been patched forCVE-2024-27322. See#218 for more details.

Supported Architectures

R binaries are built for x86_64/amd64 and aarch64/arm64.

Quick Installation

To use our quick install script to install R, simply run the followingcommand. To use the quick installer, you must have root or sudo privileges,andcurl must be installed.

bash -c"$(curl -L https://rstd.io/r-install)"

Manual Installation

Specify R version

Define the version of R that you want to install. Available versionsof R can be found here:https://cdn.posit.co/r/versions.json

R_VERSION=4.4.3

Download and install R

Ubuntu/Debian Linux

Download the deb package:

# Ubuntu 20.04curl -O https://cdn.posit.co/r/ubuntu-2004/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb# Ubuntu 22.04curl -O https://cdn.posit.co/r/ubuntu-2204/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb# Ubuntu 24.04curl -O https://cdn.posit.co/r/ubuntu-2404/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb# Debian 12curl -O https://cdn.posit.co/r/debian-12/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb# Debian 13curl -O https://cdn.posit.co/r/debian-13/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb

Then install the package:

sudo apt-get install ./r-${R_VERSION}_1_$(dpkg --print-architecture).deb

RHEL/CentOS Linux

Enable theExtra Packages for Enterprise Linuxrepository (RHEL/CentOS 7 and RHEL 9 only):

# CentOS / RHEL 7sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm# Rocky Linux 9 / AlmaLinux 9sudo dnf install dnf-plugins-coresudo dnf config-manager --set-enabled crbsudo dnf install epel-release# RHEL 9sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

On RHEL 7, you may also need to enable the Optional repository:

sudo subscription-manager repos --enable"rhel-*-optional-rpms"# If running RHEL 7 in a public cloud, such as Amazon EC2, enable the# Optional repository from Red Hat Update Infrastructure (RHUI) insteadsudo yum install yum-utilssudo yum-config-manager --enable"rhel-*-optional-rpms"

On RHEL 9, you may also need to enable the CodeReady Linux Builder repository:

sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms# If running RHEL 9 in a public cloud, such as Amazon EC2, enable the CodeReady# Linux Builder repository from Red Hat Update Infrastructure (RHUI) insteadsudo dnf install dnf-plugins-coresudo dnf config-manager --enable codeready-builder-for-rhel-9-*-rpms

Download the rpm package:

# CentOS / RHEL 7curl -O https://cdn.posit.co/r/centos-7/pkgs/R-${R_VERSION}-1-1.$(arch).rpm# RHEL 8 / Rocky Linux 8 / AlmaLinux 8curl -O https://cdn.posit.co/r/centos-8/pkgs/R-${R_VERSION}-1-1.$(arch).rpm# RHEL 9 / Rocky Linux 9 / AlmaLinux 9curl -O https://cdn.posit.co/r/rhel-9/pkgs/R-${R_VERSION}-1-1.$(arch).rpm# RHEL 10 / Rocky Linux 10 / AlmaLinux 10curl -O https://cdn.posit.co/r/rhel-10/pkgs/R-${R_VERSION}-1-1.$(arch).rpm

Then install the package:

sudo yum install R-${R_VERSION}-1-1.$(arch).rpm

SUSE Linux

Download the rpm package:

# openSUSE 15.6 / SLES 15 SP6curl -O https://cdn.posit.co/r/opensuse-156/pkgs/R-${R_VERSION}-1-1.$(arch).rpm

Then install the package:

sudo zypper --no-gpg-checks install R-${R_VERSION}-1-1.$(arch).rpm

Fedora Linux

Download the rpm package:

# Fedora 41curl -O https://cdn.posit.co/r/fedora-41/pkgs/R-${R_VERSION}-1-1.$(arch).rpm# Fedora 42curl -O https://cdn.posit.co/r/fedora-42/pkgs/R-${R_VERSION}-1-1.$(arch).rpm

Then install the package:

sudo dnf install R-${R_VERSION}-1-1.$(arch).rpm

Verify R installation

Test that R was successfully installed by running:

/opt/R/${R_VERSION}/bin/R --version

Add R to the system path

To ensure that R is available on the system path, create symbolic links tothe version of R that you installed:

sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript

Optional post-installation steps

You may want to install additional system dependencies for R packages.We recommend installing a TeX distribution (such asTinyTeXor TeX Live) and Pandoc. For more information on system dependencies, seesystem requirements for R packages.

If you want to install multiple versions of R on the same system, you canrepeat these steps to install a different version of R alongside existing versions.


Developer Documentation

This repository orchestrates builds using a variety of tools. Theinstructions below outline the components in the stack and describe how to add anew platform or inspect an existing platform.

Building from source

To build the R binaries from source, you will need to haveGit,Docker, andmake installed.

First, clone the Git repository locally and navigate to it.

git clone https://github.com/rstudio/R-buildscd R-builds

Then, run thebuild-r-$PLATFORM Make target with theR_VERSION environment variableset to your desired R version, where$PLATFORM is one of the supported platformidentifiers, such asubuntu-2204 orrhel-9.

export PLATFORM=ubuntu-2204export R_VERSION=4.5.0make build-r-$PLATFORM

The built DEB or RPM package will be available in thebuilder/integration/tmp/$PLATFORMdirectory.

$ ls builder/integration/tmp/$PLATFORMr-4.5.0_1_amd64.deb

Custom installation path

R is installed to/opt/R/${R_VERSION} by default. If you want to customize theinstallation path, set the optionalR_INSTALL_PATH environment variable to acustom location such as/opt/custom/R-4.5.0.

export PLATFORM=rhel-9export R_VERSION=4.5.0export R_INSTALL_PATH=/opt/custom/R-4.5.0make build-r-$PLATFORM

Submitting pull requests

For significant changes to the R builds, such as adding a new platform or updating existing builds,include any relevant testing notes and changes that may affect existing users, such as system dependency changes.

On successful merge, a project maintainer can then trigger the builds in staging to test the changes, and then in productionwhen the changes have been verified.

Adding a new platform.

R configuration

  • Builds should use OpenBLAS and align their BLAS/LAPACK configuration with the default distribution of R when possible,for maximum compatibility of binary R packages across R distributions. For example, Ubuntu/Debian should be configuredto use external BLAS, RHEL 9+ should use FlexiBLAS (to match EPEL), and SUSE should use shared BLAS. The BLAS/LAPACKlibrary should be swappable at runtime when possible.
  • DEB/RPM packages should include the minimum set of dependencies when possible. Different R versions may have differentdependencies, so packaging scripts may conditionally add dependencies based on the R version.

README

  1. Add the new platform to theSupported Platforms list.
  2. Add DEB or RPM package download instructions for the new platform.

Dockerfile

Create abuilder/Dockerfile.platform-version (whereplatform-version isubuntu-2204 orcentos-7, etc.) This file must contain four major tasks:

  1. anOS_IDENTIFIER env with theplatform-version.
  2. a step which ensures the R source build dependencies are installed
  3. COPY for the packaging script (builder/package.platform-version) to/package.sh
  4. COPY andENTRYPOINT for thebuild.sh file inbuilder/.

Packaging script

Create abuilder/package.platform-version script (whereplatform-version isubuntu-2204 orcentos-7, etc.).

docker-compose.yml

A new service in the docker-compose file named according to theplatform-version and containing the proper entries:

ubuntu-2404:command:./build.shenvironment:    -R_VERSION=${R_VERSION}# for testing out R builds locally    -R_INSTALL_PATH=${R_INSTALL_PATH}# custom installation path    -LOCAL_STORE=/tmp/output# ensures that output tarballs are persisted locallybuild:context:.dockerfile:Dockerfile.ubuntu-2404image:r-builds:ubuntu-2404volumes:    -./integration/tmp:/tmp/output# path to output tarballsplatform:${PLATFORM_ARCH}# for testing other architectures via emulation

Makefile

Add the new platform to thePLATFORMS variable near the top of the Makefile.

test/docker-compose.yml

A new service in thetest/docker-compose.yml file named according to theplatform-version and containing the proper entries:

ubuntu-2204:image:ubuntu:jammycommand:/r-builds/test/test-apt.shenvironment:      -OS_IDENTIFIER=ubuntu-2204      -R_VERSION=${R_VERSION}volumes:      -../:/r-buildsplatform:${PLATFORM_ARCH}

Quick install script

Update the quick install script atinstall.sh, if necessary, to support the new platform.

Once you've followed the steps above, submit a pull request.

R builds tarballs

In addition to the DEB and RPM packages, R builds also publishes tarballs of the binaries at:

  • x86_64:https://cdn.posit.co/r/${OS_IDENTIFIER}/R-${R_VERSION}-${OS_IDENTIFIER}.tar.gz
  • arm64:https://cdn.posit.co/r/${OS_IDENTIFIER}/R-${R_VERSION}-${OS_IDENTIFIER}-arm64.tar.gz

These may be used with a manual installation of R's system dependencies. System dependencies will differ between R versions,so inspect the corresponding DEB or RPM package for the list of system dependencies.

"Break Glass" and scheduled builds

TheCheck for new R versions workflowchecks for new R versions hourly and automatically builds and publishes them.

TheDaily R-devel and R-next builds workflowbuilds and publishes R-devel and R-next each day.

TheR builds workflowtests building the R binaries and optionally publishes them. Builds are not automatically published upon merging tomain.

After making any changes to R-builds, this workflow may be run manually to test the changes instaging first. Then,the workflow can be rerun forproduction to build new binaries or rebuild existing binaries.

Testing

Tests are automatically run on each push.These tests validate that R was correctly configured, built, and packaged. By default, the tests runfor the last 5 minor R versions on each platform.

To run the tests manually, you can navigate to theGitHub Actions workflow pageand use "Run workflow" to run the tests from a custom branch, list of platforms, and list of R versions.

To skip the tests, add[skip ci] to your commit message. SeeSkipping workflow runsfor more information.

To test the R builds locally, you can use thebuild-r-$PLATFORM andtest-r-$PLATFORMtargets to build R and run the tests. The tests use the quick install script to install R,using a locally built R if present, or otherwise a build from the CDN.

# Build R 4.5.0 for Ubuntu 22R_VERSION=4.5.0 make build-r-ubuntu-2204# Test R 4.5.0 for Ubuntu 22R_VERSION=4.5.0 make test-r-ubuntu-2204

Alternatively, you can build an image using thedocker-build-$PLATFORMtarget, launch a bash session within a container using thebash-$PLATFORM target,and interactively run the build script:

# Build the image for Ubuntu 22make docker-build-ubuntu-2204# Launch a bash session for Ubuntu 22make bash-ubuntu-2204# Build R 4.5.0R_VERSION=4.5.0 ./build.sh# Build R devel with parallel execution to speed up the buildMAKEFLAGS=-j4 R_VERSION=devel ./build.sh# Build a prerelease version of R (e.g., alpha or beta)R_VERSION=rc R_TARBALL_URL=https://cran.r-project.org/src/base-prerelease/R-latest.tar.gz ./build.sh

Builds default to the current host architecture by default. If you would like to test a differentarchitecture via emulation in Docker, setPLATFORM_ARCH to a valid Docker--platform flag:

# Build R 4.5.0 for Ubuntu 22, ARM64R_VERSION=4.5.0 PLATFORM_ARCH=linux/arm64 make build-r-ubuntu-2204# Test R 4.5.0 for Ubuntu 22, ARM64R_VERSION=4.5.0 PLATFORM_ARCH=linux/arm64 make test-r-ubuntu-2204

About

an opinionated environment for compiling R

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors22


[8]ページ先頭

©2009-2025 Movatter.jp