@@ -4,39 +4,58 @@ Simplified version of Firestorm targeting C instead of machine code directly.
4
4
5
5
# Local Build Setup
6
6
7
- Brew:
7
+ ### Install Dependencies
8
+
9
+ You need ` ninja ` , ` cmake ` (at least 3.28) and ` llvm ` 19.
10
+
11
+ On macOS:
8
12
9
13
``` bash
10
- brew install ninja cmake ccache hyperfine llvm@19
14
+ brew install ninja cmake hyperfine llvm@19
11
15
```
12
16
13
- Get the sources
17
+ On Ubuntu 24.04:
14
18
15
19
``` bash
16
- git clone [email protected] :DragonRuby/lightstorm.git --recursive
20
+ sudo apt-get install ninja-build cmake
17
21
```
18
22
19
- Create toolchain dir
23
+ To install LLVM 19 follow the instructions [ here] ( https://apt.llvm.org ) .
24
+
25
+ ### Checkout
20
26
21
27
``` bash
22
- sudo mkdir /opt/lightstorm.toolchain.dir
23
- sudo chown ` whoami` /opt/lightstorm.toolchain.dir
28
+ git clone
[email protected] :DragonRuby/lightstorm.git --recursive
24
29
```
25
30
26
- Build lightstorm
31
+ ### Build & install
27
32
28
33
``` bash
29
- mkdir lightstorm-build; cd lightstorm-build
30
- cmake -G Ninja -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@19/ \
31
- -DCMAKE_INSTALL_PREFIX=/opt/lightstorm.toolchain.dir/lightstorm \
32
- ../lightstorm
34
+ # On Ubuntu
35
+ cmake --workflow --preset lightstorm-ubuntu-install
36
+ # On macOS
37
+ cmake --workflow --preset lightstorm-macos-install
38
+ ```
39
+
40
+ # Build "Hello World"
33
41
34
- ninja
42
+ ``` bash
43
+ > echo ' puts "Hello, Lightstorm"' > hello.rb
44
+ > ./install.dir/bin/lightstorm hello.rb -o hello.rb.c
45
+ > clang hello.rb.c -o hello_lightstorm \
46
+ -L./install.dir/lib/ \
47
+ -isystem./third_party/mruby/include -isystem./third_party/mruby/build/host/include/ \
48
+ -llightstorm_runtime_main -llightstorm_mruby -lm
49
+ > ./hello_lightstorm
50
+ Hello, Lightstorm
35
51
```
36
52
53
+ # Build and run tests
54
+
37
55
Build a test (` tests/integration/loads.rb ` ):
38
56
39
57
``` bash
58
+ > cd build.dir
40
59
> ninja loads.rb.exe
41
60
> ../lightstorm/tests/integration/Output/loads.rb.tmp.exe
42
61
1
0 commit comments