Skip to content

Commit 0993ccc

Browse files
Cleaner Clang install instructions for Debian/Ubuntu.
PiperOrigin-RevId: 592342788
1 parent 08c6af3 commit 0993ccc

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

site/en/install/source.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,36 +74,42 @@ package sources:
7474
Alternatively, you can download and unpack the pre-built
7575
[Clang + LLVM 16](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0).
7676

77-
Below is an example of steps you can take to set up the downloaded
78-
Clang + LLVM 16 binaries:
77+
Below is an example of steps you can take to set up the downloaded Clang + LLVM
78+
16 binaries on Debian/Ubuntu operating systems:
7979

80-
1. Change to the desired destination directory:
81-
```cd <desired directory>```
80+
1. Change to the desired destination directory: `cd <desired directory>`
8281

83-
2. Load and extract an archive file...(suitable to your architecture):
82+
1. Load and extract an archive file...(suitable to your architecture):
8483
<pre class="prettyprint lang-bsh">
85-
<code class="devsite-terminal">
86-
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
84+
<code class="devsite-terminal">wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
8785
</code>
8886
<code class="devsite-terminal">tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
8987
</code>
9088
</pre>
9189

92-
3. Check the obtained Clang + LLVM 16 binaries version:
90+
1. Copy the extracted contents (directories and files) to `/usr` (you may need
91+
sudo permissions, and the correct directory may vary by distribution). This
92+
effectively installs Clang and LLVM, and adds it to the path. You should not
93+
have to replace anything, unless you have a previous installation, in which
94+
case you should replace the files:
9395
<pre class="prettyprint lang-bsh">
94-
<code class="devsite-terminal">
95-
./clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16 --version </code>
96+
<code class="devsite-terminal">cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/* /usr</code>
9697
</pre>
9798

98-
4. Directory `/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16` is
99-
the actual path to your new clang. You can run the `./configure` script or
100-
manually set environment variables `CC` and `BAZEL_COMPILER` to this path.
99+
1. Check the obtained Clang + LLVM 16 binaries version:
100+
<pre class="prettyprint lang-bsh">
101+
<code class="devsite-terminal">clang --version</code>
102+
</pre>
103+
104+
1. Now that `/usr/bin/clang` is the actual path to your new clang. You can run
105+
the `./configure` script or manually set environment variables `CC` and
106+
`BAZEL_COMPILER` to this path.
101107

102108
### Install GPU support (optional, Linux only)
103109

104110
There is *no* GPU support for macOS.
105111

106-
Read the [GPU support](./gpu.md) guide to install the drivers and additional
112+
Read the [GPU support](./pip.md) guide to install the drivers and additional
107113
software required to run TensorFlow on a GPU.
108114

109115
Note: It is easier to set up one of TensorFlow's GPU-enabled [Docker images](#docker_linux_builds).
@@ -204,7 +210,7 @@ Preconfigured Bazel build configs to DISABLE default on features:
204210

205211
#### GPU support
206212

207-
For [GPU support](./gpu.md), set `cuda=Y` during configuration and specify the
213+
For [GPU support](./pip.md), set `cuda=Y` during configuration and specify the
208214
versions of CUDA and cuDNN. If your system has multiple versions of CUDA or
209215
cuDNN installed, explicitly set the version instead of relying on the default.
210216
`./configure` creates symbolic links to your system's CUDA libraries—so if you
@@ -336,8 +342,8 @@ docker run -it -w /tensorflow -v <var>/path/to/tensorflow</var>:/tensorflow -v $
336342
With the source tree set up, build the TensorFlow package within the container's
337343
virtual environment:
338344

339-
1. Optional: Configure the build—this prompts the user to answer build configuration
340-
questions.
345+
1. Optional: Configure the build—this prompts the user to answer build
346+
configuration questions.
341347
2. Build the tool used to create the *pip* package.
342348
3. Run the tool to create the *pip* package.
343349
4. Adjust the ownership permissions of the file for outside the container.
@@ -374,7 +380,7 @@ Docker is the easiest way to build GPU support for TensorFlow since the *host*
374380
machine only requires the
375381
[NVIDIA®&nbsp;driver](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver){:.external}
376382
(the *NVIDIA® CUDA® Toolkit* doesn't have to be installed). Refer to the
377-
[GPU support guide](./gpu.md) and the TensorFlow [Docker guide](./docker.md) to
383+
[GPU support guide](./pip.md) and the TensorFlow [Docker guide](./docker.md) to
378384
set up [nvidia-docker](https://github.com/NVIDIA/nvidia-docker){:.external}
379385
(Linux only).
380386

0 commit comments

Comments
 (0)