source: general/prog/rust.xml@ 0639bb6

10.0 10.1 11.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind ken/refactor-virt lazarus perl-modules qt5new trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 0639bb6 was 0639bb6, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

More spelling fixes

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@18718 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 9.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY rust-download-http "https://static.rust-lang.org/dist/rustc-&rust-version;-src.tar.gz">
8 <!ENTITY rust-download-ftp "">
9 <!ENTITY rust-md5sum "c11d94d9e62f71838b20058f0797357a">
10 <!ENTITY rust-size "28 MB">
11 <!ENTITY rust-buildsize "1.5 GB (208 MB installed) plus 118MB for cargo files">
12 <!ENTITY rust-time "14 SBU (with 4 processors)">
13]>
14
15<sect1 id="rust" xreflabel="rustc-&rust-version;">
16 <?dbhtml filename="rust.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Rustc-&rust-version;</title>
24
25 <indexterm zone="rust">
26 <primary sortas="a-rust">Rust</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Rust</title>
31
32 <para>
33 The <application>Rust</application> programming language is designed
34 to be a safe, concurrent, practical language.
35 </para>
36
37 <para>
38 As with many other programming languages, rustc (the rust compiler)
39 needs a binary from which to bootstrap. It will download a stage0 binary,
40 and several cargo files (these are actually .tar.gz source archives) at
41 the start of the build, so you cannot compile it without an internet
42 connection.
43 </para>
44
45 <para>
46 The current <application>rustbuild</application> build-system will use
47 all available processors, although it does not scale well and often falls
48 back to just using one core while waiting for a library to compile.
49 </para>
50
51 <para>
52 At the moment <application>Rust</application> does not provide any
53 guarantees of a stable ABI, and it is likely that the next few versions
54 of <application>firefox</application> will each require the latest version
55 of <application>Rust</application>.
56 </para>
57
58 &lfs80_checked;
59
60 <bridgehead renderas="sect3">Package Information</bridgehead>
61 <itemizedlist spacing="compact">
62 <listitem>
63 <para>
64 Download (HTTP): <ulink url="&rust-download-http;"/>
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Download (FTP): <ulink url="&rust-download-ftp;"/>
70 </para>
71 </listitem>
72 <listitem>
73 <para>
74 Download MD5 sum: &rust-md5sum;
75 </para>
76 </listitem>
77 <listitem>
78 <para>
79 Download size: &rust-size;
80 </para>
81 </listitem>
82 <listitem>
83 <para>
84 Estimated disk space required: &rust-buildsize;
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 Estimated build time: &rust-time;
90 </para>
91 </listitem>
92 </itemizedlist>
93
94 <bridgehead renderas="sect3">Rust Dependencies</bridgehead>
95
96 <bridgehead renderas="sect4">Required</bridgehead>
97 <para role="required">
98 <xref linkend="curl"/>,
99 <xref linkend="cmake"/> (if not using the recommended <xref linkend="llvm-old"/>),
100 <xref linkend="python2"/>
101 </para>
102
103 <bridgehead renderas="sect4">Recommended</bridgehead>
104 <para role="recommended">
105 <!-- acceptable versions of llvm are listed in the tests
106 of LLVM_VERSION in configure, currently 3.{7-9}* -->
107 <xref linkend="llvm-old"/>
108 </para>
109
110 <bridgehead renderas="sect4">Optional</bridgehead>
111 <para role="optional">
112 <xref linkend="gdb"/> (often required for the testsuite, but some of the
113 gdb tests may still fail),
114 <xref linkend="ninja"/>
115 </para>
116
117 <para condition="html" role="usernotes">
118 User Notes: <ulink url="&blfs-wiki;/rust"/>
119 </para>
120 </sect2>
121
122 <sect2 role="installation">
123 <title>Installation of Rust</title>
124
125 <para>
126 Install <application>Rust</application> by running the following
127 commands:
128 </para>
129
130<screen><userinput>./configure --prefix=/usr \
131 --llvm-root=/opt/llvm3 \
132 --enable-llvm-link-shared \
133 --docdir=/usr/share/doc/rustc-&rust-version; &amp;&amp;
134./x.py build</userinput></screen>
135
136 <para>
137 The testsuite in this package selects random subsets of the
138 possible tests. There is no correlation between how long a
139 particular run of the testsuite takes, and how many tests
140 were run. On occasion, the chosen tests will run in much
141 less than 1.0 SBU, on other occasions they may take more
142 than 20 SBU. Although it is normal to run the testsuite for
143 a compiler, in this case that is very hard to recommend.
144 </para>
145
146 <para>
147 Nevertheless, if you insist on running the tests issue
148 <command>./x.py test</command>: as with the build, that will
149 use all available CPUs.
150 </para>
151
152 <para>
153 Now, as the <systemitem class="username">root</systemitem> user:
154 </para>
155
156<screen role="root"><userinput>test -f /usr/lib/libLLVM-3.9.so ||
157 ln -sv /opt/llvm3/lib/libLLVM-3.9.so /usr/lib &amp;&amp;
158
159./x.py dist --install</userinput></screen>
160 </sect2>
161
162 <sect2 role="commands">
163 <title>Command Explanations</title>
164
165 <para>
166 <command>--llvm-root=/opt/llvm3 --enable-llvm-link-shared</command>:
167 This tells rust to use the system version of llvm3 installed in
168 <filename class="directory">/opt/llvm3</filename>, linking to the
169 shared libraries.
170 </para>
171
172 <para>
173 <option>--enable-dist-host-only</option>: If you did not install a
174 system version of <xref linkend="llvm-old"/>, use this alternative command
175 to build the shipped static version of llvm. It will
176 <emphasis>compile</emphasis> for all the available linux cross-compilers
177 (Aarch64, MIPS, PowerPC, SystemZ, etc) but with this switch it will only
178 <emphasis>install</emphasis> for the host architecture.
179 </para>
180
181 <para>
182 <option>RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"</option>: use this if
183 you need to link against a version of LLVM-3 which was compiled against
184 <xref linkend="libffi"/>.
185 </para>
186
187 <para>
188 <command>ln -sv /opt/llvm3/lib/libLLVM-3.9.so /usr/lib</command>:
189 Although the <emphasis>build</emphasis> of <application>Rust</application>
190 finds the shared library in
191 <filename class="directory">/opt/llvm3/lib</filename>, several of the steps
192 run by the <application>rustbuild</application>
193 <emphasis>installer</emphasis> do not find
194 <filename>libLLVM-3.9.so</filename>. This conditional symlink fixes that,
195 and works even if <filename>libLLVM-3.9.{0,1}</filename> has already been
196 installed in <filename class="directory">/usr</filename>.
197 <emphasis>Omit this command if you did not install a system version of
198 <xref linkend="llvm-old"/></emphasis>.
199 </para>
200 </sect2>
201
202 <sect2 role="content">
203 <title>Contents</title>
204
205 <segmentedlist>
206 <segtitle>Installed Programs</segtitle>
207 <segtitle>Installed Libraries</segtitle>
208 <segtitle>Installed Directories</segtitle>
209
210 <seglistitem>
211 <seg>
212 rust-gdb, rust-lldb, rustc, rustdoc.
213 </seg>
214 <seg>
215 Many libraries (libarena, libflate, libfmt_macros, libgetopts,
216 libgraphviz, liblog, libproc_macro, librustc*, libserialize,
217 libstd, libsyntax, libterm, libtest), all containing a hash in
218 their names.
219 </seg>
220 <seg>
221 ~/.cargo,
222 /usr/lib/rustlib, and
223 /usr/share/doc/rustc-&rust-version;.
224 </seg>
225 </seglistitem>
226 </segmentedlist>
227
228 <variablelist>
229 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
230 <?dbfo list-presentation="list"?>
231 <?dbhtml list-presentation="table"?>
232
233 <varlistentry id="rust-gdb">
234 <term><command>rust-gdb</command></term>
235 <listitem>
236 <para>
237 is a Python wrapper script for gdb.
238 </para>
239 <indexterm zone="rust rust-gdb">
240 <primary sortas="b-rust-gdb">rust-gdb</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="rust-lldb">
246 <term><command>rust-lldb</command></term>
247 <listitem>
248 <para>
249 is a Python wrapper script for LLDB (the LLVM debugger).
250 </para>
251 <indexterm zone="rust rust-lldb">
252 <primary sortas="b-rust-lldb">rust=lldb</primary>
253 </indexterm>
254 </listitem>
255 </varlistentry>
256
257 <varlistentry id="rustc">
258 <term><command>rustc</command></term>
259 <listitem>
260 <para>
261 is the rust compiler.
262 </para>
263 <indexterm zone="rust rustc">
264 <primary sortas="b-rustc">rustc</primary>
265 </indexterm>
266 </listitem>
267 </varlistentry>
268
269 <varlistentry id="rustdoc">
270 <term><command>rustdoc</command></term>
271 <listitem>
272 <para>
273 generates documentation from rust source code.
274 </para>
275 <indexterm zone="rust rustdoc">
276 <primary sortas="b-rustdoc">rustdoc</primary>
277 </indexterm>
278 </listitem>
279 </varlistentry>
280
281 <varlistentry id="libstd">
282 <term><filename class="libraryfile">libstd-&lt;16-byte-hash&gt;.so</filename></term>
283 <listitem>
284 <para>
285 is the Rust Standard Library, the foundation of portable Rust software.
286 </para>
287 <indexterm zone="rust libstd">
288 <primary sortas="c-libstd">libstd-&lt;16-byte-hash&gt;.so</primary>
289 </indexterm>
290 </listitem>
291 </varlistentry>
292 </variablelist>
293 </sect2>
294</sect1>
Note: See TracBrowser for help on using the repository browser.