-
Notifications
You must be signed in to change notification settings - Fork 56
Building R
Below versions of R are available in respective distributions at the time of creation of these build instructions:
- Ubuntu 20.04 has
3.6.3 - Ubuntu 22.04, has
4.1.2 - Ubuntu 22.10 has
4.2.1 - Ubuntu 23.04 has
4.2.2 - SLES 12 SP5 has
3.2.5 - SLES 15 SP4 has
4.1.2 - RHEL (8.6, 8.7, 9.0, 9.1) have
4.3.0
The instructions provided below specify the steps to build R version 4.3.0 on Linux on IBM Z for following distributions:
- RHEL (7.8, 7.9)
- SLES (12 SP5, 15 SP4)
- Ubuntu (20.04, 22.04, 22.10, 23.04)
General Notes:
- When following the steps low please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you want to build R manually, go to step 2.
Use the following commands to build R using the build script. Please make sure you have wget installed.
wget https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/R/4.3.0/build_r.sh
# Build R
bash build_r.sh [Provide -j (Temurin11|Semeru11|OpenJDK) -t option for executing build along with tests with specific java ]
If the build completes successfully, go to step 3.2. In case of error, check logs for more details or go to step 2 to follow manual build steps.
-
RHEL (7.8, 7.9)
sudo yum install -y gcc wget tar make rpm-build zlib-devel xz-devel ncurses-devel cairo-devel gcc-c++ libcurl-devel libjpeg-devel libpng-devel libtiff-devel readline-devel texlive-helvetic texlive-metafont texlive-psnfss texlive-times xdg-utils pango-devel tcl-devel tk-devel perl-macros info gcc-gfortran libXt-devel perl-Text-Unidecode.noarch bzip2-devel pcre-devel help2man procps which glibc-common -
SLES (12 SP5, 15 SP4)
sudo zypper install -y curl libnghttp2-devel wget tar rpm-build help2man zlib-devel xz-devel libyui-ncurses-devel make cairo-devel gcc-c++ gcc-fortran libcurl-devel libjpeg-devel libpng-devel libtiff-devel readline-devel fdupes texlive-helvetic texlive-metafont texlive-psnfss texlive-times xdg-utils pango-devel tcl tk xorg-x11-devel perl-macros texinfo texlive-ae texlive-fancyvrb -
Ubuntu (20.04, 22.04, 22.10, 23.04)
sudo apt-get update sudo apt-get install -y wget tar gcc g++ ratfor gfortran libx11-dev make r-base libcurl4-openssl-dev locales
-
With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9).
- Download and install IBM Semeru Runtime (Java 11 or Java 17) from here.
-
With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)
- Download and install Eclipse Adoptium Temurin Runtime (Java 11 or Java 17) from here.
-
With OpenJDK 11
- RHEL (7.8, 7.9)
sudo yum install -y java-11-openjdk
- SLES (12 SP5, 15 SP4)
sudo zypper install -y java-11-openjdk
- Ubuntu (20.04, 22.04, 22.10, 23.04)
sudo apt-get install -y openjdk-11-jdk openjdk-11-jdk-headless
- RHEL (7.8, 7.9)
-
With OpenJDK 17
- SLES 15 SP4
sudo zypper install -y java-17-openjdk
- Ubuntu (20.04, 22.04, 22.10, 23.04)
sudo apt-get install -y openjdk-17-jdk
- SLES 15 SP4
Note: At the time of creation of these build instructions R was verified with Semeru and Temurin runtime version Java 11 (11.0.18+10) and Java 17 (17.0.6+10)
export JAVA_HOME=<path to java>
export PATH=$JAVA_HOME/bin:$PATH
Note: Make sure /usr/local/bin and /sbin are available in PATH environment variable.
export SOURCE_ROOT=/<source_root>
cd $SOURCE_ROOT
wget https://cran.r-project.org/src/base/R-4/R-4.3.0.tar.gz
tar zxvf R-4.3.0.tar.gz
cd $SOURCE_ROOT
mkdir build && cd build
../R-4.3.0/configure --with-x=no --with-pcre1
make
sudo make install
-
For RHEL (7.8, 7.9)
cd $SOURCE_ROOT/build yum install -y texlive.s390x export LANG="en_US.UTF-8" make check -
For SLES (12 SP5, 15 SP4)
cd $SOURCE_ROOT/build sudo zypper install -y texlive-courier texlive-dvips export LANG="en_US.UTF-8" make check -
For Ubuntu (20.04, 22.04, 22.10, 23.04)
cd $SOURCE_ROOT/build sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra sudo locale-gen "en_US.UTF-8" sudo locale-gen "en_GB.UTF-8" export LANG="en_US.UTF-8" make check
echo "sessionInfo()" | R --save
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.