Skip to content

Commit e7c0645

Browse files
authored
Merge pull request #34162 from compnerd/documentation
README: merge manually from upstream
2 parents b0f92dc + 3d6f989 commit e7c0645

File tree

1 file changed

+61
-8
lines changed

1 file changed

+61
-8
lines changed

README.md

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Swift for TensorFlow
1+
<img src="https://swift.org/assets/images/swift.svg" alt="Swift logo" height="70" >
2+
3+
# Swift Programming Language
24

3-
| OS | CI platform | x86_64 | GPU |
4-
|---|:---:|:---:|:---:|
5-
| **macOS** | Google Kokoro | ![Build Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/macos-swift-tf-release.svg) | - |
6-
| **Ubuntu 16.04** | Swift.org CI | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow) | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu) |
75

86
| | **Architecture** | **main** | **Package** |
97
|---|:---:|:---:|:---:|
@@ -34,10 +32,8 @@
3432
|---|:---:|:---:|
3533
|**[Ubuntu 18.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_18_04_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow)|
3634
|**[macOS 10.13](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_macos_high_sierra_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow)|
37-
|**[Ubuntu 18.04 (GPU)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_18_04_tensorflow_gpu.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow-gpu)|
3835

3936
<!-- SWIFT_ENABLE_TENSORFLOW -->
40-
4137
Swift for TensorFlow is a new programming language for TensorFlow. It is a copy of the compiler for the [Swift Programming Language](https://swift.org) that adds first-class compiler and language support for machine learning.
4238

4339
This repository covers the compiler and standard libraries. Please visit the [documentation repository](https://github.com/tensorflow/swift) for more information about the project, including a project overview, technical details, and guidelines for contributing. To use Swift for TensorFlow out of the box, follow the [installation instructions](https://github.com/tensorflow/swift/blob/master/Installation.md). To build from source, follow the instructions below.
@@ -93,14 +89,15 @@ We also have an [FAQ](/docs/HowToGuides/FAQ.md) that answers common questions.
9389

9490
[Getting Started guide]: /docs/HowToGuides/GettingStarted.md
9591

92+
<!-- SWIFT_ENABLE_TENSORFLOW -->
9693
### Swift For TensorFlow Toolchains
9794

9895
#### Building
9996

10097
Swift for TensorFlow toolchains are created using the script
10198
[build-toolchain-tensorflow](https://github.com/apple/swift/blob/tensorflow/utils/build-toolchain-tensorflow).
10299
This script is used by swift.org's CI to produce snapshots and can allow for one to
103-
locally reproduce such builds for development or distribution purposes. A typical
100+
locally reproduce such builds for development or distribution purposes. A typical
104101
invocation looks like the following:
105102

106103
```
@@ -147,6 +144,62 @@ compiler crashes.
147144

148145
2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.
149146

147+
<!-- SWIFT_ENABLE_TENSORFLOW END -->
148+
### Swift Toolchains
149+
150+
#### Building
151+
152+
Swift toolchains are created using the script
153+
[build-toolchain](https://github.com/apple/swift/blob/main/utils/build-toolchain). This
154+
script is used by swift.org's CI to produce snapshots and can allow for one to
155+
locally reproduce such builds for development or distribution purposes. A typical
156+
invocation looks like the following:
157+
158+
```
159+
$ ./swift/utils/build-toolchain $BUNDLE_PREFIX
160+
```
161+
162+
where ``$BUNDLE_PREFIX`` is a string that will be prepended to the build
163+
date to give the bundle identifier of the toolchain's ``Info.plist``. For
164+
instance, if ``$BUNDLE_PREFIX`` was ``com.example``, the toolchain
165+
produced will have the bundle identifier ``com.example.YYYYMMDD``. It
166+
will be created in the directory you run the script with a filename
167+
of the form: ``swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz``.
168+
169+
Beyond building the toolchain, ``build-toolchain`` also supports the
170+
following (non-exhaustive) set of useful options::
171+
172+
- ``--dry-run``: Perform a dry run build. This is off by default.
173+
- ``--test``: Test the toolchain after it has been compiled. This is off by default.
174+
- ``--distcc``: Use distcc to speed up the build by distributing the c++ part of
175+
the swift build. This is off by default.
176+
177+
More options may be added over time. Please pass ``--help`` to
178+
``build-toolchain`` to see the full set of options.
179+
180+
#### Installing into Xcode
181+
182+
On macOS if one wants to install such a toolchain into Xcode:
183+
184+
1. Untar and copy the toolchain to one of `/Library/Developer/Toolchains/` or
185+
`~/Library/Developer/Toolchains/`. E.x.:
186+
187+
```
188+
$ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C /
189+
$ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C ~/
190+
```
191+
192+
The script also generates an archive containing debug symbols which
193+
can be installed over the main archive allowing symbolication of any
194+
compiler crashes.
195+
196+
```
197+
$ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C /
198+
$ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C ~/
199+
```
200+
201+
2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.
202+
150203
### Build Failures
151204

152205
Try the suggestions in

0 commit comments

Comments
 (0)