-
Notifications
You must be signed in to change notification settings - Fork 76
/
install_dependencies.sh
executable file
·102 lines (93 loc) · 4.2 KB
/
install_dependencies.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env bash
platform='unknown'
unamestr=$(uname)
distribution='unknown'
release='unknown'
if [[ "${HAL_DOCKER:-0}" == "1" ]]; then
platform='docker'
distribution=$(lsb_release -is)
release=$(lsb_release -rs)
elif [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
distribution=$(lsb_release -is)
release=$(lsb_release -rs)
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='macOS'
fi
if [[ "$platform" == 'macOS' ]]; then
echo "Executing brew bundle"
brew bundle
pip3 install -r requirements.txt
BREW_PREFIX=$(brew --prefix)
if [ -n "$($SHELL -c 'echo $ZSH_VERSION')" ]; then
grep -Fxq 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' >> ~/.zshrc
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/llvm@14/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/llvm@14/bin:$PATH"' >> ~/.zshrc
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' >> ~/.zshrc
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' ~/.zshrc
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' >> ~/.zshrc
fi
source ~/.zshrc
elif [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then
grep -Fxq 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/qt@5/bin:$PATH"' >> ~/.bash_profile
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/llvm@14/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/llvm@14/bin:$PATH"' >> ~/.bash_profile
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/flex/bin:$PATH"' >> ~/.bash_profile
fi
grep -Fxq 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' ~/.bash_profile
if ! [[ $? -eq 0 ]]; then
echo 'export PATH="$BREW_PREFIX/opt/bison/bin:$PATH"' >> ~/.bash_profile
fi
source ~/.bash_profile
else
echo "Unknown User Shell: abort!"
exit 255
fi
elif [[ "$platform" == 'linux' ]]; then
if [ "$distribution" == 'Ubuntu' ] || [ "$distribution" == 'LinuxMint' ]; then
sudo apt-get update && sudo apt-get install -y build-essential verilator \
lsb-release git cmake pkgconf libboost-all-dev qtbase5-dev \
libpython3-dev ccache autoconf autotools-dev libsodium-dev \
libqt5svg5-dev libqt5svg5* ninja-build lcov gcovr python3-sphinx \
doxygen python3-sphinx-rtd-theme python3-jedi python3-pip \
pybind11-dev python3-pybind11 rapidjson-dev libspdlog-dev libz3-dev z3 \
libreadline-dev apport python3-dateutil \
$additional_deps \
graphviz libomp-dev libsuitesparse-dev # For documentation
elif [[ "$distribution" == "Arch" ]]; then
yay -S --needed base-devel lsb-release git verilator cmake boost-libs pkgconf \
qt5-base python ccache autoconf libsodium qt5-svg ninja lcov \
gcovr python-sphinx doxygen python-sphinx_rtd_theme python-jedi \
python-pip pybind11 rapidjson spdlog graphviz boost \
python-dateutil z3
else
echo "Unsupported Linux distribution: abort!"
exit 255
fi
elif [[ "$platform" == 'docker' ]]; then
# We can assume that we are in a ubuntu container, because of the official Dockerfile in the hal project
apt-get update && apt-get install -y build-essential verilator \
lsb-release git cmake pkgconf libboost-all-dev qtbase5-dev \
libpython3-dev ccache autoconf autotools-dev libsodium-dev \
libqt5svg5-dev libqt5svg5* ninja-build lcov gcovr python3-sphinx \
doxygen python3-sphinx-rtd-theme python3-jedi python3-pip \
pybind11-dev python3-pybind11 python3-dateutil rapidjson-dev \
libspdlog-dev libz3-dev libreadline-dev \
graphviz libomp-dev libsuitesparse-dev # For documentation
fi