This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
activate
89 lines (73 loc) · 3.51 KB
/
activate
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
if [[ `uname -m` != "x86_64" ]]; then
echo "Error: Angelix supports only x86_64"
exit 1
fi
if [[ "$(lsb_release -si)" == "Ubuntu" ]]; then
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
else
echo "WARNING: add your system libraries to C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and LD_LIBRARY_PATH"
fi
export ANGELIX_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# locations of submodules:
export LLVM_GCC_DIR="$ANGELIX_ROOT/build/llvm-gcc4.2-2.9-x86_64-linux"
export LLVM2_DIR="$ANGELIX_ROOT/build/llvm-2.9"
export LLVM3_DIR="$ANGELIX_ROOT/build/llvm-3.7.0.src"
export CLANG_HEADERS="$LLVM3_DIR/tools/clang/lib/Headers/"
export LLVM3_INCLUDE_PATH="$ANGELIX_ROOT/build/include"
export STP_DIR="$ANGELIX_ROOT/build/stp"
export MINISAT_DIR="$ANGELIX_ROOT/build/minisat"
export Z3_DIR="$ANGELIX_ROOT/build/z3"
export Z3_JAR="$Z3_DIR/build/com.microsoft.z3.jar"
export Z3_2_19_DIR="$ANGELIX_ROOT/build/z3_2_19" # used for semfix
export KLEE_DIR="$ANGELIX_ROOT/src/klee"
export KLEE_INCLUDE_PATH="$KLEE_DIR/include"
export KLEE_LIBRARY_PATH="$KLEE_DIR/Release+Asserts/lib"
export KLEE_UCLIBC_DIR="$ANGELIX_ROOT/build/klee-uclibc"
export BEAR_DIR="$ANGELIX_ROOT/build/Bear"
export MAXSMT_DIR="$ANGELIX_ROOT/build/maxsmt-playground"
export MAXSMT_JAR="$MAXSMT_DIR/target/scala-2.10/maxsmt-playground_2.10-1.1.jar"
export SYNTHESIS_DIR="$ANGELIX_ROOT/src/synthesis"
export SYNTHESIS_JAR="$SYNTHESIS_DIR/target/scala-2.10/repair-maxsat-assembly-1.0.jar"
export NSYNTH_JAR="$ANGELIX_ROOT/src/nsynth/target/nsynth-1.0-jar-with-dependencies.jar"
export LOCAL_PERL_ROOT="$ANGELIX_ROOT/build/perl"
# envorinment for building and execution:
export PATH="$LLVM_GCC_DIR/bin/:$PATH"
export PATH="$LLVM2_DIR/Release+Asserts/bin/:$PATH"
export PATH="$KLEE_DIR/Release+Asserts/bin/:$PATH"
export PATH="$Z3_DIR/build/:$PATH"
export PATH="$Z3_2_19_DIR/bin/:$PATH"
export PATH="$ANGELIX_ROOT/src/tools:$PATH"
export PATH="$ANGELIX_ROOT/build/bin/:$PATH"
export ANGELIX_LIBRARY_PATH_KLEE="$ANGELIX_ROOT/build/lib/klee"
export ANGELIX_LIBRARY_PATH_TEST="$ANGELIX_ROOT/build/lib/test"
export ANGELIX_RUNTIME_H="$ANGELIX_ROOT/src/runtime/runtime.h"
# to run tests when linked with runtime:
export LD_LIBRARY_PATH="$KLEE_LIBRARY_PATH:$LD_LIBRARY_PATH"
# because I didn't manage to build stp statically:
export LD_LIBRARY_PATH="$STP_DIR/build/lib:$LD_LIBRARY_PATH"
# for Z3 bindings:
export LD_LIBRARY_PATH="$Z3_DIR/build/:$LD_LIBRARY_PATH"
export PYTHONPATH="$Z3_DIR/build/:$PYTHONPATH"
ulimit -s unlimited
mkdir -p $ANGELIX_ROOT/build
mkdir -p $ANGELIX_ROOT/build/bin
mkdir -p $ANGELIX_ROOT/build/include
# utilities for testing:
dump-ast () {
"$LLVM3_DIR/build/bin/clang" -Xclang -ast-dump -fdiagnostics-color=never -fsyntax-only "$1"
}
instr-rep () {
instrument-repairable "$1" -- "-I$LLVM3_DIR/build/lib/clang/3.7.0/include" -include "$ANGELIX_RUNTIME_H" -D ANGELIX_INSTRUMENTATION
}
instr-sus () {
ANGELIX_EXTRACTED='./extracted' instrument-suspicious "$1" -- "-I$LLVM3_DIR/build/lib/clang/3.7.0/include"
}
# environment for SEMFIX
export SEMFIX_ROOT="$ANGELIX_ROOT/src/semfix"
export PATH="$ANGELIX_ROOT/build/perl/bin${PATH+:}${PATH}"
export PERL5LIB="$ANGELIX_ROOT/build/perl/lib/perl5${PERL5LIB+:}${PERL5LIB}"
export PERL_LOCAL_LIB_ROOT="$ANGELIX_ROOT/build/perl${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}"
export PERL_MB_OPT="--install_base \"$ANGELIX_ROOT/build/perl\""
export PERL_MM_OPT="INSTALL_BASE=$ANGELIX_ROOT/build/perl"