Installing Rhobots

Step-by-step installation guide for macOS (Apple Silicon and Intel) and Windows.
Author

Janpieter van der Pol

Select your operating system below to see the exact steps for your machine.

Step 1 of 2

What operating system are you using?

Rhobots runs on macOS and Windows. Your installation steps depend on your system.

Step 2 of 2

What type of Mac do you have?

The steps are nearly identical, but Apple Silicon Macs can use GPU acceleration for faster embedding.

How to check: Click the Apple () menu in the top-left → About This Mac.
Look for Chip: Apple M… (Apple Silicon) or Processor: Intel… (Intel).

macOS — Apple Silicon

Installation guide for M1, M2, M3 and M4 Macs

~25 minutes ~3 GB free space
1
Install Xcode Command Line Tools

R needs a C++ compiler to install packages with native code. Xcode Command Line Tools provides this — it is a small separate package (~2 GB), not the full Xcode IDE.

Open Terminal (Cmd+Space → type "Terminal") and run:

Terminal
xcode-select --install
A dialog will appear — click Install and wait (5–15 minutes). If you see "already installed", skip to step 2.
2
Install R for Apple Silicon

Download the arm64 build of R from CRAN — this version is optimised for M-series chips.

Download R for macOS (CRAN)
On the CRAN page, download the file ending in -arm64.pkg. Run the installer and follow the prompts.
3
Install required R packages

Open R (or RStudio) and run both lines:

R
install.packages(c("remotes", "gutenbergr"))
remotes::install_github("JPvdP/RhoBots")
The second command compiles C++ code. Compiler output will scroll by — this is normal and takes 1–3 minutes.
4
Set up the torch backend

Rhobots uses PyTorch through R's torch package to run embedding models. The C++ backend (~560 MB) is downloaded separately:

R
library(Rhobots)
rhobots_install()
Restart R when prompted. The torch backend will not load until you start a fresh session.
5
Run the demo

After restarting R, verify everything works. On Apple Silicon you can pass device = "mps" to use the GPU (2–3× faster for embedding):

R
library(Rhobots)
rhobots_demo()                   # CPU — works on any Mac
rhobots_demo(device = "mps")     # Apple Silicon GPU — faster
The first run downloads a small embedding model (~22 MB). Subsequent runs use the cached model and start faster.

macOS — Intel

Installation guide for Intel Mac

~30 minutes ~3 GB free space
CPU only. Intel Macs do not support Apple's MPS GPU backend — only device = "cpu" is available. Embedding ~900 paragraphs takes roughly 3–5 minutes.
1
Install Xcode Command Line Tools

Open Terminal and run:

Terminal
xcode-select --install
Click Install in the dialog. If it says "already installed", proceed to step 2.
2
Install R for Intel Mac

Download the x86_64 build of R from CRAN.

Download R for macOS (CRAN)
On the CRAN page, download the file ending in -x86_64.pkg (not arm64).
3
Install required R packages
R
install.packages(c("remotes", "gutenbergr"))
remotes::install_github("JPvdP/RhoBots")
Compiler output during the second command is normal — takes 1–3 minutes.
4
Set up the torch backend
R
library(Rhobots)
rhobots_install()
Restart R when prompted before proceeding to step 5.
5
Run the demo
R
library(Rhobots)
rhobots_demo()
Embedding on CPU takes roughly 3–5 minutes on a modern Intel Mac. The model is cached after the first run.

Windows 10 / 11

Installation guide for Windows

~40 minutes ~5 GB free space
1
Install Visual C++ Redistributable 2022

The torch package requires the Microsoft Visual C++ runtime to load its native libraries. This is a small installer (~25 MB) from Microsoft.

Download VC++ Redistributable (Microsoft)
Run vc_redist.x64.exe and click Install. Restart Windows if prompted before continuing.
2
Install R

Download and install the 64-bit version of R for Windows.

Download R for Windows (CRAN)
Accept the default options during installation. RStudio is optional but recommended.
3
Install Rtools

Rtools provides the C++ compiler R uses to build packages with native code. The version number must match your R version (e.g. Rtools45 for R 4.5, Rtools46 for R 4.6).

Download Rtools (CRAN)

After installing, verify it is working by running this in R — it should return a path, not an empty string:

R
Sys.which("make")  # should return a path, not ""
If the result is "", restart R after installing Rtools and try again.
4
Install required R packages
R
install.packages(c("remotes", "gutenbergr"))
remotes::install_github("JPvdP/RhoBots")
Compiler output during the second command is normal and takes 2–5 minutes.
5
Set up the torch backend
R
library(Rhobots)
rhobots_install()
Restart R when prompted before proceeding to step 6.
6
Run the demo
R
library(Rhobots)
rhobots_demo()
If you see a CUDA error and your machine has an NVIDIA GPU, run the following and then restart R:
R
torch::install_torch(type = "cpu")