Install the R client

This guide walks you through the process of installing the Deephaven Core+ R client. See the following links for information on using the client:

The installation process follows a few basic steps:

Supported OS

The Core+ R client is dependent on the Core+ C++ client, which is supported on the following operating systems:

  • Ubuntu 22.04
  • RHEL 9

Prerequisites

Before you install the R client, you must first Install the C++ client. Client installation requires docker and docker buildx. The R client has some additional dependencies, which are dependent on the OS.

Ubuntu 22.04

To install the required dependencies on Ubuntu 22.04, run:

sudo apt -y update
sudo apt -y install curl git g++ cmake make build-essential zlib1g-dev libbz2-dev libssl-dev pkg-config

RHEL 9

To install the required dependencies on RHEL 9, run:

sudo dnf -q -y update
sudo dnf -q -y groupinstall 'Development Tools'
sudo dnf -q -y install curl cmake gcc-c++ openssl-devel libcurl-devel

Note

If building for the RHEL ubi Docker image, replace dnf with microdnf in the above commands.

Obtain the Core+ R client sources

The R client is distributed as a source code bundle. This bundle includes a Dockerized build script that can be used in any Linux machine with Docker and Docker's buildx package installed (buildx is the Docker CLI plugin for extended build capabilities with BuildKit). The script produces a binary package for supported platforms.

Untar the client sources in a directory of your choosing. Once the sources are untarred, move the coreplus folder to DhcInDhe:

tar -xvf <source-bundle>.tgz
mv coreplus DhcInDhe

Install R

The Deephaven Core+ R client requires r-base-dev, as we will be installing R packages using install.packages(). It's recommended to install the latest version of R.

Instructions for installing R can be found below:

Install R dependencies

Once R is installed, you need to install the following prerequisite R packages. First, set the MAKEFLAGS environment variable:

export MAKEFLAGS=`getconf _NPROCESSORS_ONLN`

Then, start R and install the required packages:

install.packages(c("Rcpp", "R6", "arrow", "dplyr"))

Install the R client

The R client is built via a Dockerized build script. The build script takes a few different arguments:

  • --prefix: The location to where the client will be installed.
  • --base-distro: The base Linux distribution to use. See supported OS for the supported distributions.
  • --clear-images: Whether to clear the Docker images produced by the build script. This is not required, but it does free up disk space.

Here are some examples showing the Dockerized installation with different parameters:

# Build for Ubuntu 22.04
PREFIX=/opt/deephaven
DISTRO=ubuntu:22.04
./docker-build.sh --prefix $PREFIX --base-distro $DISTRO
# Build for RHEL 9
PREFIX=/usr/local/deephaven
DISTRO=registry.access.redhat.com/ubi9/ubi-minimal:9.6
./docker-build.sh --prefix $PREFIX --base-distro $DISTRO

The R client is dependent on the C++ client. If the C++ client is not yet installed on the machine, the Dockerized build script first installs it before installing the R client.

The build script creates tar bundles in the build/ directory. For example, if you build against Ubuntu 22.04:

build/dhe-r-rdeephaven-latest-ubuntu-22.04.tgz
build/dhe-r-rdnd-latest-ubuntu-22.04.tgz

Note

The --prefix location specified cannot be changed once selected: installing the build tar bundle to a different location results in undefined behavior.

Install R client in R

To install the Core+ R client packages, start R from the directory where docker-build.sh was run. Then, run the following for each of the two build bundles:

install.packages("build/<build-bundle>.tgz", repos=NULL)