If the clone_llvm step fails, you can try to manually clone LLVM and Clang as explained above. You should still run clone_llvm to ensure that you are on the correct revision.
Make sure to use the revisions specified below, or you will most likely get compilation errors.
Required LLVM/Clang commits:
## Compiling on Linux
[LLVM: see /build/LLVM-commit.](https://github.com/mono/CppSharp/tree/master/build/LLVM-commit)
[Clang: see /build/Clang-commit.](https://github.com/mono/CppSharp/tree/master/build/Clang-commit)
If you do not have native build tools you can install them first with:
To change to the revisions specified above you can run the following commands:
1. Run `./premake5-osx gmake` in `<CppSharp>\build`
Building in *Release* is recommended because else we will use the Clang parser
2. Build the generated makefiles:
debug configuration, which will be too slow for practical use beyond debugging.
- 32-bit builds: `config=release_x86 make -C gmake`
- 64-bit builds: `config=release_x64 make -C gmake`
The version you compile needs to match the version of the Mono VM installed on your
## Compiling on macOS or Linux
system which you can find by running `mono --version`. The reason for this is because
a 32-bit VM will only be able to load 32-bit shared libraries and vice-versa for 64-bits.
## Compiling on Linux
1. Change directory to `<CppSharp>\build`
2. Run `./Compile.sh` to generate the project files and compile the code.
Only 64-bits builds are supported at the moment.
If the above script fails, you can try these equivalent manual steps:
We depend on a somewhat recent version of Mono (.NET 4.5).
1. Generate the Makefiles
Ubuntu 14.04 contains recent enough Mono by default, which you can install with:
```shell
```
sudo apt-get install mono-devel
./premake5-osx gmake # if on OSX
./premake5-linux-64 gmake # if on Linux
```
```
If you are using another distribution then please look into the [download page](http://www.mono-project.com/download/#download-lin) on the Mono website.