Skip to content

Commit 999ea48

Browse files
Merge pull request #2127 from mohantym:patch-4
PiperOrigin-RevId: 478903684
2 parents d195405 + 21cc941 commit 999ea48

File tree

2 files changed

+58
-87
lines changed

2 files changed

+58
-87
lines changed

site/en/install/source.md

Lines changed: 44 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,24 @@ git checkout <em>branch_name</em> # r2.2, r2.3, etc.
8787
</pre>
8888

8989

90-
## Configure the build
90+
## Optional: Configure the build
9191

92-
Configure your system build by running the `./configure` at the root of your
93-
TensorFlow source tree. This script prompts you for the location of TensorFlow
94-
dependencies and asks for additional build configuration options (compiler
95-
flags, for example).
92+
TensorFlow builds are configured by the `.bazelrc` file in the repository's
93+
root directory. The `./configure` or `./configure.py` scripts can be used to
94+
adjust common settings.
95+
96+
If you need to change the configuration, run the `./configure` script from
97+
the repository's root directory. This script will prompt you for the location of
98+
TensorFlow dependencies and asks for additional build configuration options
99+
(compiler flags, for example). Refer to the _Sample session_ section for
100+
details.
96101

97102
<pre class="devsite-terminal devsite-click-to-copy">
98103
./configure
99104
</pre>
100105

101-
If using a virtual environment, `python configure.py` prioritizes paths
106+
There is also a python version of this script, `./configure.py`. If using a
107+
virtual environment, `python configure.py` prioritizes paths
102108
within the environment, whereas `./configure` prioritizes paths outside
103109
the environment. In both cases you can change the default.
104110

@@ -111,65 +117,43 @@ session may differ):
111117
<h4 class="showalways">View sample configuration session</h4>
112118
<pre class="devsite-terminal">
113119
./configure
114-
You have bazel 3.0.0 installed.
115-
Please specify the location of python. [Default is /usr/bin/python3]:
120+
You have bazel 5.0.0 installed.
121+
Please specify the location of python. [Default is /Library/Frameworks/Python.framework/Versions/3.9/bin/python3]:
116122

117123

118124
Found possible Python library paths:
119-
/usr/lib/python3/dist-packages
120-
/usr/local/lib/python3.6/dist-packages
121-
Please input the desired Python library path to use. Default is [/usr/lib/python3/dist-packages]
122-
123-
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]:
124-
No OpenCL SYCL support will be enabled for TensorFlow.
125+
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
126+
Please input the desired Python library path to use. Default is [/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages]
125127

126-
Do you wish to build TensorFlow with ROCm support? [y/N]:
128+
Do you wish to build TensorFlow with ROCm support? [y/N]: n
127129
No ROCm support will be enabled for TensorFlow.
128130

129-
Do you wish to build TensorFlow with CUDA support? [y/N]: Y
130-
CUDA support will be enabled for TensorFlow.
131-
132-
Do you wish to build TensorFlow with TensorRT support? [y/N]:
133-
No TensorRT support will be enabled for TensorFlow.
134-
135-
Found CUDA 10.1 in:
136-
/usr/local/cuda-10.1/targets/x86_64-linux/lib
137-
/usr/local/cuda-10.1/targets/x86_64-linux/include
138-
Found cuDNN 7 in:
139-
/usr/lib/x86_64-linux-gnu
140-
/usr/include
141-
131+
Do you wish to build TensorFlow with CUDA support? [y/N]: n
132+
No CUDA support will be enabled for TensorFlow.
142133

143-
Please specify a list of comma-separated CUDA compute capabilities you want to build with.
144-
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Each capability can be specified as "x.y" or "compute_xy" to include both virtual and binary GPU code, or as "sm_xy" to only include the binary code.
145-
Please note that each additional compute capability significantly increases your build time and binary size, and that TensorFlow only supports compute capabilities >= 3.5 [Default is: 3.5,7.0]: 6.1
134+
Do you wish to download a fresh release of clang? (Experimental) [y/N]: n
135+
Clang will not be downloaded.
146136

137+
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]: n
147138

148-
Do you want to use clang as CUDA compiler? [y/N]:
149-
nvcc will be used as CUDA compiler.
150139

151-
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
152-
153-
154-
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]:
155-
156-
157-
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]:
140+
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
158141
Not configuring the WORKSPACE for Android builds.
159142

143+
Do you wish to build TensorFlow with iOS support? [y/N]: n
144+
No iOS support will be enabled for TensorFlow.
145+
160146
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
161147
--config=mkl # Build with MKL support.
148+
--config=mkl_aarch64 # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
162149
--config=monolithic # Config for mostly static monolithic build.
163-
--config=ngraph # Build with Intel nGraph support.
164150
--config=numa # Build with NUMA support.
165151
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
166-
--config=v2 # Build TensorFlow 2.x instead of 1.x.
152+
--config=v1 # Build with TensorFlow 1 API instead of TF 2 API.
167153
Preconfigured Bazel build configs to DISABLE default on features:
168-
--config=noaws # Disable AWS S3 filesystem support.
169154
--config=nogcp # Disable GCP support.
170-
--config=nohdfs # Disable HDFS support.
171155
--config=nonccl # Disable NVIDIA NCCL support.
172-
Configuration finished
156+
173157
</pre>
174158
</section>
175159

@@ -203,42 +187,34 @@ There are some preconfigured build configs available that can be added to the
203187
* `--config=mkl` —Support for the
204188
[Intel® MKL-DNN](https://github.com/intel/mkl-dnn){:.external}.
205189
* `--config=monolithic` —Configuration for a mostly static, monolithic build.
206-
* `--config=v1` —Build TensorFlow 1.x instead of 2.x.
207190

208-
Note: Starting with TensorFlow 1.6, binaries use AVX instructions which may not
209-
run on older CPUs.
210191

192+
## Build and install the pip package
211193

212-
## Build the pip package
194+
The pip package is build in two steps. A `bazel build` commands creates a
195+
"package-builder" program. You then run the package-builder to create the
196+
package.
213197

214-
### TensorFlow 2.x
198+
### Build the package-builder
215199

216-
[Install Bazel](https://docs.bazel.build/versions/master/install.html) and use
217-
`bazel build` to create the TensorFlow 2.x package with *CPU-only* support:
200+
Use `bazel build` to create the TensorFlow 2.x package-builder with *CPU-only*
201+
support:
218202

219203
<pre class="devsite-terminal devsite-click-to-copy">
220204
bazel build [--config=option] //tensorflow/tools/pip_package:build_pip_package
221205
</pre>
222206

223-
Note: GPU support can be enabled with `cuda=Y` during the `./configure` stage.
207+
#### GPU support
224208

225-
### GPU support
209+
Note: GPU support can be enabled with `cuda=Y` during the `./configure` stage.
226210

227-
To build a TensorFlow package builder with GPU support:
211+
To build a TensorFlow package-builder with GPU support:
228212

229213
<pre class="devsite-terminal devsite-click-to-copy">
230214
bazel build --config=cuda [--config=option] //tensorflow/tools/pip_package:build_pip_package
231215
</pre>
232216

233-
### TensorFlow 1.x
234-
235-
To build an older TensorFlow 1.x package, use the `--config=v1` option:
236-
237-
<pre class="devsite-terminal devsite-click-to-copy">
238-
bazel build --config=v1 [--config=option] //tensorflow/tools/pip_package:build_pip_package
239-
</pre>
240-
241-
### Bazel build options
217+
#### Bazel build options
242218

243219
Refer to the Bazel
244220
[command-line reference](https://bazel.build/reference/command-line-reference)
@@ -248,7 +224,7 @@ for
248224
Building TensorFlow from source can use a lot of RAM. If your system is
249225
memory-constrained, limit Bazel's RAM usage with: `--local_ram_resources=2048`.
250226

251-
The [official TensorFlow packages](./pip.md) are built with a GCC 7.3
227+
The [official TensorFlow packages](./pip.md) are built with a GCC
252228
toolchain that complies with the manylinux2010 package standard.
253229

254230
For GCC 5 and later, compatibility with the older ABI can be built using:
@@ -332,14 +308,14 @@ docker run -it -w /tensorflow -v <var>/path/to/tensorflow</var>:/tensorflow -v $
332308
With the source tree set up, build the TensorFlow package within the container's
333309
virtual environment:
334310

335-
1. Configure the build—this prompts the user to answer build configuration
311+
1. Optional: Configure the build—this prompts the user to answer build configuration
336312
questions.
337313
2. Build the tool used to create the *pip* package.
338314
3. Run the tool to create the *pip* package.
339315
4. Adjust the ownership permissions of the file for outside the container.
340316

341317
<pre class="devsite-disable-click-to-copy prettyprint lang-bsh">
342-
<code class="devsite-terminal tfo-terminal-root">./configure # answer prompts or use defaults</code>
318+
<code class="devsite-terminal tfo-terminal-root">./configure # if necessary</code>
343319

344320
<code class="devsite-terminal tfo-terminal-root">bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package</code>
345321

@@ -389,7 +365,7 @@ Then, within the container's virtual environment, build the TensorFlow package
389365
with GPU support:
390366

391367
<pre class="devsite-disable-click-to-copy prettyprint lang-bsh">
392-
<code class="devsite-terminal tfo-terminal-root">./configure # answer prompts or use defaults</code>
368+
<code class="devsite-terminal tfo-terminal-root">./configure # if necessary</code>
393369

394370
<code class="devsite-terminal tfo-terminal-root">bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package</code>
395371

site/en/install/source_windows.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ Key Point: If you're having build problems on the latest development branch, try
9292
a release branch that is known to work.
9393

9494

95-
## Configure the build
95+
## Optional: Configure the build
9696

97-
Configure your system build by running the following at the root of your
98-
TensorFlow source tree:
97+
TensorFlow builds are configured by the `.bazelrc` file in the respoitory's
98+
root directory. The `./configure` or `./configure.py` scripts can be used to
99+
adjust common settings.
100+
101+
If you need to change the configuration, run the `./configure` script from
102+
the repository's root directory.
99103

100104
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
101105
python ./configure.py
@@ -151,34 +155,25 @@ version instead of relying on the default. `./configure.py` creates symbolic
151155
links to your system's CUDA libraries—so if you update your CUDA library paths,
152156
this configuration step must be run again before building.
153157

154-
Note: Starting with TensorFlow 1.6, binaries use AVX instructions which may not
155-
run on older CPUs.
156-
157158
Warning: TF-TRT Windows support is provided experimentally. No guarantee is made
158159
regarding functionality or engineering support. Use at your own risk.
159160

160-
## Build the pip package
161+
## Build and install the pip package
162+
163+
The pip package gets built in two steps. A `bazel build` commands creates a
164+
"package-builder" program. You then run the package-builder to create the
165+
package.
161166

162-
### TensorFlow 2.x
167+
### Build the package-builder
163168

164169
tensorflow:master repo has been updated to build 2.x by default.
165170
[Install Bazel](https://docs.bazel.build/versions/master/install.html) and use
166-
`bazel build ` to create the TensorFlow package.
171+
`bazel build ` to create the TensorFlow package-builder.
167172

168173
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
169174
bazel build //tensorflow/tools/pip_package:build_pip_package
170175
</pre>
171176

172-
173-
### TensorFlow 1.x
174-
175-
To build the 1.x version of TensorFlow from master, use
176-
`bazel build --config=v1` to create a TensorFlow 1.x package.
177-
178-
<pre class="devsite-terminal tfo-terminal-windows devsite-click-to-copy">
179-
bazel build --config=v1 //tensorflow/tools/pip_package:build_pip_package
180-
</pre>
181-
182177
#### CPU-only
183178

184179
Use `bazel` to make the TensorFlow package builder with CPU-only support:

0 commit comments

Comments
 (0)