authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-07 17:50:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-07 17:50:14-07:00
log1afea36a16ba4963f2a4ad0b2efb5e18680305ac
tree59d121b5f2889bf99dae0d03fa9604a47cb68cd9
parent88dc688bbf10fb95c51783eca0526054d33ef5a1

update readme installation instructions

The readme now links to the wiki for instructions on building from source. I plan to make many updates to the wiki soon as I start to provide tarballs for working on the compiler.

1 files changed, 5 insertions(+), 91 deletions(-)

README.md+5-91
......@@ -14,98 +14,12 @@ A general-purpose programming language and toolchain for maintaining
1414 * [Frequently Asked Questions](https://github.com/ziglang/zig/wiki/FAQ)
1515 * [Community Projects](https://github.com/ziglang/zig/wiki/Community-Projects)
1616
17## Building from Source
17## Installation
1818
19[![Build Status](https://dev.azure.com/ziglang/zig/_apis/build/status/ziglang.zig?branchName=master)](https://dev.azure.com/ziglang/zig/_build/latest?definitionId=1&branchName=master)
20
21Note that you can
22[download a binary of the master branch](https://ziglang.org/download/#release-master) or
23[install Zig from a package manager](https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager).
24
25### Stage 1: Build Zig from C++ Source Code
26
27This step must be repeated when you make changes to any of the C++ source code.
28
29#### Dependencies
30
31##### POSIX
32
33 * cmake >= 2.8.5
34 * gcc >= 5.0.0 or clang >= 3.6.0
35 * LLVM, Clang, LLD development libraries == 11.x, compiled with the same gcc or clang version above
36 - Use the system package manager, or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#posix).
37
38##### Windows
39
40 * cmake >= 3.15.3
41 * Microsoft Visual Studio. Supported versions:
42 - 2017 (version 15.8)
43 - 2019 (version 16)
44 * LLVM, Clang, LLD development libraries == 11.x
45 - Use the [pre-built binaries](https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows) or [build from source](https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#windows).
46
47#### Instructions
48
49##### POSIX
50
51```
52mkdir build
53cd build
54cmake ..
55make install
56```
57
58Need help? [Troubleshooting Build Issues](https://github.com/ziglang/zig/wiki/Troubleshooting-Build-Issues)
59
60##### MacOS
61
62```
63brew install cmake llvm
64brew outdated llvm || brew upgrade llvm
65mkdir build
66cd build
67cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm)
68make install
69```
70
71##### Windows
72
73See https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows
74
75### Stage 2: Build Self-Hosted Zig from Zig Source Code
76
77Now we use the stage1 binary:
78
79```
80zig build --prefix $(pwd)/stage2 -Denable-llvm
81```
82
83This produces `stage2/bin/zig` which can be used for testing and development.
84Once it is feature complete, it will be used to build stage 3 - the final compiler
85binary.
86
87### Stage 3: Rebuild Self-Hosted Zig Using the Self-Hosted Compiler
88
89*Note: Stage 2 compiler is not yet able to build Stage 3. Building Stage 3 is
90not yet supported.*
91
92Once the self-hosted compiler can build itself, this will be the actual
93compiler binary that we will install to the system. Until then, users should
94use stage 1.
95
96#### Debug / Development Build
97
98```
99stage2/bin/zig build
100```
101
102This produces `zig-cache/bin/zig`.
103
104#### Release / Install Build
105
106```
107stage2/bin/zig build install -Drelease
108```
19 * [download a pre-built binary](https://ziglang.org/download/)
20 * [install from a package manager](https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager)
21 * [build from source](https://github.com/ziglang/zig/wiki/Building-Zig-From-Source)
22 * [bootstrap zig for any target](https://github.com/ziglang/zig-bootstrap)
10923
11024## License
11125