Building the compilers

The XL distribution contains two top-level directories:

Building the XL2 compiler

To build the XL2 compiler, go to the xl2 directory and type make:

% cd xl2
% make

This will perform a compiler bootstrap. In other words, several compilers will be built successively:

  1. A bootstrap compiler called xl, written in C++, and compiling a simplified version of XL2
  2. A bootstrap compiler called bxl, written in simplified XL and compiled with xl, and implementing a slightly less simplified version of XL.
  3. Several bootstrap compilers for sanity checking, where bxl compiles itself several times, resulting in compilers called bbxl, bbbxl, ...
  4. A native compiler called nxl, compiled with bxl, written in bootstrap-level XL, and implementing the full XL2 semantics.
  5. Several native bootstrap compilers built for sanity checking, resulting in compilers called nnxl, nnnxl.

The bootstrapping process is not perfect, because it proved difficult to keep the language compiled by nxl compatible with the simplified idiom accepted by bxl. As a result, nxl can only compile itself with the -bootstrap option, which make it accept a very sloppy variant of XL2.

Building the XLR compiler

To build the XLR compiler, go to the xlr directory and type make:

% cd xlr
% make
% make test

The XLR language is still under active development and may change rapidly.

Pre-requisites for building XL

Building XL assumes that you have developer tools installed:

  • A modern C++ compiler.
  • A variant of make that is not too incompatible with GNU make.

The code has been mostly tested with the GNU GCC toolchain, although you may be lucky with other compilers.

Environment variables

Before building XL components, you may want to set the BUILDENV environment variable, for example:

% export BUILDENV=macosx    

The syntax for setting BUILDENV may vary with your shell. Currently, the reasonably tested choices for BUILDENV are: * macosx for MacOSX (tested on 10.6) * linux for Linux builds (tested primarily on Ubuntu and Fedora) * mingw for Windows using [MinGW][]

The environment variable is used to pick a makefile configuration, which is stored in a file named, where xyz is the value of BUILDENV. You may easily create your own build environments by modifying one of these files, for example to use Intel compilers instead of GCC on Linux.

If the BUILDENV variable is not set, the build system will try to guess a best choice for your platform, and emit a message like the following:

The BUILDENV environment variable is not set
You will accelerate builds by setting it as appropriate for
your system. The best guess is BUILDENV=macosx
Attempting to build debug with macosx

This message indicates the best guess of the build system for your particular platform.

Build targets

To build an optimized compiler, use:

% make opt

To build a debug compiler (currently the default), use:

% make debug

To show the command lines being used during build, prefix the build target name with v- (for verbose)

% make v-debug

To measure how long the build takes, prefix the build target with timing-

% make timing-debug

To run the various tests for a given components (the rule is not always present)

% make test