|
1 |
| -# Swift for TensorFlow |
| 1 | +<img src="https://swift.org/assets/images/swift.svg" alt="Swift logo" height="70" > |
| 2 | + |
| 3 | +# Swift Programming Language |
2 | 4 |
|
3 |
| -| OS | CI platform | x86_64 | GPU | |
4 |
| -|---|:---:|:---:|:---:| |
5 |
| -| **macOS** | Google Kokoro |  | - | |
6 |
| -| **Ubuntu 16.04** | Swift.org CI | [](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow) | [](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu) | |
7 | 5 |
|
8 | 6 | | | **Architecture** | **main** | **Package** |
|
9 | 7 | |---|:---:|:---:|:---:|
|
|
34 | 32 | |---|:---:|:---:|
|
35 | 33 | |**[Ubuntu 18.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_18_04_tensorflow.json)** | x86_64 |[](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow)|
|
36 | 34 | |**[macOS 10.13](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_macos_high_sierra_tensorflow.json)** | x86_64 |[](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 |[](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-tensorflow-gpu)| |
38 | 35 |
|
39 | 36 | <!-- SWIFT_ENABLE_TENSORFLOW -->
|
40 |
| - |
41 | 37 | 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.
|
42 | 38 |
|
43 | 39 | 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.
|
93 | 89 |
|
94 | 90 | [Getting Started guide]: /docs/HowToGuides/GettingStarted.md
|
95 | 91 |
|
| 92 | +<!-- SWIFT_ENABLE_TENSORFLOW --> |
96 | 93 | ### Swift For TensorFlow Toolchains
|
97 | 94 |
|
98 | 95 | #### Building
|
99 | 96 |
|
100 | 97 | Swift for TensorFlow toolchains are created using the script
|
101 | 98 | [build-toolchain-tensorflow](https://github.com/apple/swift/blob/tensorflow/utils/build-toolchain-tensorflow).
|
102 | 99 | 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 |
104 | 101 | invocation looks like the following:
|
105 | 102 |
|
106 | 103 | ```
|
@@ -147,6 +144,62 @@ compiler crashes.
|
147 | 144 |
|
148 | 145 | 2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.
|
149 | 146 |
|
| 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 | + |
150 | 203 | ### Build Failures
|
151 | 204 |
|
152 | 205 | Try the suggestions in
|
|
0 commit comments