Skip to content

Instantly share code, notes, and snippets.

@pichuan
Last active May 4, 2018 06:13
Show Gist options
  • Save pichuan/7928d101a730c03167b6d80c9c3c58ac to your computer and use it in GitHub Desktop.
Save pichuan/7928d101a730c03167b6d80c9c3c58ac to your computer and use it in GitHub Desktop.
Experimental build-prereq.sh on CentOS 6
#!/bin/bash
set -euo pipefail
echo ========== Load config settings.
source settings.sh
################################################################################
# Misc. setup
################################################################################
note_build_stage "Install the runtime packages"
./run-prereq.sh
note_build_stage "Update package list"
sudo yum -qq -y update
note_build_stage "Install development packages"
sudo yum -y install pkg-config zip g++ zlib1g-dev unzip curl git
################################################################################
# Java
################################################################################
note_build_stage "Install Java and friends"
# Java is available on Kokoro, so we add this cutout.
if ! java -version 2>&1 | fgrep "1.8"; then
echo "No Java 8, will install."
sudo yum install -y software-properties-common debconf-utils
# Debian needs authentication.
# (http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html)
[[ $(lsb_release -d | grep 'Debian') ]] && \
sudo yum install -y gnupg dirmngr && \
sudo -H apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
#sudo add-apt-repository -y ppa:webupd8team/java
sudo yum -qq -y update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo yum install -y oracle-java8-installer
sudo yum -y install ca-certificates-java
sudo update-ca-certificates -f
else
echo "Java 8 found, will not reinstall."
fi
################################################################################
# bazel
################################################################################
################################################################################
# CLIF
################################################################################
note_build_stage "Install CLIF binary"
sudo mkdir -p /usr/local/clif/bin
sudo ln -sf /usr/local/bin/pyclif /usr/local/clif/bin/pyclif
sudo ln -sf /usr/local/bin/pyclif_proto /usr/local/clif/bin/pyclif_proto
################################################################################
# TensorFlow
################################################################################
note_build_stage "Download and configure TensorFlow sources"
sudo yum install -y python-argparse
(cd .. &&
git clone https://github.com/tensorflow/tensorflow &&
cd tensorflow &&
git checkout v1.7.0 &&
echo | PYTHON_BIN_PATH=/usr/local/bin/python2.7 ./configure)
note_build_stage "build-prereq.sh complete"
/usr/local/bin/bazel version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment