Installation

Both masreml and masbayes have Rust backends compiled at install time, so you need the Rust toolchain (rustc + cargo) on your machine before you install either R package. The toolchain is a one-time setup; once Rust is present, installing or upgrading the packages is a single install.packages() call each.

Rust & cargo Installation

The recommended installer for every supported platform is rustup, the official Rust toolchain manager. It installs rustc, cargo, and the standard library, and gives you a single command (rustup update) to keep them current.

Linux

Open a terminal and run:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Accept the default installation (option 1). When it finishes, re-source your shell so cargo and rustc are on PATH:

source "$HOME/.cargo/env"

Verify:

rustc --version       # rustc 1.7x.x
cargo --version       # cargo 1.7x.x

Most distributions also need a C/C++ toolchain and OpenSSL headers for extendr to link the Rust kernels into R. On Debian / Ubuntu:

sudo apt-get update
sudo apt-get install -y build-essential libssl-dev pkg-config

On Fedora / RHEL / Rocky:

sudo dnf install -y gcc gcc-c++ openssl-devel pkgconf-pkg-config

macOS

Open Terminal and run the same installer:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

If Xcode Command Line Tools are not yet installed, the system will prompt for them; accept the prompt (or install manually with xcode-select --install). Verify:

rustc --version
cargo --version

If you use Homebrew, you can also install via brew install rustup-init followed by rustup-init, but the official one-liner is simpler.

Windows

  1. Download rustup-init.exe from rustup.rs.

  2. Run it. When prompted for the host triple, accept the default (x86_64-pc-windows-msvc); when prompted for installation type, choose 1) Proceed with installation (default).

  3. The installer will detect whether you have the Microsoft C++ Build Tools — if not, follow the on-screen link to Visual Studio Build Tools, install the Desktop development with C++ workload, then re-run rustup-init.exe.

  4. Open a new PowerShell or Command Prompt window (so PATH is refreshed) and verify:

    rustc --version
    cargo --version

For all platforms, rustup update later picks up the newest stable toolchain release.

MasBayes & MasReml Installation

Once Rust is installed and on PATH, install each R package directly from its GitHub source tarball. install.packages() will trigger the Rust build during install — the first install takes a few minutes because cargo compiles the Rust crates from scratch; subsequent installs reuse the cargo cache.

masbayes

install.packages(
    "https://github.com/bowo1698/masbayes/archive/refs/heads/main.tar.gz",
    repos = NULL, type = "source"
)

# load library
library(masbayes)

masreml

install.packages(
    "https://github.com/bowo1698/masreml/archive/refs/heads/main.tar.gz",
    repos = NULL, type = "source"
)

# load library
library(masreml)

After both packages load without error, you are ready to follow the Task tutorials or the Input Data walkthroughs using the bundled demo dataset.