-
Notifications
You must be signed in to change notification settings - Fork 9
/
install_deps.sh
executable file
·56 lines (48 loc) · 1.91 KB
/
install_deps.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
51
52
53
54
55
56
#!/bin/bash
function add_llvm_10_apt_source {
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
if [[ $1 == "16.04" ]]; then
echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" | sudo tee -a /etc/apt/sources.list
elif [[ $1 == "18.04" ]]; then
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" | sudo tee -a /etc/apt/sources.list
fi
sudo apt-get -qq update
}
function install_system_packages {
sudo apt install -y graphviz libgraphviz-dev
sudo apt install -y libllvm10 llvm-10-dev
sudo apt install -y clang-10 libclang1-10 libclang-10-dev libclang-common-10-dev
}
function install_python_packages {
CUDA=$1
python3 -m pip install torch==1.5.0+${CUDA} -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install torchvision==0.6.0
python3 -m pip install torch-scatter==2.0.5 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
python3 -m pip install torch-sparse==0.6.7 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
python3 -m pip install torch-cluster==1.5.7 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
python3 -m pip install torch-spline-conv==1.2.0 -f https://pytorch-geometric.com/whl/torch-1.5.0+${CUDA}.html
if [[ "$CUDA" != "cpu" ]]; then
python3 -m pip install dgl-$CUDA
else
python3 -m pip install dgl
fi
python3 -m pip install tensorflow==2.2.2
}
if [ $# -eq 0 ]
then
echo "Usage: install_deps {cpu|cu92|cu100|cu101}"
exit 1
fi
if [[ $(lsb_release -rs) == "16.04" ]] || [[ $(lsb_release -rs) == "18.04" ]]; then
echo "OS supported."
if ! grep -q 'llvm-toolchain-.*-10' /etc/apt/sources.list; then
add_llvm_10_apt_source $(lsb_release -rs)
fi
elif [[ $(lsb_release -rs) == "20.04" ]]; then
echo "OS supported."
else
echo "Non-supported OS. You have to install the packages manually."
exit 1
fi
install_system_packages
install_python_packages $1