Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 7699877

Browse files
authored
Merge pull request #1202 from saatviks/saatviks_packagesimprovements
Improvements to 'packages.sh'
2 parents e20d519 + 23ce712 commit 7699877

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

script/installation/packages.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ function install_protobuf3.4.0() {
5555
echo "Only Ubuntu and Fedora is supported currently!"
5656
return 0
5757
fi
58-
CWD=`pwd`
59-
cd $TMPDIR
6058
wget -O protobuf-cpp-3.4.0.tar.gz https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-cpp-3.4.0.tar.gz
6159
tar -xzf protobuf-cpp-3.4.0.tar.gz
6260
cd protobuf-3.4.0
6361
./autogen.sh && ./configure && make -j4 && sudo make install && sudo ldconfig
64-
# Do cleanup
65-
cd $CWD
62+
cd ..
63+
# Cleanup
64+
rm -rf protobuf-3.4.0 protobuf-cpp-3.4.0.tar.gz
6665
}
6766

6867
# Utility function for installing tensorflow components of python/C++
@@ -72,14 +71,16 @@ function install_tf() {
7271
LinkerConfigCmd=$3
7372
TARGET_DIRECTORY="/usr/local"
7473
# Install Tensorflow Python Binary
75-
sudo pip3 install --upgrade ${TFBinaryURL}
74+
sudo -E pip3 install --upgrade ${TFBinaryURL}
7675

7776
# Install C-API
7877
TFCApiURL="https://storage.googleapis.com/tensorflow/libtensorflow/${TFCApiFile}"
7978
wget -O $TFCApiFile $TFCApiURL
80-
sudo tar -C $TARGET_DIRECTORY -xzf $TFCApiFile
79+
sudo tar -C $TARGET_DIRECTORY -xzf $TFCApiFile || true
8180
# Configure the Linker
8281
eval $LinkerConfigCmd
82+
# Cleanup
83+
rm -rf ${TFCApiFile}
8384
}
8485

8586
## ------------------------------------------------
@@ -333,6 +334,7 @@ elif [ "$DISTRO" = "DARWIN" ]; then
333334
brew install [email protected]
334335
brew install postgresql
335336
brew install curl
337+
brew install wget
336338
brew install python
337339
brew upgrade python
338340
# Brew installs correct version of Protobuf(3.5.1 >= 3.4.0)

0 commit comments

Comments
 (0)