Skip to content

Instantly share code, notes, and snippets.

@xiangjjj
Last active June 19, 2017 19:45
Show Gist options
  • Save xiangjjj/6eccc7cb0083313f76448106a5c896f2 to your computer and use it in GitHub Desktop.
Save xiangjjj/6eccc7cb0083313f76448106a5c896f2 to your computer and use it in GitHub Desktop.
# get tensorflow
$ cd $HOME
$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow/
# (optional) select a branch, e.g., r1.2
$ git checkout r1.2
# without this step we stay at the master branch, equivelant to below
$ git checkout master
# clean previous bazel files
$ bazel clean
# configure installation
$ ./configure
# build installation package
# 1. To build with GPU support:
$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
# 2. To build with CPU support only:
$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
# build wheel file
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Thu Mar 16 21:06:02 NDT 2017 : === Building wheel
warning: no files found matching '*.dll' under directory '*'
warning: no files found matching '*.lib' under directory '*'
~/tensorflow
Thu Mar 16 21:07:15 NDT 2017 : === Output wheel file is in: /tmp/tensorflow_pkg
# install from pip (the .whl file name could be different)
$ pip install --user /tmp/tensorflow_pkg/tensorflow-1.0.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