Skip to content

Commit 313bccd

Browse files
committed
---
yaml --- r: 322495 b: refs/heads/tensorflow-next c: 8ec2465 h: refs/heads/master i: 322493: 3f575fe 322491: 0562639 322487: a09a00c 322479: 28d9aaf 322463: 8de577f 322431: 135e8b1
1 parent f3996a2 commit 313bccd

File tree

2 files changed

+72
-24
lines changed

2 files changed

+72
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: 932595d85b17c373daa879b4b0b9736f19827354
1464+
refs/heads/tensorflow-next: 8ec2465b7981941fe4467fbc04e6d048239709ed

branches/tensorflow-next/docs/WindowsBuild.md

Lines changed: 71 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ it provides some of the needed headers and libraries.
4141
1. Clone `apple/swift-corelibs-foundation` into a folder named `swift-corelibs-foundation`
4242
1. Clone `apple/swift-corelibs-xctest` into a folder name `swift-corelibs-xctest`
4343
1. Clone `apple/swift-lldb` into a folder named `lldb`
44+
1. Clone `apple/swift-llbuild` into a folder named `llbuild`
45+
1. Clone `apple/swift-package-manager` info a folder named `swift-package-manager`
4446
1. Clone `curl` into a folder named `curl`
4547
1. Clone `libxml2` into a folder named `libxml2`
4648

@@ -54,19 +56,20 @@ subst S: <path to sources>
5456
```
5557

5658
```cmd
57-
git config --global core.autocrlf input
5859
S:
5960
git clone https://github.com/apple/swift-cmark cmark
6061
git clone https://github.com/apple/swift-clang clang
6162
git clone https://github.com/apple/swift-llvm llvm
6263
git clone https://github.com/apple/swift-compiler-rt compiler-rt
63-
git clone https://github.com/apple/swift
64+
git clone -c core.autocrlf=input https://github.com/apple/swift
6465
git clone https://github.com/apple/swift-corelibs-libdispatch
6566
git clone https://github.com/apple/swift-corelibs-foundation
6667
git clone https://github.com/apple/swift-corelibs-xctest
6768
git clone https://github.com/apple/swift-lldb lldb
68-
git clone https://github.com/curl/curl.git curl
69-
git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
69+
git clone https://github.com/apple/swift-llbuild llbuild
70+
git clone -c core.autocrlf=input https://github.com/apple/swift-package-manager
71+
git clone https://github.com/curl/curl.git
72+
git clone https://gitlab.gnome.org/GNOME/libxml2.git
7073
```
7174

7275
### 3. Acquire ICU
@@ -77,7 +80,15 @@ git clone https://gitlab.gnome.org/GNOME/libxml2.git libxml2
7780
PATH S:\icu\bin64;%PATH%
7881
```
7982

80-
### 4. Get ready
83+
### 4. Fetch SQLite3
84+
85+
```powershell
86+
(New-Object System.Net.WebClient).DownloadFile("https://www.sqlite.org/2019/sqlite-amalgamation-3270200.zip", "S:\sqlite-amalgamation-3270200.zip")
87+
Add-Type -A System.IO.Compression.FileSystem
88+
[IO.Compression.ZipFile]::ExtractToDirectory("S:\sqlite-amalgamation-3270200.zip", "S:\")
89+
```
90+
91+
### 5. Get ready
8192
- From within a **developer** command prompt (not PowerShell nor cmd, but the [Visual Studio Developer Command Prompt](https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx)), execute the following command if you have an x64 PC.
8293

8394
```cmd
@@ -108,7 +119,7 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
108119

109120
Warning: Creating the above links usually requires administrator privileges. The quick and easy way to do this is to open a second developer prompt by right clicking whatever shortcut you used to open the first one, choosing Run As Administrator, and pasting the above commands into the resulting window. You can then close the privileged prompt; this is the only step which requires elevation.
110121

111-
### 5. Build LLVM/Clang
122+
### 6. Build LLVM/Clang
112123
- This must be done from within a developer command prompt. LLVM and Clang are
113124
large projects, so building might take a few hours. Make sure that the build
114125
type for LLVM/Clang is compatbile with the build type for Swift. That is,
@@ -137,7 +148,7 @@ cmake --build "S:\b\llvm"
137148
path S:\b\llvm\bin;%PATH%
138149
```
139150

140-
### 6. Build CMark
151+
### 7. Build CMark
141152
- This must be done from within a developer command prompt. CMark is a fairly
142153
small project and should only take a few minutes to build.
143154
```cmd
@@ -152,7 +163,7 @@ popd
152163
cmake --build "S:\b\cmark"
153164
```
154165

155-
### 7. Build Swift
166+
### 8. Build Swift
156167
- This must be done from within a developer command prompt
157168
- Note that Visual Studio vends a 32-bit python 2.7 installation in `C:\Python27` and a 64-bit python in `C:\Python27amd64`. You may use either one based on your installation.
158169

@@ -193,7 +204,7 @@ cmake --build "S:\b\swift"
193204
cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
194205
```
195206

196-
### 8. Build lldb
207+
### 9. Build lldb
197208
- This must be done from within a developer command prompt and could take hours
198209
depending on your system.
199210
```cmd
@@ -214,7 +225,7 @@ popd
214225
cmake --build S:\b\lldb
215226
```
216227

217-
### 9. Running tests on Windows
228+
### 10. Running tests on Windows
218229

219230
Running the testsuite on Windows has additional external dependencies. You must have a subset of the GNUWin32 programs installed and available in your path. The following packages are currently required:
220231

@@ -228,7 +239,7 @@ path S:\thirdparty\icu4c-63_1-Win64-MSVC2017\bin64;S:\b\swift\bin;S:\b\swift\lib
228239
ninja -C S:\b\swift check-swift
229240
```
230241

231-
### 10. Build swift-corelibs-libdispatch
242+
### 11. Build swift-corelibs-libdispatch
232243

233244
```cmd
234245
mkdir "S:\b\libdispatch"
@@ -250,7 +261,7 @@ cmake --build S:\b\libdispatch
250261
path S:\b\libdispatch;S:\b\libdispatch\src;%PATH%
251262
```
252263

253-
### 11. Build curl
264+
### 12. Build curl
254265

255266
```cmd
256267
pushd "S:\curl"
@@ -260,7 +271,7 @@ nmake /f Makefile.vc mode=static VC=15 MACHINE=x64
260271
popd
261272
```
262273

263-
### 12. Build libxml2
274+
### 13. Build libxml2
264275

265276
```cmd
266277
pushd "S:\libxml2\win32"
@@ -269,7 +280,7 @@ nmake /f Makefile.msvc
269280
popd
270281
```
271282

272-
### 13. Build swift-corelibs-foundation
283+
### 14. Build swift-corelibs-foundation
273284

274285
```cmd
275286
mkdir "S:\b\foundation"
@@ -296,7 +307,7 @@ cmake -G Ninja^
296307
path S:\b\foundation;%PATH%
297308
```
298309

299-
### 14. Build swift-corelibs-xctest
310+
### 15. Build swift-corelibs-xctest
300311

301312
```cmd
302313
mkdir "S:\b\xctest"
@@ -321,13 +332,13 @@ cmake --build S:\b\xctest
321332
path S:\b\xctest;%PATH%
322333
```
323334

324-
### 15. Test XCTest
335+
### 16. Test XCTest
325336

326337
```cmd
327338
ninja -C S:\b\xctest check-xctest
328339
```
329340

330-
### 16. Rebuild Foundation
341+
### 17. Rebuild Foundation
331342

332343
```cmd
333344
mkdir "S:\b\foundation"
@@ -350,14 +361,55 @@ cmake -G Ninja^
350361
cmake --build S:\b\foundation
351362
```
352363

353-
### 17. Test Foundation
364+
### 18. Test Foundation
354365

355366
```cmd
356367
cmake --build S:\b\foundation
357368
ninja -C S:\b\foundation test
358369
```
359370

360-
### 18. Install Swift on Windows
371+
### 19. Build SQLite3
372+
373+
```cmd
374+
md S:\b\sqlite
375+
cd S:\b\sqlite
376+
cl /MD /Ox /Zi /LD /DSQLITE_API=__declspec(dllexport) S:\sqlite-amalgamation-3270200\sqlite.c
377+
```
378+
379+
- Add SQLite3 to your path:
380+
```cmd
381+
path S:\b\sqlite;%PATH%
382+
```
383+
384+
### 20. Build llbuild
385+
386+
```cmd
387+
md S:\b\llbuild
388+
cd S:\b\llbuild
389+
cmake -G Ninja^
390+
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
391+
-DCMAKE_C_COMPILER=cl^
392+
-DCMAKE_CXX_COMPILER=cl^
393+
-DLLBUILD_PATH_TO_SQLITE_SOURCE=S:\sqlite-amalgamation-3270200^
394+
-DLLBUILD_PATH_TO_SQLITE_BUILD=S:\b\sqlite^
395+
S:\swift-llbuild
396+
ninja
397+
```
398+
399+
- Add llbuild to your path:
400+
```cmd
401+
path S:\b\llbuild;%PATH%
402+
```
403+
404+
### 21. Build swift-package-manager
405+
406+
```cmd
407+
md S:\b\spm
408+
cd S:\b\spm
409+
C:\Python27\python.exe S:\swift-package-manager\Utilities\bootstrap --foundation S:\b\foundation --libdispatch-build-dir S:\b\libdispatch --libdispatch-source-dir S:\swift-corelibs-libdispatch --llbuild-build-dir S:\b\llbuild --llbuild-source-dir S:\llbuild --sqlite-build-dir S:\b\sqlite --sqlite-source-dir S:\sqlite-amalgamation-3270200
410+
```
411+
412+
### 22. Install Swift on Windows
361413

362414
- Run ninja install:
363415

@@ -366,7 +418,3 @@ ninja -C S:\b\swift install
366418
```
367419

368420
- Add the Swift on Windows binaries path (`C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin`) to the `PATH` environment variable.
369-
370-
## MSVC
371-
372-
To use `cl` instead, just replace the `-DCMAKE_C_COMPILER` and `-DCMAKE_CXX_COMPILER` parameters to the `cmake` invocations.

0 commit comments

Comments
 (0)