Install

Quickstart

Ubuntu

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

sudo apt-get install build-essential cmake git llvm-6.0-dev libclang-6.0-dev clang-6.0 libedit-dev libncurses5-dev zlib1g-dev
git clone -b master https://github.com/StanfordLegion/legion.git
cd legion/language
./install.py --debug

macOS

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

curl -O https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang+llvm-9.0.1-x86_64-apple-darwin.tar.xz
tar xfJ clang+llvm-9.0.1-x86_64-apple-darwin.tar.xz
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$PWD/clang+llvm-9.0.1-x86_64-apple-darwin"
export INCLUDE_PATH="$(xcrun --sdk macosx --show-sdk-path)/usr/include"
git clone -b master https://github.com/StanfordLegion/legion.git
cd legion/language
CXXFLAGS=-std=c++11 ./install.py --debug

Note: Previously we recommended Homebrew to install LLVM, but as of December 2020, this route does not work unless you have a full installation of XCode (i.e., the command-line tools are not sufficient).

Other Systems

Complete instructions for installation follow below.

Regent is also available as a Docker container. See the bottom of this page for instructions.

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 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 (including multi-node and GPU configurations), see the README.

Running

Regent includes a frontend interpreter which can be run with:

./regent.py <script>

For example:

./regent.py examples/circuit.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:

Docker

If you have Docker, Regent is also available as a container:

docker run -ti stanfordlegion/regent

This will start a bash shell from which you can run Regent. Regent is installed under /usr/local/legion. So for example, to run the circuit example:

regent /usr/local/legion/language/examples/circuit.rg

Because Docker containers have no access to the host file system, some additional options are required if you want to run Docker on your own Regent files. The command below mounts the current directory in the host as /examples in the container and then runs Regent on it.

docker run -ti -v $PWD:/examples stanfordlegion/regent regent /examples/circuit.rg