-
Notifications
You must be signed in to change notification settings - Fork 7
/
deps.sh
executable file
·103 lines (90 loc) · 2.41 KB
/
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
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
103
#!/bin/bash
## =================================================================
## TPL PACKAGE INSTALLATION
##
## This script will install all packages needed to run TPL.
##
## Supported environments:
## * Ubuntu 18.04
## * MacOS
## =================================================================
main() {
set -o errexit
echo "PACKAGES WILL BE INSTALLED. THIS MAY BREAK YOUR EXISTING TOOLCHAIN."
echo "YOU ACCEPT ALL RESPONSIBILITY BY PROCEEDING."
read -p "Proceed? [Y/n] : " yn
case $yn in
Y|y) install ;;
*) ;;
esac
echo "Script complete."
}
install() {
set -x
UNAME=$(uname | tr "[:lower:]" "[:upper:]" )
case $UNAME in
DARWIN) install_mac ;;
LINUX)
version=$(cat /etc/os-release | grep VERSION_ID | cut -d '"' -f 2)
case $version in
20.04) install_linux ;;
19.10) install_linux ;;
19.04) install_linux ;;
18.10) install_linux ;;
18.04) install_linux ;;
*) give_up ;;
esac
;;
*) give_up ;;
esac
}
give_up() {
set +x
echo "Unsupported distribution '$UNAME'"
echo "Please contact our support team for additional help."
echo "Be sure to include the contents of this message."
echo "Platform: $(uname -a)"
echo
echo "https://github.com/pmenon/tpl/issues"
echo
exit 1
}
install_mac() {
# Install Homebrew.
if test ! $(which brew); then
echo "Installing Homebrew (https://brew.sh/)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update Homebrew.
brew update
# Install packages.
brew ls --versions cmake || brew install cmake
brew ls --versions coreutils || brew install coreutils
brew ls --versions doxygen || brew install doxygen
brew ls --versions git || brew install git
(brew ls --versions llvm@11 | grep 11) || brew install llvm@11
brew ls --versions jemalloc || brew install jemalloc
brew ls --versions tbb || brew install tbb
brew ls --versions ninja || brew install ninja
}
install_linux() {
# Update apt-get.
apt-get -y update
# Install packages.
apt-get -y install \
build-essential \
clang-tidy-11 \
clang-format-11 \
cmake \
doxygen \
git \
lld \
g++-10 \
clang-11 \
llvm-11 \
libjemalloc-dev \
libtbb-dev \
ninja-build \
lcov
}
main "$@"