Skip to content

Commit d6cfd23

Browse files
committed
SVF script
1 parent eb5cb5f commit d6cfd23

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tool/svf_install.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
set -exo pipefail
4+
5+
export SCRIPT_ROOT=$(cd "$(dirname "$(realpath "$0")")" && pwd)
6+
export TMPDIR=$HOME/temp
7+
export PREFIX=$TMPDIR/install
8+
export CC=$PREFIX/bin/clang
9+
export CXX=$PREFIX/bin/clang++
10+
11+
SVF_VERSION="d7f7f6884a6df01dc913d2ec47262bb6a55a3a63"
12+
SVF_URL="https://github.com/SVF-tools/SVF.git"
13+
14+
SVF_INSTALL_DIR=$(realpath $PREFIX)
15+
16+
mkdir -p $TMPDIR
17+
mkdir -p $SVF_INSTALL_DIR
18+
WORKDIR=$(mktemp -d)
19+
20+
trap 'rm -rf ${WORKDIR}' EXIT
21+
22+
cd $WORKDIR
23+
24+
git clone $SVF_URL && cd SVF
25+
git checkout $SVF_VERSION
26+
27+
# -DSVF_WARN_AS_ERROR=OFF, This option is required in newer SVF
28+
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -GNinja \
29+
-DBUILD_SHARED_LIBS=OFF \
30+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
31+
-DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX \
32+
-DCMAKE_INSTALL_PREFIX=$PREFIX -DLLVM_DIR=$PREFIX \
33+
-DSVF_WARN_AS_ERROR=OFF
34+
35+
cmake --build build && cmake --install build
36+
# The following commands are necessary for some versions
37+
install -m 0755 build/include/Util/config.h $SVF_INSTALL_DIR/include/svf/Util

0 commit comments

Comments
 (0)