More thorough directions for Mac and Linux are coming very shortly. We are also working to automate as much as possible, to keep this simple.
I am adding dependencies on OCaml batteries included and sexplib. On Ubuntu or similar, these are available via:
sudo apt-get install libsexplib-camlp4-dev ocaml-batteries-included
On OS X, I recommend using ODB to install additional OCaml packages (sexplib, batteries).
-
Install OCaml (3.12.*)
(On Mac, just use Homebrew:brew install objective-caml, or MacPorts:sudo port install ocaml) -
Install GCC 4.6/4.7 -
g++-4.6org++-4.7must be in your$PATH
(On Mac, Homebrew is highly recommended:brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/gcc.rb --enable-cxx) -
./bootstrapto build everything (and wait -- this builds all of LLVM, which takes a while) -
cd test; ./run_test cpp/* -
Check out
test/cpp/*andapps/*for examples of how to get started. -
OPTIONAL:
source ./bash_profileto configure llvm paths for current session (if you want llvm tools in your path for manual use, or for use by static buildMakefiles like those in some ofapps/*).
TODO: hard code LLVM paths in Makefiles to make this really optional again.
- ensure clang sub-submodule (llvm/tools/clang) is updated and checked out at branch matching llvm (optional: if you want to have a clang for this llvm build)
- put ignores in [llvm,llvm/tools/clang]/.git/info/exclude to keep built dir clean
- configure llvm for debug+asserts during development:
./configure --enable-assertions - enable all targets (e.g. for arm):
./configure --enable-targets=all
To make OCaml print useful stack trace info on uncaught exceptions, build a bytecode target with debugging (.d.byte) and set the OCAMLRUNPARAM environment variable to include the "b" (backtrace) option. (Cf. the OCaml runtime system docs for more.)