Building

Compilation Options

Setting the following environment variables for make enables the following compilation option:

BYTE:

sets byte-code compilation instead of native

DEBUG:

enables the -g option of ocamlc

PROFILE:

enables the -p option of ocamlc

WARN_PATTERN:

enables warning for non-exhaustive patterns

VERBOSE:

sets verbosity level of ocamlbuild

PARALLEL:

sets max number of parallel processes

For instance, to enable byte-code compilation, run:

~/beluga# make BYTE=true

Troubleshooting

Attempting to build Beluga before installing the prequisites may cause libraries to be only partially updated. You may receive a new error message once you've set up the prereq packages.

Error: The files [path/to/file]
and [path/to/file]
make inconsistent assumptions over interface [library name]

Try cleaning the Beluga directory.

~/beluga# make clean all

Executing Programs

Once you've built the Beluga executables, you can now run Beluga programs with the ./beluga/bin/beluga" executable.

~/beluga# bin/beluga path/to/program.bel

Emacs Mode

Beluga includes a major mode for programming in Emacs. The elisp file saved as
./beluga/tools/beluga-mode.el directory.

Update your ~/.emacs configuration file with the lines written below. XEmacs users must
update ~/.xemacs and ~/.xema.cs/init.el with the same text. Create any of these files if
they do not exist already.

Add beluga/bin to your path; if Emacs does not detect your custom path, a quick fix
is to create a symbolic link to the Beluga executable in a directory that is in the default Emacs path
(such as /usr/bin).

Restart Emacs.

Emacs will now launch Beluga-mode automatically when you open a program with the .bel suffix.