@@ -44,20 +44,37 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
44
44
[ gettingstarted ] : https://rustc-dev-guide.rust-lang.org/getting-started.html
45
45
[ rustcguidebuild ] : https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
46
46
47
- ### Building on a Unix-like system
48
- 1 . Make sure you have installed the dependencies:
47
+ ### Dependencies
48
+
49
+ Make sure you have installed the dependencies:
49
50
50
- * ` g++ ` 5.1 or later or ` clang++ ` 3.5 or later
51
51
* ` python ` 3 or 2.7
52
- * GNU ` make ` 3.81 or later
53
- * ` cmake ` 3.13.4 or later
54
- * ` ninja `
55
- * ` curl `
56
52
* ` git `
57
- * ` ssl ` which comes in ` libssl-dev ` or ` openssl-devel `
53
+ * A C compiler (when building for the host, ` cc ` is enough; cross-compiling may need additional compilers)
54
+ * ` curl ` (not needed on Windows)
58
55
* ` pkg-config ` if you are compiling on Linux and targeting Linux
56
+ * ` libiconv ` (already included with glibc on Debian-based distros)
57
+
58
+ To build cargo, you'll also need OpenSSL (` libssl-dev ` or ` openssl-devel ` on most Unix distros).
59
+
60
+ If building LLVM from source, you'll need additional tools:
61
+
62
+ * ` g++ ` , ` clang++ ` , or MSVC with versions listed on
63
+ [ LLVM's documentation] ( https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library )
64
+ * ` ninja ` , or GNU ` make ` 3.81 or later (ninja is recommended, especially on Windows)
65
+ * ` cmake ` 3.13.4 or later
66
+ * ` libstdc++-static ` may be required on some Linux distributions such as Fedora and Ubuntu
67
+
68
+ On tier 1 or tier 2 with host tools platforms, you can also choose to download LLVM by setting ` llvm.download-ci-llvm = true ` .
69
+ Otherwise, you'll need LLVM installed and ` llvm-config ` in your path.
70
+ See [ the rustc-dev-guide for more info] [ sysllvm ] .
71
+
72
+ [ sysllvm ] : https://rustc-dev-guide.rust-lang.org/building/new-target.html#using-pre-built-llvm
73
+
59
74
60
- 2 . Clone the [ source] with ` git ` :
75
+ ### Building on a Unix-like system
76
+
77
+ 1 . Clone the [ source] with ` git ` :
61
78
62
79
``` sh
63
80
git clone https://github.com/rust-lang/rust.git
@@ -66,7 +83,7 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
66
83
67
84
[ source ] : https://github.com/rust-lang/rust
68
85
69
- 3 . Configure the build settings:
86
+ 2 . Configure the build settings:
70
87
71
88
The Rust build system uses a file named ` config.toml ` in the root of the
72
89
source tree to determine various configuration settings for the build.
@@ -79,9 +96,7 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
79
96
If you plan to use ` x.py install` to create an installation, it is recommended
80
97
that you set the ` prefix` value in the ` [install]` section to a directory.
81
98
82
- Create an install directory if you are not installing in the default directory.
83
-
84
- 4. Build and install:
99
+ 3. Build and install:
85
100
86
101
` ` ` sh
87
102
./x.py build && ./x.py install
@@ -98,6 +113,20 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
98
113
99
114
### Building on Windows
100
115
116
+ On Windows, we suggest using [winget] to install dependencies by running the following in a terminal:
117
+
118
+ ```powershell
119
+ winget install -e Python.Python.3
120
+ winget install -e Kitware.CMake
121
+ winget install -e Git.Git
122
+ ```
123
+
124
+ Then edit your system' s ` PATH` variable and add: ` C:\P rogram Files\C Make\b in` . See
125
+ [this guide on editing the system ` PATH` ](https://www.java.com/en/download/help/path.html) from the
126
+ Java documentation.
127
+
128
+ [winget]: https://github.com/microsoft/winget-cli
129
+
101
130
There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
102
131
Visual Studio and the GNU ABI used by the GCC toolchain. Which version of Rust
103
132
you need depends largely on what C/C++ libraries you want to interoperate with.
0 commit comments