You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating README, and adding target to regen julia_types.rs (#215)
Adding new instructions to build Julia with MMTk since upstream already
supports it. Also adding some clarification about the FFI bindings in
`julia_types.rs` and a target to regenerate that file.
(cd mmtk-julia && make release) # or "make debug" for a debug build
13
19
```
14
20
15
21
If you would like debugging information in your release build of MMTk, add `debug = true` under `[profile.release]` in `mmtk/Cargo.toml`.
22
+
Below, we provide some instructions on how to build the mmtk-julia binding from source _and_ link it when building Julia.
16
23
17
24
### Checking out and Building Julia with MMTk
18
25
19
-
Besides checking out the binding (this repository), it is also necessary to checkout a fork containing a modified version of the Julia repository (https://github.com/mmtk/julia).
20
-
_Use the `dev` branch of the Julia repository._
21
-
For example, we check out the fork as a sibling of `mmtk-julia`.
22
-
For step-by-step instructions, read the section "Quick Building Guide".
26
+
If you'd like to try out Julia with MMTk, simply clone the Julia repository from https://github.com/JuliaLang/julia and create a `Make.user` file inside the `julia` folder containing `MMTK_PLAN=Immix`. This will automatically checkout the latest release of the mmtk-julia binding and link it while building Julia itself.
27
+
28
+
To build the binding from source, besides checking out this repository, it is also necessary to checkout a version of the Julia repository (https://github.com/JuliaLang/julia). We recommend checking out the latest master, but any commit after [this](https://github.com/JuliaLang/julia/commit/22134ca28e92df321bdd08502ddd86ad2d6d614f) should work.
29
+
For example, we check out Julia as a sibling of `mmtk-julia`.
23
30
24
31
The directory structure should look like the diagram below:
25
32
@@ -34,35 +41,40 @@ Your working directory/
34
41
35
42
#### Build Julia binding in Rust
36
43
37
-
Before building Julia, build the binding in `mmtk-julia/mmtk`. You must have already checked out Julia, set `JULIA_PATH` to point to the checkout (remember to check out the `dev` branch!) and set `MMTK_JULIA_DIR` to the binding's top-level directory.
44
+
Before building Julia, build the binding in `mmtk-julia`. Set `MMTK_JULIA_DIR` to the absolute path containing the binding's top-level directory and build the binding by running `make release` or `make debug` from that directory.
38
45
39
-
In `mmtk-core` we currently support either Immix or StickyImmix implementations.
40
-
Build it with `cargo build --features immix` or `cargo build --features stickyimmix`.
41
-
Add `--release` at the end if you would like to have a release build, otherwise it is a debug build.
46
+
We currently only support a (non-moving) Immix implementation. We hope to add support for non-moving StickyImmix and the respective moving versions of both collectors in the near future. We also only support x86_64 Linux, more architectures should also be supported in the near future.
42
47
For a release build with debugging information, first add `debug = true` under `[profile.release]` in `mmtk/Cargo.toml`.
48
+
Make sure you have the prerequisites for building [MMTk](https://github.com/mmtk/mmtk-core#requirements).
43
49
44
-
#### Build Julia with MMTk
50
+
#### Build Julia with MMTk (from source)
45
51
46
-
To build Julia with MMTk, first ensure you have the prerequisites for building both [Julia](https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/build/build.md#required-build-tools-and-external-libraries) and [MMTk](https://github.com/mmtk/mmtk-core#requirements).
52
+
To build Julia with MMTk using the version built in the previous step, first ensure you have the prerequisites for building [Julia](https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/build/build.md#required-build-tools-and-external-libraries).
47
53
48
-
Next create a `Make.user` file in the top-level directory of the Julia repository consisting of the line `MMTK_PLAN=Immix` or `MMTK_PLAN=StickyImmix`.
54
+
Next create a `Make.user` file in the top-level directory of the Julia repository consisting of the line `MMTK_PLAN=Immix`.
49
55
50
-
Finally, set the following environment variables:
56
+
Finally, if you have not done it already, set the following environment variable:
51
57
52
58
```
53
-
export MMTK_BUILD=release # or debug depending on how you build the Julia binding in Rust
54
59
export MMTK_JULIA_DIR=<path-to-mmtk-julia>
55
60
```
56
-
... and run `make`.
61
+
... and run `make` from Julia's top-level directory.
57
62
58
63
Alternatively you can set the environment variables in your `Make.user`
59
64
60
65
```
61
-
export MMTK_BUILD := release
62
66
export MMTK_JULIA_DIR := <path-to-mmtk-julia>
63
-
export MMTK_PLAN := Immix # or export MMTK_PLAN := StickyImmix
67
+
export MMTK_PLAN := Immix
64
68
```
65
69
70
+
If you have done a debug build of the binding, make sure to also set `MMTK_BUILD=debug` before building Julia.
71
+
72
+
### Rust FFI bindings from Julia
73
+
74
+
The mmtk-julia binding requires a set of Rust FFI bindings that are automatically generated from the Julia repository using [bindgen](https://github.com/rust-lang/rust-bindgen). In this repository, the FFI bindings have already been generated, and added to the file `mmtk/src/julia_types.rs`.
75
+
However, if Julia changes the object representation of any of the types defined in the FFI bindings in `mmtk/src/julia_types.rs`, that file will become outdated.
76
+
To generate the FFI bindings again (and rebuild the binding), checkout the Julia repository following the steps described [previously](#checking-out-and-building-julia-with-mmtk), set the environment variable `JULIA_PATH` to point to the `julia` directory and run `make regen-bindgen-ffi` from the binding's top-level directory, note that this step will already do a release build of mmtk-julia containing the new version of `julia_types.rs`. Make sure you have all the [requirements](https://rust-lang.github.io/rust-bindgen/requirements.html) to running `bindgen`.
77
+
66
78
### Heap Size
67
79
68
80
Currently MMTk supports a fixed heap limit or variable heap within an interval. The default is a variable heap with the minimum heap size set to Julia's [`default_collection_interval`](https://github.com/mmtk/julia/blob/847cddeb7b9ddb5d6b66bec4c19d3a711748a45b/src/gc.c#L651) and the maximum size set to 70% of the free memory available. To change these values set the environment variables `MMTK_MIN_HSIZE` and `MMTK_MAX_HSIZE` to set the mininum and maximum size in megabytes, or `MMTK_MIN_HSIZE_G` and `MMTK_MAX_HSIZE_G` to set the size in gigabytes. If both environment variables are set, MMTk will use the size in megabytes. To set a fixed heap size, simply set only the variables `MMTK_MAX_HSIZE` or `MMTK_MAX_HSIZE_G`, or set `MMTK_MIN_HSIZE` or `MMTK_MIN_HSIZE_G` to 0. Note that these values can be decimal numbers, e.g. `MMTK_MAX_HSIZE_G=1.5`.
0 commit comments