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:
@ -36,7 +36,8 @@ premake5-osx --file=scripts/LLVM.lua download_llvm # on OSX
@@ -36,7 +36,8 @@ premake5-osx --file=scripts/LLVM.lua download_llvm # on OSX
premake5-linux-64 --file=scripts/LLVM.lua download_llvm # on Linux
```
Alternatively, if on Windows, just double click on `<CppSharp>/build/DownloadDeps.bat`.
Alternatively, if on Windows, just run `<CppSharp>/build/DownloadDeps.bat` from a Visual Studio command prompt
corresponding to the VS version you want to use.
After this, you should end up with one or multiple `<CppSharp>/build/scripts/llvm-<revision>-<os>-<configuration>` folders
containing the headers and libraries for LLVM.
@ -50,64 +51,66 @@ Please check the guide in [Compiling LLVM and Clang from source](BuildingLLVM.md
@@ -50,64 +51,66 @@ Please check the guide in [Compiling LLVM and Clang from source](BuildingLLVM.md
1. Run `./premake5-osx gmake` in `<CppSharp>\build`
2. Build the generated makefiles:
- 32-bit builds: `config=release_x86 make -C gmake`
- 64-bit builds: `config=release_x64 make -C gmake`
Building in *Release* is recommended because else we will use the Clang parser
debug configuration, which will be too slow for practical use beyond debugging.
The version you compile needs to match the version of the Mono VM installed on your
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 macOS or Linux
## 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).
Ubuntu 14.04 contains recent enough Mono by default, which you can install with:
1. Generate the Makefiles
```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.