Written by Gabriel Hjort Blindell <ghb@kth.se>
===========================
= HOW TO BUILD AND INSTALL
===========================
We denote the folder wherein this README file is located as <REPO>.
First, a customized version LLVM 3.8 needs to be installed on the machine. Just
follow these instructions.
1. Clone the LLVM repo and checkout the correct branch.
git clone ssh://git@github.com:unison-code/llvm.git uni-is-llvm
cd uni-is-llvm
git checkout release_38-uni-is
2. Clone LLVM clang (assuming that your terminal is currently standing in the
'uni-is-llvm' folder).
git clone http://llvm.org/git/clang.git --branch release_38 --single-branch \
tools/clang
3. Configure and build LLVM (assuming that your terminal is currently standing
in the 'uni-is-llvm' folder).
cd ..
mkdir uni-is-llvm-build
cd uni-is-llvm-build
cmake -LLVM_BUILD_LLVM_DYLIB ../uni-is-llvm
make -j <num cores>
If this repo has recently been cloned, then we must initiate the submodule that
contains the 'llvm-general' Haskell packages.
5. Initiate and update submodules (assuming that your terminal is currently
standing in the <REPO> folder).
git submodule init
git submodule update
Before we can build the 'llvm-general' package, we must ensure that the LLVM
binaries are available in the default search locations. This is done by
extending the $PATH variable. The toolchain also requires that the environment
variable UNI_IS_LLVM_BUILD_DIR has been set. Assume the full path to the LLVM
build directory is denoted as <LLVM_BUILD> (in this example, it's the folder
with basename 'uni-is-llvm-build'). Then:
6. In your ~/.bashrc file, add the following lines:
export UNI_IS_LLVM_BUILD_DIR=<LLVM_BUILD>
export PATH=$UNI_IS_LLVM_BUILD_DIR/bin:$PATH
7. To ensure the new $PATH is loaded, either open a new terminal or run
following command:
source ~/.bashrc
Now we can build the tool chain.
8. Build tool chain (assuming that your terminal is currently standing in the
<REPO> folder).
make
9. Lastly, we need to install MiniZinc. Download the latest version from
http://www.minizinc.org/ and unpack the TAR file. After unpacking, extend the
PATH environment variable:
export PATH=<MINIZINC>:$PATH
where <MINIZINC> denotes the path to where the MiniZinc binaries are.