-
Notifications
You must be signed in to change notification settings - Fork 183
/
ubuntu-requirements.sh
executable file
·37 lines (33 loc) · 1.07 KB
/
ubuntu-requirements.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
#!/bin/bash
set -e
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# install requirements
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y install \
cmake \
g++-9 \
git \
python3-dev \
python3-numpy \
sudo \
wget
# install bazel
export BAZEL_VERSION=${BAZEL_VERSION:-`cat $(dirname "$0")/Dockerfiles/BAZEL_VERSION`}
apt-get -y install pkg-config zip g++ zlib1g-dev unzip python3
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
bazel_installer=bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
wget -P /tmp https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${bazel_installer}
chmod +x /tmp/${bazel_installer}
/tmp/${bazel_installer}
rm /tmp/${bazel_installer}
else
echo "This script supports only Debian-based operating systems (like Ubuntu)." \
"Please consult README file for manual installation on your '$OSTYPE' OS."
exit 1
fi