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:
- Clang 22.1 or later
- CMake 4.3 or later
- Ninja 1.13 or later
- Git 2.54 or later
Install the Build Tools
Install Clang, CMake, Ninja, and Git for your platform:
sudo pacman -S clang cmake ninja gitpkg install llvm cmake ninja gitsudo apt install clang cmake ninja-build gitsudo dnf install clang cmake ninja-build gitbrew install llvm cmake ninja gitsudo apt install clang cmake ninja-build gitscoop install llvm cmake ninja gitTIP
On macOS, the system clang is Apple Clang. To build with Homebrew's LLVM instead, prepend it to your PATH — export 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 ruxgit clone -b dev https://github.com/rux-lang/rux rux-dev
cd rux-devConfigure 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 buildThe compiled rux binary is written to the build directory.
Add the Binary to Your PATH
cp build/rux ~/.local/bin/# Open Environment Variables and add the build directory to your global Path,
# or copy rux.exe into a directory that is already on your PATH.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 versionYou should see the installed Rux compiler version.
Releases
All Rux releases are available on GitHub.