Copy protobuf header files and Eigen to the pip package.
Clarify the documentation on how to build using bazel. Fixes #1270. Change: 115701645
This commit is contained in:
parent
96118731cb
commit
f417134a5a
tensorflow
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user