Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update make deps #963

Merged
merged 11 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
**/*.memory
**/*.swp
bench/results
.python-version
cairo-rs-env/*
cairo-rs-pypy-env/*
37 changes: 28 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RELBIN:=target/release/cairo-rs-run
DBGBIN:=target/debug/cairo-rs-run

.PHONY: deps build run check test clippy coverage benchmark flamegraph \
.PHONY: deps deps-macos cargo-deps build run check test clippy coverage benchmark flamegraph \
compare_benchmarks_deps compare_benchmarks docs clean \
compare_vm_output compare_trace_memory compare_trace compare_memory \
compare_trace_memory_proof compare_trace_proof compare_memory_proof \
Expand Down Expand Up @@ -88,18 +88,36 @@ COMPILED_BAD_TESTS:=$(patsubst $(BAD_TEST_DIR)/%.cairo, $(BAD_TEST_DIR)/%.json,
$(BAD_TEST_DIR)/%.json: $(BAD_TEST_DIR)/%.cairo
cairo-compile $< --output $@

deps:
cargo-deps:
cargo install --version 1.1.0 cargo-criterion
cargo install --version 0.6.1 flamegraph
cargo install --version 1.14.0 hyperfine
cargo install --version 0.9.49 cargo-nextest
cargo install --version 0.5.9 cargo-llvm-cov
pyenv install pypy3.7-7.3.9
pyenv global pypy3.7-7.3.9
pip install -r requirements.txt
pyenv install 3.7.12
pyenv global 3.7.12
pip install -r requirements.txt
cargo install --version 0.11.0 wasm-pack

deps:
$(MAKE) cargo-deps
pyenv install -s pypy3.9-7.3.9
PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-rs-pypy-env
. cairo-rs-pypy-env/bin/activate ; \
pip install -r requirements.txt ; \
pyenv install -s 3.9.15
PYENV_VERSION=3.9.15 python -m venv cairo-rs-env
. cairo-rs-env/bin/activate ; \
pip install -r requirements.txt ; \

deps-macos:
Oppen marked this conversation as resolved.
Show resolved Hide resolved
$(MAKE) cargo-deps
brew install gmp
arch -x86_64 pyenv install -s pypy3.9-7.3.9
PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-rs-pypy-env
. cairo-rs-pypy-env/bin/activate ; \
CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib pip install -r requirements.txt ; \
pyenv install -s 3.9.15
PYENV_VERSION=3.9.15 python -m venv cairo-rs-env
. cairo-rs-env/bin/activate ; \
CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib pip install -r requirements.txt ; \

$(RELBIN):
cargo build --release
Expand Down Expand Up @@ -182,4 +200,5 @@ clean:
rm -f $(TEST_PROOF_DIR)/*.json
rm -f $(TEST_PROOF_DIR)/*.memory
rm -f $(TEST_PROOF_DIR)/*.trace

rm -rf cairo-rs-env
rm -rf cairo-rs-pypy-env
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ It's Turing-complete and it was created by [Starkware](https://starkware.co/) as

**Optional**

These dependencies are only necessary in order to run the original VM and compile Cairo programs.
These dependencies are only necessary in order to run the original VM, compile Cairo programs, and run tests.
- PyEnv with Python 3.9
- cairo-lang

Expand Down
6 changes: 3 additions & 3 deletions bench/run_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for file in $(ls $tests_path | grep .cairo | sed -E 's/\.cairo//'); do
export PATH="$(pyenv root)/shims:$PATH"

hyperfine \
-n "Cairo VM (CPython)" "PYENV_VERSION=3.7.12 cairo-run --layout all --program $tests_path/$file.json" \
-n "Cairo VM (PyPy)" "PYENV_VERSION=pypy3.7-7.3.9 cairo-run --layout all --program $tests_path/$file.json" \
-n "cairo-rs (Rust)" "../target/release/cairo-vm-cli $tests_path/$file.json --layout all"
-n "Cairo VM (CPython)" "PYENV_VERSION=3.9.15 cairo-run --layout starknet_with_keccak --program $tests_path/$file.json" \
-n "Cairo VM (PyPy)" "PYENV_VERSION=pypy3.9-7.3.9 cairo-run --layout starknet_with_keccak --program $tests_path/$file.json" \
-n "cairo-rs (Rust)" "../target/release/cairo-vm-cli $tests_path/$file.json --layout starknet_with_keccak"
done
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ecdsa==0.18.0
bitarray==2.7.3
fastecdsa==2.2.3
sympy==1.11.1
typeguard==2.13.3
Expand Down