Skip to content

Commit eb9dfd6

Browse files
authored
Merge pull request #232 from mrdaliri/requirements-installer
Requirements installer
2 parents 1e695f1 + 42c785c commit eb9dfd6

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

Dockerfiles/install-ubuntu.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,7 @@ for key in "$@"; do
1313
done
1414

1515
# install requirements
16-
export DEBIAN_FRONTEND=noninteractive
17-
apt-get -y update
18-
apt-get -y install \
19-
cmake \
20-
g++-7 \
21-
git \
22-
python3-dev \
23-
python3-numpy \
24-
sudo \
25-
wget
26-
27-
# install bazel
28-
export BAZEL_VERSION=${BAZEL_VERSION:-`cat ./tensorflow_cc/Dockerfiles/BAZEL_VERSION`}
29-
apt-get -y install pkg-config zip g++ zlib1g-dev unzip python
30-
bazel_installer=bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
31-
wget -P /tmp https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${bazel_installer}
32-
chmod +x /tmp/${bazel_installer}
33-
/tmp/${bazel_installer}
34-
rm /tmp/${bazel_installer}
16+
./tensorflow_cc/ubuntu-requirements.sh
3517

3618
if $cuda; then
3719
# install libcupti

ubuntu-requirements.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [[ $UID != 0 ]]; then
5+
echo "Please run this script with sudo:"
6+
echo "sudo $0 $*"
7+
exit 1
8+
fi
9+
10+
if [[ "$OSTYPE" == "linux-gnu" ]]; then
11+
# install requirements
12+
export DEBIAN_FRONTEND=noninteractive
13+
apt-get -y update
14+
apt-get -y install \
15+
cmake \
16+
g++-7 \
17+
git \
18+
python3-dev \
19+
python3-numpy \
20+
sudo \
21+
wget
22+
23+
# install bazel
24+
export BAZEL_VERSION=${BAZEL_VERSION:-`cat $(dirname "$0")/Dockerfiles/BAZEL_VERSION`}
25+
apt-get -y install pkg-config zip g++ zlib1g-dev unzip python
26+
bazel_installer=bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
27+
wget -P /tmp https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${bazel_installer}
28+
chmod +x /tmp/${bazel_installer}
29+
/tmp/${bazel_installer}
30+
rm /tmp/${bazel_installer}
31+
32+
else
33+
echo "This script supports only Debian-based operating systems (like Ubuntu)." \
34+
"Please consult README file for manual installation on your '$OSTYPE' OS."
35+
exit 1
36+
fi

0 commit comments

Comments
 (0)