Apache SystemDS Setup Guide

In this short post, we walk through the installation and setup of Apache SystemDS from source with its dependencies. The contained steps have been performed on Ubuntu 26.04 and on Ubuntu 24.04. These steps are expected to work similarly for other versions of Ubuntu.

Note: The content of this post is mostly copied from ]GitHub](apache.github.io/systemds).

Install Git, Java, Maven

sudo apt-get update
sudo apt-get install openjdk-17-jdk
sudo apt-get install maven
sudo apt-get install git

Verify installation and versions

java --version
mvn --version
git --version

Optional: Install and configure update-java-alternatives

sudo apt-get install java-common
# list available java versions
update-java-alternatives --list
sudo update-java-alternatives --set java-1.17.0-openjdk-amd64

Set the JAVA_HOME environment variable system-wide. Adopted from the blog post on javathinking.com.

Create /etc/profile.d/java.sh and edit:

sudo nano /etc/profile.d/java.sh

Paste the following line into the file, then save and exit.

export JAVA_HOME=$(dirname $(dirname `readlink -f /usr/bin/java`))

Note that the path /usr/bin/java is copied from the output of whereis java. This could vary depending on your java installation.

Verify that the JAVA_HOME environment variable is set correctly by rebooting (or source /etc/profile.d/java.sh) and

echo $JAVA_HOME

Get SystemDS (and R)

Clone the SystemDS repository (or clone your fork by replacing ‘apache’ with your GitHub username)

git clone git@github.com:apache/systemds.git
cd ./systemds

Optional: For testing, we also need to install R.

Installation guide from r-project.org:

# update indices
sudo apt update -qq
# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc 
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the repo from CRAN -- lsb_release adjusts to 'noble' or 'jammy' or ... as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
# install R itself
sudo apt install --no-install-recommends r-base

Verify the installation:

R --version

Optional: Install R dependencies for SystemDS integration tests.

Open R shell:

R

Source the dependency file in R. If it prompts a warning that the default library is not writable, type ‘yes’ (twice) to use a personal library instead.

source("./src/test/scripts/installDependencies.R");

Build SystemDS

Compile SystemDS

mvn package -P distribution

Optional: Add SystemDS CLI to PATH.

Edit the ~/.profile file (or ~/.bashrc if preferred):

nano ~/.profile

Add the following lines:

export SYSTEMDS_ROOT=<path_to_systemds_directory>
export PATH="$SYSTEMDS_ROOT/bin:$PATH"

Please replace <path_to_systemds_directory> with the respective path to your SystemDS root directory. Then, reload by executing source ~/.profile and verify systemds -help.

Well done!




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Zsh and Oh-My-Zsh Installation Guide
  • Create GitHub Pull Request
  • Gradient Evolution
  • Python Virtual Environment
  • Tensorflow Tutorial: Load Custom Image Dataset