-
Notifications
You must be signed in to change notification settings - Fork 2
/
common.sh
46 lines (41 loc) · 1.25 KB
/
common.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Common shared functionality.
# Build/install everything required for benchmarking.
#
# The python bits are installed inside a virtual env in a directory
# `$(PWD)/venv`.
setup() {
# Install Rust
export CARGO_HOME="$(pwd)/.cargo"
export RUSTUP_HOME="$(pwd)/.rustup"
export RUSTUP_INIT_SKIP_PATH_CHECK="yes"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
sh rustup.sh --default-host x86_64-unknown-linux-gnu \
--default-toolchain nightly \
--no-modify-path \
--profile default \
-y
export PATH=${PWD}/.cargo/bin/:${PATH}
# Set up yk.
git clone --recurse-submodules https://github.com/ykjit/yk
cd yk
cargo build --release -p ykcapi -vv
export PATH=$(pwd)/bin:${PATH}
cd ..
# Build yklua with JIT support.
git clone https://github.com/ykjit/yklua
cd yklua
YK_BUILD_TYPE=release make -j $(nproc)
mv src/lua src/yklua
cd ..
# Build plain old Lua as a baseline.
LUA_V=5.4.6
curl https://lua.org/ftp/lua-${LUA_V}.tar.gz -o lua-${LUA_V}.tar.gz
tar zxvf lua-${LUA_V}.tar.gz
mv lua-${LUA_V} lua
cd lua
make -j $(nproc)
cd ..
python3 -m venv venv
./venv/bin/pip install rebench
./venv/bin/pip install toml-cli
}