Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a282628
Add some docs. Fix some issues.
azteca1998 Dec 11, 2024
6b8f6d0
More docs.
azteca1998 Dec 12, 2024
03bce62
Minor changes
DiegoCivi Jun 12, 2025
655d438
More minor changes
DiegoCivi Jun 12, 2025
5fc6372
Refactor on src layout
DiegoCivi Jun 12, 2025
b6ada90
Update examples on overview.md
DiegoCivi Jun 13, 2025
6cd39dd
Minor changes on overview.md example
DiegoCivi Jun 13, 2025
f36784d
Minor change
DiegoCivi Jun 13, 2025
107ee68
Remove wrong enum explanation
DiegoCivi Jun 13, 2025
b2cfadb
Fix merge mistake
DiegoCivi Jun 14, 2025
a465209
Remove JitValue references
DiegoCivi Jun 17, 2025
34e5c6a
Apply comments
DiegoCivi Jun 18, 2025
722ea69
Remove outdated link
DiegoCivi Jun 18, 2025
5b18317
Change cairo-native-run example file
DiegoCivi Jun 19, 2025
5ef2c42
Update runtime info
DiegoCivi Jun 19, 2025
49f3d6a
Update tools help message
DiegoCivi Jun 19, 2025
c42454d
Undo changes on compile.rs
DiegoCivi Jun 19, 2025
8002c24
Update example on overview.md
DiegoCivi Jun 23, 2025
cac4d34
Add AotContractExecutor
DiegoCivi Jun 23, 2025
2d9365f
Merge branch 'main' into update-documentation
FrancoGiachetta Jun 25, 2025
4a78d2b
Merge branch 'main' into update-documentation
DiegoCivi Jul 15, 2025
88b8c87
Update sierra-emu references
DiegoCivi Jul 15, 2025
56b4723
Merge branch 'update-documentation' of github.com:lambdaclass/cairo_n…
DiegoCivi Jul 15, 2025
b755bab
API usage refactor
DiegoCivi Jul 17, 2025
580521a
Refactor of project layout
DiegoCivi Jul 17, 2025
da5c08d
Add tool info
DiegoCivi Jul 17, 2025
286c666
Merge branch 'main' into update-documentation
DiegoCivi Jul 17, 2025
ee28e90
Refactor of runtime explanation
DiegoCivi Jul 17, 2025
2822583
Minor changes
DiegoCivi Jul 17, 2025
717935e
Update docs/overview.md
DiegoCivi Jul 18, 2025
663b5c5
Update docs/execution_walkthrough.md
DiegoCivi Jul 18, 2025
da4c780
Update docs/execution_walkthrough.md
DiegoCivi Jul 18, 2025
ffb66ad
Merge branch 'main' into update-documentation
DiegoCivi Jul 18, 2025
a6858ab
Refactor of starknet-native-compile description
DiegoCivi Jul 22, 2025
567fc74
cairo -> sierra
DiegoCivi Jul 22, 2025
753f850
Update docs/compilation_walkthrough.md
DiegoCivi Jul 22, 2025
82022da
Update docs/compilation_walkthrough.md
DiegoCivi Jul 22, 2025
ab53ab1
Update docs/compilation_walkthrough.md
DiegoCivi Jul 22, 2025
aea8b7e
Update docs/compilation_walkthrough.md
DiegoCivi Jul 22, 2025
76a7235
Minor changes
DiegoCivi Jul 28, 2025
3e9307d
Merge branch 'main' into update-documentation
DiegoCivi Aug 25, 2025
dc471bb
Merge branch 'main' into update-documentation
DiegoCivi Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use. This can be done by adding `cairo-native = "0.5.0-rc.6"` to your Cargo.toml
## Getting Started

### Dependencies

- Linux or macOS (aarch64 included) only for now
- LLVM 19 with MLIR: On debian you can use [apt.llvm.org](https://apt.llvm.org/),
on macOS you can use brew
Expand All @@ -54,6 +55,7 @@ use. This can be done by adding `cairo-native = "0.5.0-rc.6"` to your Cargo.toml
- Git

### Setup

> This step applies to all operating systems.

Run the following make target to install the dependencies (**both Linux and macOS**):
Expand All @@ -63,6 +65,7 @@ make deps
```

#### Linux

Since Linux distributions change widely, you need to install LLVM 19 via your
package manager, compile it or check if the current release has a Linux binary.

Expand Down Expand Up @@ -125,6 +128,7 @@ source env.sh
```

#### MacOS

The makefile `deps` target (which you should have ran before) installs LLVM 19
with brew for you, afterwards you need to execute the `env.sh` script to setup
the needed environment variables.
Expand All @@ -134,6 +138,7 @@ source env.sh
```

### Make targets:

Running `make` by itself will check whether the required LLVM installation and
corelib is found, and then list available targets.

Expand Down Expand Up @@ -162,11 +167,11 @@ Usage:
```

## Included Tools

Aside from the compilation and execution engine library, Cairo Native includes
a few command-line tools to aid development, and some useful scripts.

These are:
- The contents of the `/scripts/` folder
These are the contents of the `/src/bin` folder
- `cairo-native-compile`
- `cairo-native-dump`
- `cairo-native-run`
Expand All @@ -176,6 +181,7 @@ These are:
- `scarb-native-test`

### `cairo-native-compile`

```bash
Compiles a Cairo project outputting the generated MLIR and the shared library.
Exits with 1 if the compilation or run fails, otherwise 0.
Expand All @@ -197,6 +203,7 @@ Options:
```

### `cairo-native-dump`

```bash
Usage: cairo-native-dump [OPTIONS] <INPUT>

Expand All @@ -210,6 +217,7 @@ Options:
```

### `cairo-native-run`

This tool allows to run programs using the JIT engine, like the `cairo-run`
tool, the parameters can only be felt values.

Expand All @@ -234,6 +242,7 @@ Options:
```

### `cairo-native-test`

This tool mimics the `cairo-test`
[tool](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-test-runner)
and is identical to it in interface, the only feature it doesn't have is the profiler.
Expand Down Expand Up @@ -275,6 +284,7 @@ cairo-native-test ./cairo-tests/
This will run all the tests (functions marked with the `#[test]` attribute).

### `cairo-native-stress`

This tool runs a stress test on Cairo Native.

```bash
Expand Down Expand Up @@ -315,6 +325,7 @@ make stress-clean
```

### `scarb-native-dump`

This tool mimics the `scarb build` [command](https://github.com/software-mansion/scarb/tree/main/extensions/scarb-cairo-test).
You can download it on our [releases](https://github.com/lambdaclass/cairo_native/releases) page.

Expand All @@ -323,6 +334,7 @@ behave like `scarb build`, leaving the MLIR files under the `target/` folder
besides the generated JSON sierra files.

### `scarb-native-test`

This tool mimics the `scarb test` [command](https://github.com/software-mansion/scarb/tree/main/extensions/scarb-cairo-test).
You can download it on our [releases](https://github.com/lambdaclass/cairo_native/releases) page.

Expand All @@ -348,6 +360,7 @@ Options:
## Benchmarking

### Requirements

- [hyperfine](https://github.com/sharkdp/hyperfine): `cargo install hyperfine`
- [cairo 2.12.0-dev.0](https://github.com/starkware-libs/cairo)
- Cairo Corelibs
Expand Down
1 change: 0 additions & 1 deletion benches/compile_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,4 @@ pub fn bench_compile_time(c: &mut Criterion) {
}

criterion_group!(benches, bench_compile_time);

criterion_main!(benches);
2 changes: 1 addition & 1 deletion benches/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn prepare_programs(path: &str) -> Vec<(Arc<Program>, String)> {
.collect::<Vec<_>>()
}

#[allow(unused)] // its used but clippy doesn't detect it well
#[allow(unused)] // Used in `benches/libfuncs.rs`, but not in the others.
pub fn create_vm_runner(program: &Program) -> SierraCasmRunner {
SierraCasmRunner::new(
program.clone(),
Expand Down
Loading
Loading