Fetching contributors…
Cannot retrieve contributors at this time
78 lines (54 sloc) 2.13 KB

Regent Compiler

This directory contains the compiler for the Regent language.

Quickstart for Ubuntu

sudo apt-get install llvm-3.5-dev libclang-3.5-dev clang-3.5
./ --debug
./ examples/circuit.rg


Regent requires:

  • Python 2.7 or 3.x (for the self-installer and test suite)
  • LLVM and Clang with headers (as of January 2017 LLVM 3.5 is recommended; 3.6-3.9 also work but may be missing debug symbols)

Regent also has a number of transitive dependencies via Legion:

  • Linux, macOS, or another Unix
  • A C++ 98 or newer compiler (GCC, Clang, Intel, or PGI) and GNU Make
  • Optional: CUDA 5.0 or newer (for NVIDIA GPUs)
  • Optional: GASNet (for networking)
  • Optional: LLVM 3.5 (for dynamic code generation)
  • Optional: HDF5 (for file I/O)


Run the following command from the language directory:

./ [-h] [--with-terra TERRA] [--debug] [--gasnet]
             [--cuda] [-j [THREAD_COUNT]]

This command:

  • Downloads and builds Terra. (Terra will recursively download and build LuaJIT).
  • Builds a dynamic library for Legion.
  • (OS X) Patches said dynamic library to avoid hard-coded absolute paths.
  • Sets everything up to run from


  • Use --debug to enable Legion's debug mode. Debug mode includes significantly more safety checks and better error messages, but also runs signficantly slower than release mode.
  • For CUDA support, use --cuda.
  • For GASNet (networking) support, use --gasnet.
  • If you want to build with your own copy of Terra, pass the path to the Terra directory via the --with-terra flag. You will be responsible for building Terra yourself if you do this.


To use Regent, run:


Regent source files use the extension .rg. A number of examples are contained in the examples directory. For example:

./ examples/circuit.rg


To run the test suite, run:

./ [-h] [-j [THREAD_COUNT]] [-v]