File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,7 @@ bazel build --jobs=4 --local_ram_resources="HOST_RAM*.50" \
123123 //tensorflow:libtensorflow.so \
124124 //tensorflow:libtensorflow_cc.so \
125125 //tensorflow:libtensorflow_framework.so \
126- //tensorflow:install_headers \
127- //tensorflow/tools/pip_package:build_pip_package
126+ //tensorflow:install_headers
128127```
129128
130129You can use the following command to check all available rules in a specific top directory:
@@ -143,12 +142,29 @@ Note:
1431427 . Flags for Intel: ` --copt=-mavx --copt=-mavx2 ` .
1441438 . Rebuild with ` --config=monolithic ` if you want to compile all TensorFlow C++ code into a single shared object.
145144
146- ** optional **
145+ ** Optional 1: ** Test
147146``` bash
148147bazel test --jobs=4 --cxxopt=" -D_GLIBCXX_USE_CXX11_ABI=0" -c opt \
149148 //tensorflow/tools/lib_package:libtensorflow_test
150149```
151150
151+ ** Optional 2:**
152+ Additionally, you can also build TensorFlow wheel file (.whl) which can then be used to install TensorFlow by pip:
153+
154+ ``` bash
155+ # Build process
156+ bazel build --config=opt -c opt //tensorflow/tools/pip_package:build_pip_package
157+
158+ # Create a wheel file
159+ ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
160+
161+ # Install TensorFlow using the wheel file
162+ pip install /tmp/tensorflow_pkg/tensorflow-2.3.0-cp38-cp38-linux_x86_64.whl
163+
164+ # Try importing TensorFlow and test it
165+ python -c " import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
166+ ```
167+
152168### 2. Install protobuf
153169
1541701 . Check the version of protobuf that is supported by TensorFlow
You can’t perform that action at this time.
0 commit comments