File tree 1 file changed +19
-3
lines changed
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" \
123
123
//tensorflow:libtensorflow.so \
124
124
//tensorflow:libtensorflow_cc.so \
125
125
//tensorflow:libtensorflow_framework.so \
126
- //tensorflow:install_headers \
127
- //tensorflow/tools/pip_package:build_pip_package
126
+ //tensorflow:install_headers
128
127
```
129
128
130
129
You can use the following command to check all available rules in a specific top directory:
@@ -143,12 +142,29 @@ Note:
143
142
7 . Flags for Intel: ` --copt=-mavx --copt=-mavx2 ` .
144
143
8 . Rebuild with ` --config=monolithic ` if you want to compile all TensorFlow C++ code into a single shared object.
145
144
146
- ** optional **
145
+ ** Optional 1: ** Test
147
146
``` bash
148
147
bazel test --jobs=4 --cxxopt=" -D_GLIBCXX_USE_CXX11_ABI=0" -c opt \
149
148
//tensorflow/tools/lib_package:libtensorflow_test
150
149
```
151
150
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
+
152
168
### 2. Install protobuf
153
169
154
170
1 . Check the version of protobuf that is supported by TensorFlow
You can’t perform that action at this time.
0 commit comments