roc/BUILDING_FROM_SOURCE.md

25 lines
1.0 KiB
Markdown
Raw Normal View History

2019-10-16 04:16:27 +03:00
# Building the Roc compiler from source
## Installing LLVM
2019-10-18 06:00:13 +03:00
To build the compiler, you need a particular version of LLVM installed on your system.
To see which version of LLVM you need, take a look at `Cargo.toml`, in particular the `branch` section of the `inkwell` dependency. It should have something like `llvmX-Y` where X and Y are the major and minor revisions of LLVM you need.
2019-10-16 04:16:27 +03:00
2020-01-27 02:39:51 +03:00
For Ubuntu, I used the `Automatic installation script` at [apt.llvm.org](https://apt.llvm.org) - but there are plenty of alternative options at http://releases.llvm.org/download.html
2019-11-18 16:44:10 +03:00
You may run into an error like this:
```
Updating git repository `https://github.com/TheDan64/inkwell`
error: failed to load source for a dependency on `inkwell`
Caused by:
Unable to update https://github.com/TheDan64/inkwell?branch=llvm8-0#d0f5c1e1
Caused by:
revspec 'd0f5c1e198853bc06d8427fbafb7b068032d1d1a' not found; class=Reference (4); code=NotFound (-3)
```
This seems to be caused by cargo being out of date (even if it's freshly installed), and can be fixed with `cargo update`.