🌐 AI搜索 & 代理 主页
blob: 65f5942fd161dae5f0ccb888cd1035b42be1f28b [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
6
7## Installation
Austin Seipp62c4d2c2012-01-23 21:53:128
Brian Anderson4c833af2012-10-11 00:56:389The Rust compiler currently must be built from a [tarball], unless you
10are on Windows, in which case using the [installer][win-exe] is
11recommended.
Austin Seipp62c4d2c2012-01-23 21:53:1212
Brian Anderson4c833af2012-10-11 00:56:3813Since the Rust compiler is written in Rust, it must be built by
14a precompiled "snapshot" version of itself (made in an earlier state
15of development). As such, source builds require a connection to
16the Internet, to fetch snapshots, and an OS that can execute the
17available snapshot binaries.
Austin Seipp62c4d2c2012-01-23 21:53:1218
Brian Anderson4c833af2012-10-11 00:56:3819Snapshot binaries are currently built and tested on several platforms:
Brian Anderson3403e412012-07-10 05:20:3220
Brian Anderson4c833af2012-10-11 00:56:3821* Windows (7, Server 2008 R2), x86 only
22* Linux (various distributions), x86 and x86-64
23* OSX 10.6 ("Snow Leopard") or greater, x86 and x86-64
Austin Seipp62c4d2c2012-01-23 21:53:1224
Brian Anderson4c833af2012-10-11 00:56:3825You may find that other platforms work, but these are our "tier 1"
26supported build environments that are most likely to work.
Austin Seipp62c4d2c2012-01-23 21:53:1227
Brian Anderson4c833af2012-10-11 00:56:3828> ***Note:*** Windows users should read the detailed
29> [getting started][wiki-start] notes on the wiki. Even when using
30> the binary installer the Windows build requires a MinGW installation,
31> the precise details of which are not discussed here.
32
33To build from source you will also need the following prerequisite
34packages:
Austin Seipp62c4d2c2012-01-23 21:53:1235
Brian Anderson3403e412012-07-10 05:20:3236* g++ 4.4 or clang++ 3.x
Brian Anderson4c833af2012-10-11 00:56:3837* python 2.6 or later (but not 3.x)
Brian Anderson3403e412012-07-10 05:20:3238* perl 5.0 or later
39* gnu make 3.81 or later
40* curl
Austin Seipp62c4d2c2012-01-23 21:53:1241
Brian Anderson4c833af2012-10-11 00:56:3842Assuming you're on a relatively modern *nix system and have met the
43prerequisites, something along these lines should work.
Austin Seipp62c4d2c2012-01-23 21:53:1244
Graydon Hoare951f4602013-04-01 23:06:2345 $ curl -O http://static.rust-lang.org/dist/rust-0.6.tar.gz
46 $ tar -xzf rust-0.6.tar.gz
47 $ cd rust-0.6
Austin Seipp62c4d2c2012-01-23 21:53:1248 $ ./configure
49 $ make && make install
50
Brian Anderson4c833af2012-10-11 00:56:3851You may need to use `sudo make install` if you do not normally have
52permission to modify the destination directory. The install locations
53can be adjusted by passing a `--prefix` argument to
54`configure`. Various other options are also supported, pass `--help`
55for more information on them.
Austin Seipp62c4d2c2012-01-23 21:53:1256
Brian Anderson4c833af2012-10-11 00:56:3857When complete, `make install` will place several programs into
58`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
Zack Corr621c7912013-01-14 10:55:4759API-documentation tool, and `rustpkg`, the Rust package manager and build system.
Austin Seipp62c4d2c2012-01-23 21:53:1260
Brian Anderson4c833af2012-10-11 00:56:3861[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
Graydon Hoare951f4602013-04-01 23:06:2362[tarball]: http://static.rust-lang.org/dist/rust-0.6.tar.gz
63[win-exe]: http://static.rust-lang.org/dist/rust-0.6-install.exe
Austin Seipp62c4d2c2012-01-23 21:53:1264
65
Brian Andersonc92d2ed2012-07-10 05:13:4866## License
Austin Seipp62c4d2c2012-01-23 21:53:1267
Brian Anderson11a99182012-12-28 21:40:3368Rust is primarily distributed under the terms of both the MIT license
69and the Apache License (Version 2.0), with portions covered by various
70BSD-like licenses.
Austin Seipp62c4d2c2012-01-23 21:53:1271
Brian Anderson11a99182012-12-28 21:40:3372See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
Brian Andersonc92d2ed2012-07-10 05:13:4873
74## More help
75
Brian Anderson7350eba2012-09-20 08:08:1176The [tutorial] is a good starting point.
77
Graydon Hoaredbd36112012-12-21 23:35:1578[tutorial]: http://static.rust-lang.org/doc/tutorial.html