Copy protobuf header files and Eigen to the pip package.

Clarify the documentation on how to build using bazel.
Fixes .
Change: 115701645
This commit is contained in:
Manjunath Kudlur 2016-02-26 13:16:46 -08:00 committed by TensorFlower Gardener
parent 96118731cb
commit f417134a5a
2 changed files with 16 additions and 4 deletions
tensorflow
g3doc/how_tos/adding_an_op
tools/pip_package

View File

@ -145,8 +145,8 @@ $ g++ -std=c++11 -shared zero_out.cc -o zero_out.so \
### With TensorFlow source installation
If you have TensorFlow sources installed, you can make use of TensorFlow's build
system to compile your Op. The following Bazel build rule would build
`zero_out.so`.
system to compile your Op. Place a BUILD file with following Bazel build rule in
the [`tensorflow/core/user_ops`][user_ops] directory.
```python
cc_binary(
@ -164,6 +164,12 @@ cc_binary(
)
```
Run the following command to build `zero_out.so`.
```bash
$ bazel build -c opt //tensorflow/core/user_ops:zero_out.so
```
## Using the Op in Python
TensorFlow Python API provides the

View File

@ -35,8 +35,14 @@ function main() {
cp -R \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/{tensorflow,external} \
${TMPDIR}
# TODO: We should have cleaner solution for this after 0.7 release
rm -rf ${TMPDIR}/external/eigen_archive
# protobuf pip package doesn't ship with header files. Copy the headers
# over so user defined ops can be compiled.
rsync --include "*/" --include "*.h" --exclude "*" --prune-empty-dirs -a \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/google \
${TMPDIR}
rsync -a \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/third_party/eigen3 \
${TMPDIR}/third_party
cp tensorflow/tools/pip_package/MANIFEST.in ${TMPDIR}
cp tensorflow/tools/pip_package/README ${TMPDIR}