-
Notifications
You must be signed in to change notification settings - Fork 1
/
llvm_install.sh
executable file
·50 lines (50 loc) · 1.73 KB
/
llvm_install.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
47
48
49
50
#!/bin/bash
SVFHOME=$(pwd)
sysOS=`uname -s`
MacLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz"
UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
LLVMHome="llvm-10.0.0.obj"
cd ..
########
# Download LLVM binary
########
if [[ $sysOS == "Darwin" ]]
then
if [ ! -d "$HOME/$LLVMHome" ]
then
echo 'Downloading LLVM binary for MacOS '
curl -L $MacLLVM > llvm-mac.tar.xz
mkdir $HOME/$LLVMHome
echo 'Unzipping LLVM binary for MacOS '
tar -xf "llvm-mac.tar.xz" -C $HOME/$LLVMHome --strip-components 1
rm llvm-mac.tar.xz
fi
elif [[ $sysOS == "Linux" ]]
then
if [ ! -d "$HOME/$LLVMHome" ]
then
echo 'Downloading LLVM binary for Ubuntu'
wget -c $UbuntuLLVM -O llvm-ubuntu.tar.xz
mkdir $HOME/$LLVMHome
echo 'Unzipping LLVM binary for Ubuntu'
tar -xf "llvm-ubuntu.tar.xz" -C $HOME/$LLVMHome --strip-components 1
rm llvm-ubuntu.tar.xz
fi
else
echo 'not support builds in OS other than Ubuntu and Mac'
fi
cd $SVFHOME
cd ..
install_path=$(pwd)
echo "LLVM_DIR=$HOME/$LLVMHome"
if [[ $sysOS == "Darwin" ]]
then
ln -s $install_path/svf-lib/SVF-osx $install_path/SVF
echo "SVF_DIR=$install_path/SVF/"
echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$install_path/SVF/SVF-osx -DLLVM_DIR=$install_path/$LLVMHome"
elif [[ $sysOS == "Linux" ]]
then
ln -s $install_path/svf-lib/SVF-linux $install_path/SVF
echo "SVF_DIR=$install_path/SVF/"
echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$install_path/SVF/SVF-linux -DLLVM_DIR=$install_path/$LLVMHome"
fi