forked from KomaEc/crown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyse.sh
executable file
·42 lines (33 loc) · 920 Bytes
/
analyse.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
#!/bin/bash
set -euf
PROJ_DIR=$(dirname $0)
source $PROJ_DIR/find_entry.sh
RUSTC_PATH=$(rustc --print sysroot)/lib
if [[ "$OSTYPE" == "darwin"* ]]; then
# add rustc lib to dyld path
export DYLD_FALLBACK_LIBRARY_PATH=$RUSTC_PATH
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
export LD_LIBRARY_PATH=$RUSTC_PATH
else
echo "platform $OSTYPE" not supported
exit 1
fi
if [ $# -eq 0 ]; then
echo "Expect folder to the workspace"
exit 1
elif [ $1 = "benchmark" ]; then
echo "Cannot preprocess directly on benchmark"
exit 1
fi
echo "start building crown.."
# cargo build --release
cargo build
# CROWN=$PROJ_DIR/target/release/crown
CROWN=$PROJ_DIR/target/debug/crown
for f in $(find $1 -name "Cargo.toml"); do
BENCH_DIR="$(dirname $f)"
BENCH_NAME="$(basename $BENCH_DIR)"
ENTRY=$(find_entry $BENCH_DIR)
mkdir -p $BENCH_DIR/analysis_results
$CROWN $ENTRY analyse $BENCH_DIR/analysis_results
done