🌐 AI搜索 & 代理 主页
blob: ed3a353f0e689ee5439f3efcf72352797e550b62 [file] [log] [blame] [view]
Brian Andersona08c5aa2012-07-10 05:18:371# The Rust Programming Language
Austin Seipp62c4d2c2012-01-23 21:53:122
Brian Andersonc92d2ed2012-07-10 05:13:483This is a compiler for Rust, including standard libraries, tools and
4documentation.
5
Jack Moffitt8d64fa32013-07-18 23:27:436## Quick Start
Brian Andersonc92d2ed2012-07-10 05:13:487
Jack Moffitt8d64fa32013-07-18 23:27:438### Windows
Austin Seipp62c4d2c2012-01-23 21:53:129
Jack Moffitt8d64fa32013-07-18 23:27:43101. Download and use the [installer][win-exe].
112. Read the [tutorial].
122. Enjoy!
Austin Seipp62c4d2c2012-01-23 21:53:1213
Jack Moffitt8d64fa32013-07-18 23:27:4314> ***Note:*** Windows users should read the detailed
15> [getting started][wiki-start] notes on the wiki. Even when using
16> the binary installer the Windows build requires a MinGW installation,
17> the precise details of which are not discussed here.
18
19[tutorial]: http://static.rust-lang.org/doc/tutorial.html
20[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
Brian Anderson695cb9f2013-09-21 23:25:0821[win-exe]: http://static.rust-lang.org/dist/rust-0.8-install.exe
Jack Moffitt8d64fa32013-07-18 23:27:4322
23### Linux / OS X
24
251. Install the prerequisites (if not already installed)
26 * g++ 4.4 or clang++ 3.x
27 * python 2.6 or later (but not 3.x)
28 * perl 5.0 or later
29 * gnu make 3.81 or later
30 * curl
312. Download and build Rust
32 You can either download a [tarball] or build directly from the [repo].
33
34 To build from the [tarball] do:
35
Brian Anderson695cb9f2013-09-21 23:25:0836 $ curl -O http://static.rust-lang.org/dist/rust-0.8.tar.gz
37 $ tar -xzf rust-0.8.tar.gz
38 $ cd rust-0.8
Jack Moffitt8d64fa32013-07-18 23:27:4339
40 Or to build from the [repo] do:
41
42 $ git clone https://github.com/mozilla/rust.git
43 $ cd rust
44
45 Now that you have Rust's source code, you can configure and build it:
46
47 $ ./configure
48 $ make && make install
49
50 You may need to use `sudo make install` if you do not normally have
51 permission to modify the destination directory. The install locations can
52 be adjusted by passing a `--prefix` argument to `configure`. Various other
53 options are also supported, pass `--help` for more information on them.
54
55 When complete, `make install` will place several programs into
56 `/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
57 API-documentation tool, and `rustpkg`, the Rust package manager and build
58 system.
593. Read the [tutorial].
604. Enjoy!
61
62[repo]: https://github.com/mozilla/rust
Brian Anderson695cb9f2013-09-21 23:25:0863[tarball]: http://static.rust-lang.org/dist/rust-0.8.tar.gz
64[tutorial]: http://static.rust-lang.org/doc/0.8/tutorial.html
Jack Moffitt8d64fa32013-07-18 23:27:4365
66## Notes
67
68Since the Rust compiler is written in Rust, it must be built by a
69precompiled "snapshot" version of itself (made in an earlier state of
70development). As such, source builds require a connection to the Internet, to
71fetch snapshots, and an OS that can execute the available snapshot binaries.
Austin Seipp62c4d2c2012-01-23 21:53:1272
Brian Anderson4c833af2012-10-11 00:56:3873Snapshot binaries are currently built and tested on several platforms:
Brian Anderson3403e412012-07-10 05:20:3274
Brian Anderson4c833af2012-10-11 00:56:3875* Windows (7, Server 2008 R2), x86 only
76* Linux (various distributions), x86 and x86-64
77* OSX 10.6 ("Snow Leopard") or greater, x86 and x86-64
Austin Seipp62c4d2c2012-01-23 21:53:1278
Brian Anderson4c833af2012-10-11 00:56:3879You may find that other platforms work, but these are our "tier 1"
80supported build environments that are most likely to work.
Austin Seipp62c4d2c2012-01-23 21:53:1281
Jack Moffitt8d64fa32013-07-18 23:27:4382Rust currently needs about 1.8G of RAM to build without swapping; if it hits
83swap, it will take a very long time to build.
Brian Anderson4c833af2012-10-11 00:56:3884
Jack Moffitt8d64fa32013-07-18 23:27:4385There is lots more documentation in the [wiki].
Austin Seipp62c4d2c2012-01-23 21:53:1286
Jack Moffitt8d64fa32013-07-18 23:27:4387[wiki]: https://github.com/mozilla/rust/wiki
Austin Seipp62c4d2c2012-01-23 21:53:1288
89
Brian Andersonc92d2ed2012-07-10 05:13:4890## License
Austin Seipp62c4d2c2012-01-23 21:53:1291
Brian Anderson11a99182012-12-28 21:40:3392Rust is primarily distributed under the terms of both the MIT license
93and the Apache License (Version 2.0), with portions covered by various
94BSD-like licenses.
Austin Seipp62c4d2c2012-01-23 21:53:1295
Brian Anderson11a99182012-12-28 21:40:3396See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
Brian Andersonc92d2ed2012-07-10 05:13:4897