Build From Source

This guide explains how to build the Rux compiler from source with CMake, Ninja, and Clang. It works on every platform Rux supports, including platforms without a prebuilt package.

Supported Platforms

  • BSD
  • Illumos
  • Linux
  • macOS
  • Windows

Requirements

Rux is built with Clang C++ compiler. We recommend the latest stable release of each tool:

Install the Build Tools

Install Clang, CMake, Ninja, and Git for your platform:

sudo pacman -S clang cmake ninja git
On macOS, the system clang is Apple Clang. To build with Homebrew's LLVM instead, prepend it to your PATHexport PATH="$(brew --prefix llvm)/bin:$PATH" — before configuring.

Clone the Repository

The Rux compiler has two branches:

  • main — the most stable release of the compiler
  • dev — the latest community updates; may be unstable
git clone https://github.com/rux-lang/rux
cd rux

Configure and Build

Configure the project with the Ninja generator and Clang, then build:

cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build
cmake --build build

The compiled rux binary is written to the build directory.

Add the Binary to Your PATH

cp build/rux ~/.local/bin/

On Unix-like systems, make sure ~/.local/bin is on your PATH, adding it in your shell's profile if needed.

Verify the Installation

rux version

You should see the installed Rux compiler version.

Releases

All Rux releases are available on GitHub.