Skip to content

Instantly share code, notes, and snippets.

@ravnoor
Last active August 29, 2017 19:46
Show Gist options
  • Save ravnoor/1a9d107743e35f5d857a235663e8b071 to your computer and use it in GitHub Desktop.
Save ravnoor/1a9d107743e35f5d857a235663e8b071 to your computer and use it in GitHub Desktop.
Build tensorflow from source on Ubuntu 14.04
conda create -n tf-keras python=2.7
pip install numpy
wget https://github.com/bazelbuild/bazel/releases/download/0.5.2/bazel-0.5.2-installer-linux-x86_64.sh
# 0.5.4 incompatibility issues
chmod +x bazel-0.5.2-installer-linux-x86_64.sh
HOME=/00_toolbox ./bazel-0.5.2-installer-linux-x86_64.sh --prefix=/00_toolbox/bazel-build
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout r1.2
HOME=/host/silius/local_raid/ravnoor/00_toolbox ./configure
export PATH=/00_toolbox/bazel-build/bin:$PATH
HOME=/00_toolbox bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package
HOME=/00_toolbox bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-1.2.1-cp27-cp27mu-linux_x86_64.whl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment