| Brian Anderson | a08c5aa | 2012-07-10 05:18:37 | [diff] [blame] | 1 | # The Rust Programming Language |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 2 | |
| Brian Anderson | c92d2ed | 2012-07-10 05:13:48 | [diff] [blame] | 3 | This is a compiler for Rust, including standard libraries, tools and |
| 4 | documentation. |
| 5 | |
| 6 | |
| 7 | ## Installation |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 8 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 9 | The Rust compiler currently must be built from a [tarball], unless you |
| 10 | are on Windows, in which case using the [installer][win-exe] is |
| 11 | recommended. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 12 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 13 | Since the Rust compiler is written in Rust, it must be built by |
| 14 | a precompiled "snapshot" version of itself (made in an earlier state |
| 15 | of development). As such, source builds require a connection to |
| 16 | the Internet, to fetch snapshots, and an OS that can execute the |
| 17 | available snapshot binaries. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 18 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 19 | Snapshot binaries are currently built and tested on several platforms: |
| Brian Anderson | 3403e41 | 2012-07-10 05:20:32 | [diff] [blame] | 20 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 21 | * 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 Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 24 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 25 | You may find that other platforms work, but these are our "tier 1" |
| 26 | supported build environments that are most likely to work. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 27 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 28 | > ***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 | |
| 33 | To build from source you will also need the following prerequisite |
| 34 | packages: |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 35 | |
| Brian Anderson | 3403e41 | 2012-07-10 05:20:32 | [diff] [blame] | 36 | * g++ 4.4 or clang++ 3.x |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 37 | * python 2.6 or later (but not 3.x) |
| Brian Anderson | 3403e41 | 2012-07-10 05:20:32 | [diff] [blame] | 38 | * perl 5.0 or later |
| 39 | * gnu make 3.81 or later |
| 40 | * curl |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 41 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 42 | Assuming you're on a relatively modern *nix system and have met the |
| 43 | prerequisites, something along these lines should work. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 44 | |
| Graydon Hoare | 951f460 | 2013-04-01 23:06:23 | [diff] [blame] | 45 | $ 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 Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 48 | $ ./configure |
| 49 | $ make && make install |
| 50 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 51 | You may need to use `sudo make install` if you do not normally have |
| 52 | permission to modify the destination directory. The install locations |
| 53 | can be adjusted by passing a `--prefix` argument to |
| 54 | `configure`. Various other options are also supported, pass `--help` |
| 55 | for more information on them. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 56 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 57 | When complete, `make install` will place several programs into |
| 58 | `/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the |
| Zack Corr | 621c791 | 2013-01-14 10:55:47 | [diff] [blame] | 59 | API-documentation tool, and `rustpkg`, the Rust package manager and build system. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 60 | |
| Brian Anderson | 4c833af | 2012-10-11 00:56:38 | [diff] [blame] | 61 | [wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust |
| Graydon Hoare | 951f460 | 2013-04-01 23:06:23 | [diff] [blame] | 62 | [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 Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 64 | |
| 65 | |
| Brian Anderson | c92d2ed | 2012-07-10 05:13:48 | [diff] [blame] | 66 | ## License |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 67 | |
| Brian Anderson | 11a9918 | 2012-12-28 21:40:33 | [diff] [blame] | 68 | Rust is primarily distributed under the terms of both the MIT license |
| 69 | and the Apache License (Version 2.0), with portions covered by various |
| 70 | BSD-like licenses. |
| Austin Seipp | 62c4d2c | 2012-01-23 21:53:12 | [diff] [blame] | 71 | |
| Brian Anderson | 11a9918 | 2012-12-28 21:40:33 | [diff] [blame] | 72 | See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details. |
| Brian Anderson | c92d2ed | 2012-07-10 05:13:48 | [diff] [blame] | 73 | |
| 74 | ## More help |
| 75 | |
| Brian Anderson | 7350eba | 2012-09-20 08:08:11 | [diff] [blame] | 76 | The [tutorial] is a good starting point. |
| 77 | |
| Graydon Hoare | dbd3611 | 2012-12-21 23:35:15 | [diff] [blame] | 78 | [tutorial]: http://static.rust-lang.org/doc/tutorial.html |