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

sudo apt-get install clang-3.5 libclang-3.5-dev llvm-3.5-dev
git clone -b master
cd legion/language
./ --debug


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

brew install llvm@3.9
# Consider placing these lines into your .bashrc for future use.
export CLANG="$(brew --prefix)/opt/llvm@3.9/bin/clang"
export LLVM_CONFIG="$(brew --prefix)/opt/llvm@3.9/bin/llvm-config"
export CXX="$(brew --prefix)/opt/llvm@3.9/bin/clang++"
git clone -b master
cd legion/language
./ --debug

Note: In order for this to work, Homebrew must be installed to /usr/local. Other locations (such as $HOME) will build but will result in a broken compiler.

Other Systems

Complete instructions for installation follow below.

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


Regent requires:

  • Linux, macOS, or another Unix
  • A C++ 98 (or newer) compiler (GCC, Clang, Intel, or PGI) and GNU Make
  • Python 2.7 (or 3.x)
  • LLVM and Clang with headers:
    • LLVM 3.8 is recommended for use with CUDA
    • LLVM 3.5 is recommended for debugging (other versions will be missing debug symbols)
    • LLVM 3.5-3.9 and 6.0 are also supported

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.


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

git clone -b master
cd legion/language
./ --debug

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


Regent includes a frontend interpreter which can be run with:

./ <script>

For example:

./ 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:


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