janniklinde commented on code in PR #2388:
URL: https://github.com/apache/systemds/pull/2388#discussion_r2650495361


##########
docs/site/source_install.md:
##########
@@ -0,0 +1,172 @@
+# Install SystemDS from Source
+
+This guide helps in the install and setup of SystemDS from source code.
+
+---
+
+- [1. Install on Windows](#1-install-on-windows)
+- [2. Install on Ubuntu 22.04](#2-install-on-ubuntu-2204)
+- [3. Install on macOS](#3-install-on-macos)
+- [4. Build the Project](#4-build-the-project)
+- [5. Run a Component Test](#5-run-a-component-test)
+- [6. Next Steps](#6-next-steps)
+
+Once the individual versions is set up skip to the common part of building the 
system.
+
+---
+
+# 1. Install on Windows
+
+First setup java and maven to compile the system note the java version is 17, 
we suggest using Java OpenJDK 17.
+
+- <https://openjdk.org/>
+- <https://maven.apache.org/download.cgi?.>
+
+Setup your environment variables with JAVA_HOME and MAVEN_HOME. Using these 
variables add the JAVA_HOME/bin and MAVEN_HOME/bin to the path environment 
variable. An example of setting it for java can be found here: 
<https://www.thewindowsclub.com/set-java_home-in-windows-10>
+
+To run the system we also have to setup some Hadoop and spark specific 
libraries. These can be found in the SystemDS repository. To add this, simply 
take out the files, or add 'src/test/config/hadoop_bin_windows/bin' to PATH. 
Just like for JAVA_HOME set a HADOOP_HOME to the environment variable without 
the bin part, and add the `%HADOOP_HOME%\bin` to path.
+
+On windows, cloning large repositories via GitHub Desktop may stall in some 
environments. If this happens, cloning via the Git command line is a reliable 
alternative.
+Example:
+```bash
+git clone https://github.com/apache/systemds.git 
+cd systemds
+```
+
+Finally if you want to run systemds from command line, add a SYSTEMDS_ROOT 
that points to the repository root, and add the bin folder to the path.
+
+To make the build go faster set the IDE or environment variables for java: 
'-Xmx16g -Xms16g -Xmn1600m'. Here set the memory to something close to max 
memory of the device you are using.
+
+To start editing the files remember to import the code style formatting into 
the IDE, to keep the changes of the files consistent.
+
+A suggested starting point would be to run some of the component tests from 
your IDE.
+
+# 2. Install on Ubuntu 22.04
+
+First setup java and maven to compile the system note that the java version is 
17.
+
+```bash
+sudo apt install openjdk-17-jdk
+sudo apt install maven
+```
+
+Verify the install with:
+```bash
+java -version
+mvn -version
+```
+
+This should return something like:
+```bash
+openjdk 17.0.11 2024-04-16
+OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
+OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, 
sharing)
+
+Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
+Maven home: /home/usr/Programs/maven
+Java version: 17.0.11, vendor: Eclipse Adoptium, runtime: 
/home/usr/Programs/jdk-17.0.11+9
+Default locale: en_US, platform encoding: UTF-8
+OS name: "linux", version: "6.8.0-59-generic", arch: "amd64", family: "unix"
+```
+
+#### Testing
+
+R should be installed to run the test suite, since many tests are constructed 
to compare output with common R packages.
+One option to install this is to follow the guide on the following link: 
<https://linuxize.com/post/how-to-install-r-on-ubuntu-20-04/>
+
+At the time of writing the commands to install R 4.0.2 are:
+
+```bash
+sudo apt install dirmngr gnupg apt-transport-https ca-certificates 
software-properties-common
+sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 
E298A3A825C0D65DFD57CBB651716619E084DAB9
+sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu 
focal-cran40/'
+sudo apt install r-base
+```
+
+Optionally, you need to install the R dependencies for integration tests, like 
this:
+(use `sudo` mode if the script couldn't write to local R library)
+
+```bash
+Rscript ./src/test/scripts/installDependencies.R
+```

Review Comment:
   Please check that this guide works for Ubuntu 24.04 as well (you can again 
check using docker)



##########
docs/site/source_install.md:
##########
@@ -0,0 +1,172 @@
+# Install SystemDS from Source
+
+This guide helps in the install and setup of SystemDS from source code.
+
+---
+
+- [1. Install on Windows](#1-install-on-windows)
+- [2. Install on Ubuntu 22.04](#2-install-on-ubuntu-2204)
+- [3. Install on macOS](#3-install-on-macos)
+- [4. Build the Project](#4-build-the-project)
+- [5. Run a Component Test](#5-run-a-component-test)
+- [6. Next Steps](#6-next-steps)
+
+Once the individual versions is set up skip to the common part of building the 
system.
+
+---
+
+# 1. Install on Windows
+
+First setup java and maven to compile the system note the java version is 17, 
we suggest using Java OpenJDK 17.

Review Comment:
   Please be more consistent with uppercase/lowercase in general (e.g., `java` 
vs `Java`, `windows` vs `Windows`)



##########
docs/site/run_extended.md:
##########
@@ -0,0 +1,269 @@
+# Running SystemDS
+
+This guide explains how to run SystemDS regardless of whether you installed it 
from a Release or built it from Source. All execution modes -local, Spark, and 
federated- are covered in this document.
+
+---
+
+- [1. Prerequisites](#1-prerequisites)
+- [2. Set SYSTEMDS_ROOT and PATH](#2-set-systemds_root-and-path)
+- [3. Run a Simple Script Locally](#3-run-a-simple-script-locally)
+- [4. Run a Script on Spark](#4-run-a-script-on-spark)
+- [5. Run a Script in Federated Mode](#5-run-a-script-in-federated-mode)
+
+---
+
+# 1. Prerequisites
+
+This guide assumes that SystemDS has already been installed successfully.
+
+Please make sure you have followed one of the installation guides:
+- [Install SystemDS from a Release](release_install.html)
+- [Install SystemDS from Source](source_install.html)
+
+In particular, ensure that:
+- Java 17 is installed
+- Spark 3.x is available if you plan to run SystemDS on Spark
+
+---
+
+# 2. Set SYSTEMDS_ROOT and PATH
+
+This step is required for both Release and Source-build installations. Run the 
following in the root directory of your SystemDS installation:
+
+```bash
+export SYSTEMDS_ROOT=$(pwd)
+export PATH="$SYSTEMDS_ROOT/bin:$PATH"
+```
+
+It can be beneficial to persist these variables in your `~/.profile` or 
`~/.bashrc`(Linux/macOS) or as environment variables on Windows, so that 
SystemDS is available across terminal sessions. Make sure to replace the path 
below with the absolute path to your SystemDS installation.
+
+```bash
+echo 'export SYSTEMDS_ROOT=/absolute/path/to/systemds-<VERSION>' >> ~/.bashrc
+echo 'export PATH="$SYSTEMDS_ROOT/bin:$PATH"' >> ~/.bashrc
+source ~/.bashrc
+```
+---
+
+# 3. Run a Simple Script Locally
+
+This mode does not require Spark. It only needs Java 17.
+
+### 3.1 Create and Run a Hello World
+
+```bash
+echo 'print("Hello, World!")' > hello.dml
+```
+
+Run:
+
+```bash
+systemds -f hello.dml
+```
+
+Expected output:
+
+```bash
+Hello, World!
+```
+
+### (Optional) MacOS Note: `realpath: illegal option -- -` Error
+If you are running MacOS and encounter an error message similar to `realpath: 
illegal option -- -` when executing `systemds -f hello.dml`. You may try to 
replace the system-wide command `realpath` with the homebrew version 
`grealpath` that comes with the `coreutils`. Alternatively, you may change all 
occurrences within the script accordingly, i.e., by prepending a `g` to avoid 
any side effects.
+
+### (Optional) Ubuntu Note: `Invalid or corrupt jarfile hello.dml`
+On some Ubuntu setups (especially clean environments such as Docker images), 
running `systemds -f hello.dml` may result in an error like `Invalid or corrupt 
jarfile hello.dml`. If this happens, the SystemDS launcher may not 
automatically locate the correct JAR. Please refer to the Ubuntu 
troubleshooting section in the installation guide for a detailed workaround: 
[Release Installation – Ubuntu 
Note](release_install.md#optional-ubuntu-note-invalid-or-corrupt-jarfile-hellodml-error)
+
+### (Optional) Windows Note: `systemds` Command Not Found
+On Windows (e.g., PowerShell), running `systemds -f hello.dml` may fail with 
an error indicating that `systemds` is not recognized as a command. This is 
expected, since the `systemds` launcher in `bin/` is implemented as a shell 
script,
+which cannot be executed natively on Windows. In this case, SystemDS should be 
invoked directly via the runnable JAR using `java -jar`. For a detailed 
Windows-specific walkthrough, please refer to the installation guide: [Release 
Installation – Windows Notes](release_install.md#2-install-on-windows)
+
+
+### 3.2 Create a Real Example
+
+This example demonstrates local execution of a real script `Univar-stats.dml`. 
The relevant commands to run this example with SystemDS is described in the DML 
Language reference guide at [DML Language 
Reference](dml-language-reference.html).
+
+Prepare the data (macOS: use `curl`instead of `wget`):
+```bash
+# download test data
+wget -P data/ 
http://archive.ics.uci.edu/ml/machine-learning-databases/haberman/haberman.data
+
+# generate a metadata file for the dataset
+echo '{"rows": 306, "cols": 4, "format": "csv"}' > data/haberman.data.mtd
+
+# generate type description for the data
+echo '1,1,1,2' > data/types.csv
+echo '{"rows": 1, "cols": 4, "format": "csv"}' > data/types.csv.mtd
+```
+
+Execute the DML Script:
+```bash
+systemds -f scripts/algorithms/Univar-Stats.dml -nvargs \
+  X=data/haberman.data \
+  TYPES=data/types.csv \
+  STATS=data/univarOut.mtx \
+  CONSOLE_OUTPUT=TRUE
+```
+
+### (Optional) MacOS Note: `SparkException` Error
+If SystemDS tries to initialize Spark and you see `SparkException: A master 
URL must be set in your configuration`, you can force single-node execution 
without Spark/Hadoop initialization via:
+```bash
+systemds -exec singlenode -f scripts/algorithms/Univar-Stats.dml -nvargs \
+  X=data/haberman.data \
+  TYPES=data/types.csv \
+  STATS=data/univarOut.mtx \
+  CONSOLE_OUTPUT=TRUE
+```
+
+### (Optional) Ubuntu Note: `NoClassDefFoundError` Error / JAR Resolution 
Issues
+On some Ubuntu setups, executing the example may fail with a class loading 
error such as `NoClassDefFoundError: 
org/apache/commons/cli/AlreadySelectedException`. This happens when the 
SystemDS launcher script does not automatically resolve the correct executable 
JAR. In this case, explicitly pass the SystemDS JAR located in the release root 
directory:
+```bash
+SYSTEMDS_JAR=$(find "$SYSTEMDS_ROOT" -maxdepth 1 -type f -name 
"systemds-*.jar" | head -n 1)
+echo "Using SystemDS JAR: $SYSTEMDS_JAR"
+```
+Then run the example again:
+```bash
+systemds "$SYSTEMDS_JAR" -f scripts/algorithms/Univar-Stats.dml -nvargs \
+  X=data/haberman.data \
+  TYPES=data/types.csv \
+  STATS=data/univarOut.mtx \
+  CONSOLE_OUTPUT=TRUE
+```

Review Comment:
   This should be resolved by exporting `SYSTEMDS_JAR_FILE`, so just point to 
that fix



##########
docs/site/release_install.md:
##########
@@ -0,0 +1,210 @@
+
+# Install SystemDS from a Release
+
+This guide explains how to install and set up SystemDS using the pre-built 
release archives. 
+
+---
+
+- [1. Download a Release](#1-download-a-release)
+- [2. Install on Windows](#2-install-on-windows)
+- [3. Install on Ubuntu 22.04](#3-install-on-ubuntu-2204)
+- [4. Install on macOS](#4-install-on-macos)
+
+---
+
+# 1. Download a Release
+
+Download the official release archive from the Apache SystemDS website:
+
+https://systemds.apache.org/download
+
+After downloading the file `systemds-<VERSION>.tar.gz`, place the file in any 
directory you choose for installation.
+
+### Java Requirement ###
+For compatability with Spark execution and parser components, **Java 17** is 
strongly recommended for SystemDS.
+
+Verify Java 17:
+
+```bash
+java -version
+```
+
+If missing, install a JDK 17 distribution.
+
+---
+
+# 2. Install on Windows
+
+### 2.1 Extract the Release Archive
+
+Use Windows built-in extractor.
+
+### 2.2 Set Evironment Variables
+
+To run SystemDS from the command line, configure:
+- `SYSTEMDS_ROOT`-> the extracted folder
+- Add `%SYSTEMDS_ROOT%\bin` to your `PATH`
+
+Example (PowerShell):
+```bash
+setx SYSTEMDS_ROOT "C:\path\to\systemds-<VERSION>"
+setx PATH "$env:SYSTEMDS_ROOT\bin;$env:PATH"
+```
+
+Restart the terminal afterward.

Review Comment:
   This step is unnecessary as we don't use the `systemds` script anyway



##########
docs/site/run_extended.md:
##########
@@ -0,0 +1,269 @@
+# Running SystemDS
+
+This guide explains how to run SystemDS regardless of whether you installed it 
from a Release or built it from Source. All execution modes -local, Spark, and 
federated- are covered in this document.
+
+---
+
+- [1. Prerequisites](#1-prerequisites)
+- [2. Set SYSTEMDS_ROOT and PATH](#2-set-systemds_root-and-path)
+- [3. Run a Simple Script Locally](#3-run-a-simple-script-locally)
+- [4. Run a Script on Spark](#4-run-a-script-on-spark)
+- [5. Run a Script in Federated Mode](#5-run-a-script-in-federated-mode)
+
+---
+
+# 1. Prerequisites
+
+This guide assumes that SystemDS has already been installed successfully.
+
+Please make sure you have followed one of the installation guides:
+- [Install SystemDS from a Release](release_install.html)
+- [Install SystemDS from Source](source_install.html)
+
+In particular, ensure that:
+- Java 17 is installed
+- Spark 3.x is available if you plan to run SystemDS on Spark
+
+---
+
+# 2. Set SYSTEMDS_ROOT and PATH
+
+This step is required for both Release and Source-build installations. Run the 
following in the root directory of your SystemDS installation:
+
+```bash
+export SYSTEMDS_ROOT=$(pwd)
+export PATH="$SYSTEMDS_ROOT/bin:$PATH"
+```
+
+It can be beneficial to persist these variables in your `~/.profile` or 
`~/.bashrc`(Linux/macOS) or as environment variables on Windows, so that 
SystemDS is available across terminal sessions. Make sure to replace the path 
below with the absolute path to your SystemDS installation.
+
+```bash
+echo 'export SYSTEMDS_ROOT=/absolute/path/to/systemds-<VERSION>' >> ~/.bashrc
+echo 'export PATH="$SYSTEMDS_ROOT/bin:$PATH"' >> ~/.bashrc
+source ~/.bashrc
+```
+---
+
+# 3. Run a Simple Script Locally
+
+This mode does not require Spark. It only needs Java 17.
+
+### 3.1 Create and Run a Hello World
+
+```bash
+echo 'print("Hello, World!")' > hello.dml
+```
+
+Run:
+
+```bash
+systemds -f hello.dml

Review Comment:
   `-f` is not needed if set up correctly



##########
docs/site/release_install.md:
##########
@@ -0,0 +1,210 @@
+
+# Install SystemDS from a Release
+
+This guide explains how to install and set up SystemDS using the pre-built 
release archives. 
+
+---
+
+- [1. Download a Release](#1-download-a-release)
+- [2. Install on Windows](#2-install-on-windows)
+- [3. Install on Ubuntu 22.04](#3-install-on-ubuntu-2204)
+- [4. Install on macOS](#4-install-on-macos)
+
+---
+
+# 1. Download a Release
+
+Download the official release archive from the Apache SystemDS website:
+
+https://systemds.apache.org/download
+
+After downloading the file `systemds-<VERSION>.tar.gz`, place the file in any 
directory you choose for installation.
+
+### Java Requirement ###
+For compatability with Spark execution and parser components, **Java 17** is 
strongly recommended for SystemDS.
+
+Verify Java 17:
+
+```bash
+java -version
+```
+
+If missing, install a JDK 17 distribution.
+
+---
+
+# 2. Install on Windows
+
+### 2.1 Extract the Release Archive
+
+Use Windows built-in extractor.
+
+### 2.2 Set Evironment Variables
+
+To run SystemDS from the command line, configure:
+- `SYSTEMDS_ROOT`-> the extracted folder
+- Add `%SYSTEMDS_ROOT%\bin` to your `PATH`
+
+Example (PowerShell):
+```bash
+setx SYSTEMDS_ROOT "C:\path\to\systemds-<VERSION>"
+setx PATH "$env:SYSTEMDS_ROOT\bin;$env:PATH"
+```
+
+Restart the terminal afterward.
+
+### 2.3 Verify the Installation by Checking the CLI
+
+On Windows, the `systemds`CLI wrapper may not be executable. This is expected 
because the `bin/systemds`launcher is implemented as a shell script, which 
Windows cannot execute natively. To verify the installation on Windows, 
navigate to the bin directory and run the JAR directly. Note that running 
`systemds -help` without JAR may result in a CommandNotFoundExeption:
+
+```bash
+java -jar systemds-3.3.0.jar -help
+```
+
+You should see usage information as an output printed to the console.
+
+### 2.4 Create a Simple Script
+
+On Windows, especially when using PowerShell, creating text files via shell 
redirection (e.g., echo...) may result in unexpected encoding or invisible 
characters. This can lead to parsing errors when executing the script, even 
though the file appears correct in an editor. Therefore, you may try creating 
the file explicitly using PowerShell:
+```bash
+Set-Content -Path .\hello.dml -Value 'print("Hello World!")' -Encoding Ascii
+```
+
+This ensures the script is stored as plain text without additional encoding 
metadata.
+Note: This behavior depends on the shell and environment configuration and may 
not affect all Windows setups.
+
+Verify the file contents:
+```bash
+Get-Content .\hello.dml
+```
+
+Expected output:
+```bash
+print("Hello World!")
+```
+
+### 2.5 Run the Script
+
+Now run the script:
+```bash
+java -jar systemds-3.3.0.jar -f .\hello.dml
+```
+
+Expected output:
+```bash
+Hello World!
+SystemDS Statistics:
+Total execution time: 0.012 sec.
+```
+
+# 3. Install on Ubuntu 22.04
+
+### 3.1 Extract the Release
+
+```bash
+cd /path/to/install
+tar -xvf systemds-<VERSION>-bin.tgz
+cd systemds-<VERSION>-bin
+```
+
+### 3.2 Add SystemDS to PATH
+
+```bash
+export SYSTEMDS_ROOT=$(pwd)
+export PATH="$SYSTEMDS_ROOT/bin:$PATH"
+```
+
+(Optional but recommended) To make SystemDS available in new terminals, add 
the following lines to your shell configuration (e.g., ~/.bashrc or ~/.profile):
+```bash
+export SYSTEMDS_ROOT=/absolute/path/to/systemds-<VERSION>
+export PATH=$SYSTEMDS_ROOT/bin:$PATH
+```
+
+### 3.3 Verify the Installation by Checking the CLI
+
+```bash
+systemds -help
+```
+
+You should see usage information printed to the console.
+
+### 3.4 Create a Simple Script
+
+```bash
+echo 'print("Hello World!")' > hello.dml
+```
+
+### 3.5 Run the Script
+
+On some Ubuntu setups (including clean Docker images), running SystemDS 
directly may fail with `Invalid or corrupt jarfile hello.dml` Error. In this 
case, explicitly pass the SystemDS JAR shipped with the release.
+
+Locate the JAR in the release root:
+```bash
+SYSTEMDS_JAR=$(find "$SYSTEMDS_ROOT" -maxdepth 1 -type f -name 
"systemds-*.jar" | head -n 1)
+echo "Using SystemDS JAR: $SYSTEMDS_JAR"
+```
+
+Then run:
+```bash
+systemds "$SYSTEMDS_JAR" -f hello.dml
+```

Review Comment:
   The core issue is that the script requires an exported `SYSTEMDS_JAR_FILE`. 
Then it should work with `systemds hello.dml`. Please fix this in 3.2



##########
docs/site/run_extended.md:
##########
@@ -0,0 +1,269 @@
+# Running SystemDS
+
+This guide explains how to run SystemDS regardless of whether you installed it 
from a Release or built it from Source. All execution modes -local, Spark, and 
federated- are covered in this document.
+
+---
+
+- [1. Prerequisites](#1-prerequisites)
+- [2. Set SYSTEMDS_ROOT and PATH](#2-set-systemds_root-and-path)
+- [3. Run a Simple Script Locally](#3-run-a-simple-script-locally)
+- [4. Run a Script on Spark](#4-run-a-script-on-spark)
+- [5. Run a Script in Federated Mode](#5-run-a-script-in-federated-mode)
+
+---
+
+# 1. Prerequisites
+
+This guide assumes that SystemDS has already been installed successfully.
+
+Please make sure you have followed one of the installation guides:
+- [Install SystemDS from a Release](release_install.html)
+- [Install SystemDS from Source](source_install.html)
+
+In particular, ensure that:
+- Java 17 is installed
+- Spark 3.x is available if you plan to run SystemDS on Spark
+
+---
+
+# 2. Set SYSTEMDS_ROOT and PATH
+
+This step is required for both Release and Source-build installations. Run the 
following in the root directory of your SystemDS installation:
+
+```bash
+export SYSTEMDS_ROOT=$(pwd)
+export PATH="$SYSTEMDS_ROOT/bin:$PATH"
+```
+
+It can be beneficial to persist these variables in your `~/.profile` or 
`~/.bashrc`(Linux/macOS) or as environment variables on Windows, so that 
SystemDS is available across terminal sessions. Make sure to replace the path 
below with the absolute path to your SystemDS installation.
+
+```bash
+echo 'export SYSTEMDS_ROOT=/absolute/path/to/systemds-<VERSION>' >> ~/.bashrc
+echo 'export PATH="$SYSTEMDS_ROOT/bin:$PATH"' >> ~/.bashrc
+source ~/.bashrc
+```
+---

Review Comment:
   Redundant; Just add one sentence or bullet point to prerequisites to make 
sure environment variables have been set according to the corresponding install 
guides



##########
docs/site/source_install.md:
##########
@@ -0,0 +1,172 @@
+# Install SystemDS from Source
+
+This guide helps in the install and setup of SystemDS from source code.
+
+---
+
+- [1. Install on Windows](#1-install-on-windows)
+- [2. Install on Ubuntu 22.04](#2-install-on-ubuntu-2204)
+- [3. Install on macOS](#3-install-on-macos)
+- [4. Build the Project](#4-build-the-project)
+- [5. Run a Component Test](#5-run-a-component-test)
+- [6. Next Steps](#6-next-steps)
+
+Once the individual versions is set up skip to the common part of building the 
system.
+
+---
+
+# 1. Install on Windows
+
+First setup java and maven to compile the system note the java version is 17, 
we suggest using Java OpenJDK 17.
+
+- <https://openjdk.org/>
+- <https://maven.apache.org/download.cgi?.>
+
+Setup your environment variables with JAVA_HOME and MAVEN_HOME. Using these 
variables add the JAVA_HOME/bin and MAVEN_HOME/bin to the path environment 
variable. An example of setting it for java can be found here: 
<https://www.thewindowsclub.com/set-java_home-in-windows-10>
+
+To run the system we also have to setup some Hadoop and spark specific 
libraries. These can be found in the SystemDS repository. To add this, simply 
take out the files, or add 'src/test/config/hadoop_bin_windows/bin' to PATH. 
Just like for JAVA_HOME set a HADOOP_HOME to the environment variable without 
the bin part, and add the `%HADOOP_HOME%\bin` to path.
+
+On windows, cloning large repositories via GitHub Desktop may stall in some 
environments. If this happens, cloning via the Git command line is a reliable 
alternative.
+Example:
+```bash
+git clone https://github.com/apache/systemds.git 
+cd systemds
+```
+
+Finally if you want to run systemds from command line, add a SYSTEMDS_ROOT 
that points to the repository root, and add the bin folder to the path.

Review Comment:
   That would not work anyway so leave this out



##########
docs/site/run_extended.md:
##########
@@ -0,0 +1,269 @@
+# Running SystemDS
+
+This guide explains how to run SystemDS regardless of whether you installed it 
from a Release or built it from Source. All execution modes -local, Spark, and 
federated- are covered in this document.
+
+---
+
+- [1. Prerequisites](#1-prerequisites)
+- [2. Set SYSTEMDS_ROOT and PATH](#2-set-systemds_root-and-path)
+- [3. Run a Simple Script Locally](#3-run-a-simple-script-locally)
+- [4. Run a Script on Spark](#4-run-a-script-on-spark)
+- [5. Run a Script in Federated Mode](#5-run-a-script-in-federated-mode)
+
+---
+
+# 1. Prerequisites
+
+This guide assumes that SystemDS has already been installed successfully.
+
+Please make sure you have followed one of the installation guides:
+- [Install SystemDS from a Release](release_install.html)
+- [Install SystemDS from Source](source_install.html)
+
+In particular, ensure that:
+- Java 17 is installed
+- Spark 3.x is available if you plan to run SystemDS on Spark
+
+---
+
+# 2. Set SYSTEMDS_ROOT and PATH
+
+This step is required for both Release and Source-build installations. Run the 
following in the root directory of your SystemDS installation:
+
+```bash
+export SYSTEMDS_ROOT=$(pwd)
+export PATH="$SYSTEMDS_ROOT/bin:$PATH"
+```
+
+It can be beneficial to persist these variables in your `~/.profile` or 
`~/.bashrc`(Linux/macOS) or as environment variables on Windows, so that 
SystemDS is available across terminal sessions. Make sure to replace the path 
below with the absolute path to your SystemDS installation.
+
+```bash
+echo 'export SYSTEMDS_ROOT=/absolute/path/to/systemds-<VERSION>' >> ~/.bashrc
+echo 'export PATH="$SYSTEMDS_ROOT/bin:$PATH"' >> ~/.bashrc
+source ~/.bashrc
+```
+---
+
+# 3. Run a Simple Script Locally
+
+This mode does not require Spark. It only needs Java 17.
+
+### 3.1 Create and Run a Hello World
+
+```bash
+echo 'print("Hello, World!")' > hello.dml
+```
+
+Run:
+
+```bash
+systemds -f hello.dml
+```
+
+Expected output:
+
+```bash
+Hello, World!
+```
+
+### (Optional) MacOS Note: `realpath: illegal option -- -` Error
+If you are running MacOS and encounter an error message similar to `realpath: 
illegal option -- -` when executing `systemds -f hello.dml`. You may try to 
replace the system-wide command `realpath` with the homebrew version 
`grealpath` that comes with the `coreutils`. Alternatively, you may change all 
occurrences within the script accordingly, i.e., by prepending a `g` to avoid 
any side effects.
+
+### (Optional) Ubuntu Note: `Invalid or corrupt jarfile hello.dml`
+On some Ubuntu setups (especially clean environments such as Docker images), 
running `systemds -f hello.dml` may result in an error like `Invalid or corrupt 
jarfile hello.dml`. If this happens, the SystemDS launcher may not 
automatically locate the correct JAR. Please refer to the Ubuntu 
troubleshooting section in the installation guide for a detailed workaround: 
[Release Installation – Ubuntu 
Note](release_install.md#optional-ubuntu-note-invalid-or-corrupt-jarfile-hellodml-error)
+
+### (Optional) Windows Note: `systemds` Command Not Found
+On Windows (e.g., PowerShell), running `systemds -f hello.dml` may fail with 
an error indicating that `systemds` is not recognized as a command. This is 
expected, since the `systemds` launcher in `bin/` is implemented as a shell 
script,
+which cannot be executed natively on Windows. In this case, SystemDS should be 
invoked directly via the runnable JAR using `java -jar`. For a detailed 
Windows-specific walkthrough, please refer to the installation guide: [Release 
Installation – Windows Notes](release_install.md#2-install-on-windows)
+
+
+### 3.2 Create a Real Example
+
+This example demonstrates local execution of a real script `Univar-stats.dml`. 
The relevant commands to run this example with SystemDS is described in the DML 
Language reference guide at [DML Language 
Reference](dml-language-reference.html).
+
+Prepare the data (macOS: use `curl`instead of `wget`):
+```bash
+# download test data
+wget -P data/ 
http://archive.ics.uci.edu/ml/machine-learning-databases/haberman/haberman.data
+
+# generate a metadata file for the dataset
+echo '{"rows": 306, "cols": 4, "format": "csv"}' > data/haberman.data.mtd
+
+# generate type description for the data
+echo '1,1,1,2' > data/types.csv
+echo '{"rows": 1, "cols": 4, "format": "csv"}' > data/types.csv.mtd
+```
+
+Execute the DML Script:
+```bash
+systemds -f scripts/algorithms/Univar-Stats.dml -nvargs \
+  X=data/haberman.data \
+  TYPES=data/types.csv \
+  STATS=data/univarOut.mtx \
+  CONSOLE_OUTPUT=TRUE
+```

Review Comment:
   Maybe add `<path-to-systemds>/scripts/algorithms/...` to make it work 
outside of that dir. Also `-f` can be removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to