Install

Quickstart

These quickstart instructions describe how to install Regent on Ubuntu and macOS, respectively.

Ubuntu

If you use Ubuntu, you can install Regent by running:

# install dependencies
sudo apt-get install build-essential cmake git wget
wget https://github.com/terralang/llvm-build/releases/download/llvm-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu.tar.xz
tar xf clang+llvm-13.0.0-x86_64-linux-gnu.tar.xz
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$PWD/clang+llvm-13.0.0-x86_64-linux-gnu"

# download and build Regent
git clone -b master https://github.com/StanfordLegion/legion.git
cd legion/language
./install.py --debug --rdir=auto

# run Regent example
./regent.py examples/circuit_sparse.rg

(These instructions have been tested on Ubuntu 18.04 and 20.04.)

macOS

If you use macOS, you can install Regent by running:

# install XCode command-line tools
sudo xcode-select --install

# download CMake
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-macos-universal.tar.gz
tar xfz cmake-3.22.2-macos-universal.tar.gz
export PATH="$PATH:$PWD/cmake-3.22.2-macos-universal/CMake.app/Contents/bin"

# download LLVM
curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz
tar xfJ clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$PWD/clang+llvm-13.0.0-x86_64-apple-darwin"

# environment variables needed to build/run Regent
export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
export CXXFLAGS="-std=c++11"

# download and build Regent
git clone -b master https://github.com/StanfordLegion/legion.git
cd legion/language
./install.py --debug --rdir=auto

# run Regent example
./regent.py examples/circuit_sparse.rg

(These instructions have been tested on macOS 12.3 on an x86 Mac.)

Other Systems

Complete instructions for other systems follow below.

For supercomputers, you may refer directly to the README.

Prerequisites

Regent requires:

  • Linux, macOS, or another Unix
  • A C++ 11 (or newer) compiler (GCC, Clang, Intel, or PGI) and GNU Make
  • Python 3.5 or newer
  • LLVM and Clang with headers:
  • Optional (but strongly recommended): CMake 3.5 or newer

There are also a number of optional dependencies. For most users, we recommend skipping these initially and installing them later on an as-needed basis.

Building

Regent includes a self-installer which downloads Terra and builds the Regent compiler. Run:

git clone -b master https://github.com/StanfordLegion/legion.git
cd legion/language
./install.py --debug

For other installation options (e.g., multi-node and GPU configurations, including supercomputers), see the README.

Running

Regent includes a frontend interpreter which can be run with:

./regent.py <script>

For example:

./regent.py examples/circuit_sparse.rg

(Note: The Regent frontend can also be run without arguments to obtain a Terra/LuaJIT shell. However, this mode is not very useful because of the way that Terra language extensions works. Also, the Legion runtime is not currently reentrant, making interactive use difficult.)

Development Environment

Regent syntax highlighting modes are available for the following editors: