]> git.lizzy.rs Git - rust.git/blob - README.md
Auto merge of #22517 - brson:relnotes, r=Gankro
[rust.git] / README.md
1 # The Rust Programming Language
2
3 This is a compiler for Rust, including standard libraries, tools and
4 documentation.
5
6 ## Quick Start
7
8 Read ["Installing Rust"][install] from [The Book][trpl].
9
10 [install]: http://doc.rust-lang.org/book/installing-rust.html
11 [trpl]: http://doc.rust-lang.org/book/index.html
12
13 ## Building from Source
14
15 1. Make sure you have installed the dependencies:
16     * `g++` 4.7 or `clang++` 3.x
17     * `python` 2.6 or later (but not 3.x)
18     * GNU `make` 3.81 or later
19     * `curl`
20     * `git`
21
22 2. Download and build Rust:
23
24     You can either download a [tarball] or build directly from the [repo].
25
26     To build from the [tarball] do:
27
28         $ curl -O https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
29         $ tar -xzf rustc-nightly-src.tar.gz
30         $ cd rustc-nightly
31
32     Or to build from the [repo] do:
33
34         $ git clone https://github.com/rust-lang/rust.git
35         $ cd rust
36
37     Now that you have Rust's source code, you can configure and build it:
38
39         $ ./configure
40         $ make && make install
41
42     > ***Note:*** You may need to use `sudo make install` if you do not normally have
43     > permission to modify the destination directory. The install locations can
44     > be adjusted by passing a `--prefix` argument to `configure`. Various other
45     > options are also supported, pass `--help` for more information on them.
46
47     When complete, `make install` will place several programs into
48     `/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
49     API-documentation tool.
50
51 ### Building on Windows
52
53 To easily build on windows we can use [MSYS2](http://msys2.github.io/):
54
55 1. Grab the latest MSYS2 installer and go through the installer.
56 2. Now from the MSYS2 terminal we want to install the mingw64 toolchain and the other
57    tools we need.
58
59 ```bash
60 # choose one based on platform
61 $ pacman -S mingw-w64-i686-toolchain
62 $ pacman -S mingw-w64-x86_64-toolchain
63
64 $ pacman -S base-devel
65 ```
66
67 3. With that now start `mingw32_shell.bat` or `mingw64_shell.bat`
68    from where you installed MSYS2 (i.e. `C:\msys`). Which one you
69    choose depends on if you want 32 or 64 bit Rust.
70 4. From there just navigate to where you have Rust's source code, configure and build it:
71
72         $ ./configure
73         $ make && make install
74
75 [repo]: https://github.com/rust-lang/rust
76 [tarball]: https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz
77
78 ## Notes
79
80 Since the Rust compiler is written in Rust, it must be built by a
81 precompiled "snapshot" version of itself (made in an earlier state of
82 development). As such, source builds require a connection to the Internet, to
83 fetch snapshots, and an OS that can execute the available snapshot binaries.
84
85 Snapshot binaries are currently built and tested on several platforms:
86
87 * Windows (7, 8, Server 2008 R2), x86 and x86-64 (64-bit support added in Rust 0.12.0)
88 * Linux (2.6.18 or later, various distributions), x86 and x86-64
89 * OSX 10.7 (Lion) or greater, x86 and x86-64
90
91 You may find that other platforms work, but these are our officially
92 supported build environments that are most likely to work.
93
94 Rust currently needs about 1.5 GiB of RAM to build without swapping; if it hits
95 swap, it will take a very long time to build.
96
97 There is a lot more documentation in the [wiki].
98
99 [wiki]: https://github.com/rust-lang/rust/wiki
100
101 ## Getting help
102
103 The Rust community congregates in a few places:
104
105 * [StackOverflow] - Direct questions about using the language here.
106 * [users.rust-lang.org] - General discussion, broader questions.
107 * [/r/rust] - News and general discussion.
108
109 [StackOverflow]: http://stackoverflow.com/questions/tagged/rust
110 [/r/rust]: http://reddit.com/r/rust
111 [users.rust-lang.org]: http://users.rust-lang.org/
112
113 ## Contributing
114
115 To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).
116
117 ## License
118
119 Rust is primarily distributed under the terms of both the MIT license
120 and the Apache License (Version 2.0), with portions covered by various
121 BSD-like licenses.
122
123 See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.