test.html revision 1.7 1 1.7 mrg <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 1.7 mrg <html>
3 1.7 mrg <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
4 1.1 mrg
5 1.7 mrg Permission is granted to copy, distribute and/or modify this document
6 1.3 skrll under the terms of the GNU Free Documentation License, Version 1.3 or
7 1.1 mrg any later version published by the Free Software Foundation; with no
8 1.1 mrg Invariant Sections, the Front-Cover texts being (a) (see below), and
9 1.1 mrg with the Back-Cover Texts being (b) (see below). A copy of the
10 1.7 mrg license is included in the section entitled "GNU
11 1.7 mrg Free Documentation License".
12 1.1 mrg
13 1.1 mrg (a) The FSF's Front-Cover Text is:
14 1.1 mrg
15 1.7 mrg A GNU Manual
16 1.1 mrg
17 1.1 mrg (b) The FSF's Back-Cover Text is:
18 1.1 mrg
19 1.7 mrg You have freedom to copy and modify this GNU Manual, like GNU
20 1.1 mrg software. Copies published by the Free Software Foundation raise
21 1.7 mrg funds for GNU development. -->
22 1.7 mrg <!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
23 1.7 mrg <head>
24 1.7 mrg <title>Installing GCC</title>
25 1.7 mrg
26 1.7 mrg <meta name="description" content="Installing GCC">
27 1.7 mrg <meta name="keywords" content="Installing GCC">
28 1.7 mrg <meta name="resource-type" content="document">
29 1.7 mrg <meta name="distribution" content="global">
30 1.7 mrg <meta name="Generator" content="makeinfo">
31 1.7 mrg <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32 1.7 mrg <style type="text/css">
33 1.7 mrg <!--
34 1.7 mrg a.summary-letter {text-decoration: none}
35 1.7 mrg blockquote.indentedblock {margin-right: 0em}
36 1.7 mrg blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
37 1.7 mrg blockquote.smallquotation {font-size: smaller}
38 1.7 mrg div.display {margin-left: 3.2em}
39 1.7 mrg div.example {margin-left: 3.2em}
40 1.7 mrg div.lisp {margin-left: 3.2em}
41 1.7 mrg div.smalldisplay {margin-left: 3.2em}
42 1.7 mrg div.smallexample {margin-left: 3.2em}
43 1.7 mrg div.smalllisp {margin-left: 3.2em}
44 1.7 mrg kbd {font-style: oblique}
45 1.7 mrg pre.display {font-family: inherit}
46 1.7 mrg pre.format {font-family: inherit}
47 1.7 mrg pre.menu-comment {font-family: serif}
48 1.7 mrg pre.menu-preformatted {font-family: serif}
49 1.7 mrg pre.smalldisplay {font-family: inherit; font-size: smaller}
50 1.7 mrg pre.smallexample {font-size: smaller}
51 1.7 mrg pre.smallformat {font-family: inherit; font-size: smaller}
52 1.7 mrg pre.smalllisp {font-size: smaller}
53 1.7 mrg span.nolinebreak {white-space: nowrap}
54 1.7 mrg span.roman {font-family: initial; font-weight: normal}
55 1.7 mrg span.sansserif {font-family: sans-serif; font-weight: normal}
56 1.7 mrg ul.no-bullet {list-style: none}
57 1.7 mrg -->
58 1.7 mrg </style>
59 1.7 mrg
60 1.7 mrg
61 1.1 mrg </head>
62 1.7 mrg
63 1.7 mrg <body lang="en">
64 1.7 mrg <h1 class="settitle" align="center">Installing GCC</h1>
65 1.7 mrg
66 1.7 mrg
67 1.7 mrg
68 1.7 mrg
69 1.7 mrg
70 1.7 mrg
71 1.7 mrg
72 1.7 mrg
73 1.7 mrg
74 1.7 mrg
75 1.7 mrg
76 1.7 mrg
77 1.7 mrg
78 1.7 mrg
79 1.7 mrg
80 1.7 mrg
81 1.7 mrg
82 1.7 mrg
83 1.7 mrg
84 1.7 mrg
85 1.7 mrg
86 1.7 mrg <a name="index-Testing"></a>
87 1.7 mrg <a name="index-Installing-GCC_003a-Testing"></a>
88 1.7 mrg <a name="index-Testsuite"></a>
89 1.7 mrg
90 1.7 mrg <p>Before you install GCC, we encourage you to run the testsuites and to
91 1.1 mrg compare your results with results from a similar configuration that have
92 1.1 mrg been submitted to the
93 1.7 mrg <a href="http://gcc.gnu.org/ml/gcc-testresults/">gcc-testresults mailing list</a>.
94 1.1 mrg Some of these archived results are linked from the build status lists
95 1.1 mrg at <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>, although not everyone who
96 1.7 mrg reports a successful build runs the testsuites and submits the results.
97 1.1 mrg This step is optional and may require you to download additional software,
98 1.1 mrg but it can give you confidence in your new GCC installation or point out
99 1.1 mrg problems before you install and start using your new GCC.
100 1.7 mrg </p>
101 1.7 mrg <p>First, you must have <a href="download.html">downloaded the testsuites</a>.
102 1.1 mrg These are part of the full distribution, but if you downloaded the
103 1.1 mrg “core” compiler plus any front ends, you must download the testsuites
104 1.1 mrg separately.
105 1.7 mrg </p>
106 1.7 mrg <p>Second, you must have the testing tools installed. This includes
107 1.1 mrg <a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a>, Tcl, and Expect;
108 1.1 mrg the DejaGnu site has links to these.
109 1.7 mrg </p>
110 1.7 mrg <p>If the directories where <code>runtest</code> and <code>expect</code> were
111 1.7 mrg installed are not in the <code>PATH</code>, you may need to set the following
112 1.1 mrg environment variables appropriately, as in the following example (which
113 1.7 mrg assumes that DejaGnu has been installed under <samp>/usr/local</samp>):
114 1.7 mrg </p>
115 1.7 mrg <div class="smallexample">
116 1.7 mrg <pre class="smallexample">TCL_LIBRARY = /usr/local/share/tcl8.0
117 1.7 mrg DEJAGNULIBS = /usr/local/share/dejagnu
118 1.7 mrg </pre></div>
119 1.1 mrg
120 1.7 mrg <p>(On systems such as Cygwin, these paths are required to be actual
121 1.1 mrg paths, not mounts or links; presumably this is due to some lack of
122 1.1 mrg portability in the DejaGnu code.)
123 1.7 mrg </p>
124 1.1 mrg
125 1.7 mrg <p>Finally, you can run the testsuite (which may take a long time):
126 1.7 mrg </p><div class="smallexample">
127 1.7 mrg <pre class="smallexample">cd <var>objdir</var>; make -k check
128 1.7 mrg </pre></div>
129 1.7 mrg
130 1.7 mrg <p>This will test various components of GCC, such as compiler
131 1.1 mrg front ends and runtime libraries. While running the testsuite, DejaGnu
132 1.1 mrg might emit some harmless messages resembling
133 1.7 mrg ‘<samp>WARNING: Couldn't find the global config file.</samp>’ or
134 1.7 mrg ‘<samp>WARNING: Couldn't find tool init file</samp>’ that can be ignored.
135 1.7 mrg </p>
136 1.7 mrg <p>If you are testing a cross-compiler, you may want to run the testsuite
137 1.1 mrg on a simulator as described at <a href="http://gcc.gnu.org/simtest-howto.html">http://gcc.gnu.org/simtest-howto.html</a>.
138 1.7 mrg </p>
139 1.7 mrg <a name="How-can-you-run-the-testsuite-on-selected-tests_003f"></a>
140 1.7 mrg <h3 class="section">How can you run the testsuite on selected tests?</h3>
141 1.1 mrg
142 1.1 mrg <p>In order to run sets of tests selectively, there are targets
143 1.7 mrg ‘<samp>make check-gcc</samp>’ and language specific ‘<samp>make check-c</samp>’,
144 1.7 mrg ‘<samp>make check-c++</samp>’, ‘<samp>make check-fortran</samp>’, ‘<samp>make check-java</samp>’,
145 1.7 mrg ‘<samp>make check-ada</samp>’, ‘<samp>make check-objc</samp>’, ‘<samp>make check-obj-c++</samp>’,
146 1.7 mrg ‘<samp>make check-lto</samp>’
147 1.7 mrg in the <samp>gcc</samp> subdirectory of the object directory. You can also
148 1.7 mrg just run ‘<samp>make check</samp>’ in a subdirectory of the object directory.
149 1.7 mrg </p>
150 1.1 mrg
151 1.7 mrg <p>A more selective way to just run all <code>gcc</code> execute tests in the
152 1.1 mrg testsuite is to use
153 1.7 mrg </p>
154 1.7 mrg <div class="smallexample">
155 1.7 mrg <pre class="smallexample">make check-gcc RUNTESTFLAGS="execute.exp <var>other-options</var>"
156 1.7 mrg </pre></div>
157 1.7 mrg
158 1.7 mrg <p>Likewise, in order to run only the <code>g++</code> “old-deja” tests in
159 1.7 mrg the testsuite with filenames matching ‘<samp>9805*</samp>’, you would use
160 1.7 mrg </p>
161 1.7 mrg <div class="smallexample">
162 1.7 mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS="old-deja.exp=9805* <var>other-options</var>"
163 1.7 mrg </pre></div>
164 1.7 mrg
165 1.7 mrg <p>The <samp>*.exp</samp> files are located in the testsuite directories of the GCC
166 1.7 mrg source, the most important ones being <samp>compile.exp</samp>,
167 1.7 mrg <samp>execute.exp</samp>, <samp>dg.exp</samp> and <samp>old-deja.exp</samp>.
168 1.7 mrg To get a list of the possible <samp>*.exp</samp> files, pipe the
169 1.7 mrg output of ‘<samp>make check</samp>’ into a file and look at the
170 1.7 mrg ‘<samp>Running … .exp</samp>’ lines.
171 1.7 mrg </p>
172 1.7 mrg <a name="Passing-options-and-running-multiple-testsuites"></a>
173 1.7 mrg <h3 class="section">Passing options and running multiple testsuites</h3>
174 1.1 mrg
175 1.1 mrg <p>You can pass multiple options to the testsuite using the
176 1.7 mrg ‘<samp>--target_board</samp>’ option of DejaGNU, either passed as part of
177 1.7 mrg ‘<samp>RUNTESTFLAGS</samp>’, or directly to <code>runtest</code> if you prefer to
178 1.1 mrg work outside the makefiles. For example,
179 1.7 mrg </p>
180 1.7 mrg <div class="smallexample">
181 1.7 mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fmerge-constants"
182 1.7 mrg </pre></div>
183 1.1 mrg
184 1.7 mrg <p>will run the standard <code>g++</code> testsuites (“unix” is the target name
185 1.1 mrg for a standard native testsuite situation), passing
186 1.7 mrg ‘<samp>-O3 -fmerge-constants</samp>’ to the compiler on every test, i.e.,
187 1.1 mrg slashes separate options.
188 1.7 mrg </p>
189 1.7 mrg <p>You can run the testsuites multiple times using combinations of options
190 1.1 mrg with a syntax similar to the brace expansion of popular shells:
191 1.7 mrg </p>
192 1.7 mrg <div class="smallexample">
193 1.7 mrg <pre class="smallexample">…"--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}"
194 1.7 mrg </pre></div>
195 1.1 mrg
196 1.7 mrg <p>(Note the empty option caused by the trailing comma in the final group.)
197 1.7 mrg The following will run each testsuite eight times using the ‘<samp>arm-sim</samp>’
198 1.1 mrg target, as if you had specified all possible combinations yourself:
199 1.7 mrg </p>
200 1.7 mrg <div class="smallexample">
201 1.7 mrg <pre class="smallexample">--target_board='arm-sim/-mhard-float/-O1 \
202 1.7 mrg arm-sim/-mhard-float/-O2 \
203 1.7 mrg arm-sim/-mhard-float/-O3 \
204 1.7 mrg arm-sim/-mhard-float \
205 1.7 mrg arm-sim/-msoft-float/-O1 \
206 1.7 mrg arm-sim/-msoft-float/-O2 \
207 1.7 mrg arm-sim/-msoft-float/-O3 \
208 1.7 mrg arm-sim/-msoft-float'
209 1.7 mrg </pre></div>
210 1.1 mrg
211 1.7 mrg <p>They can be combined as many times as you wish, in arbitrary ways. This
212 1.1 mrg list:
213 1.7 mrg </p>
214 1.7 mrg <div class="smallexample">
215 1.7 mrg <pre class="smallexample">…"--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}"
216 1.7 mrg </pre></div>
217 1.7 mrg
218 1.7 mrg <p>will generate four combinations, all involving ‘<samp>-Wextra</samp>’.
219 1.7 mrg </p>
220 1.7 mrg <p>The disadvantage to this method is that the testsuites are run in serial,
221 1.1 mrg which is a waste on multiprocessor systems. For users with GNU Make and
222 1.1 mrg a shell which performs brace expansion, you can run the testsuites in
223 1.7 mrg parallel by having the shell perform the combinations and <code>make</code>
224 1.7 mrg do the parallel runs. Instead of using ‘<samp>--target_board</samp>’, use a
225 1.1 mrg special makefile target:
226 1.7 mrg </p>
227 1.7 mrg <div class="smallexample">
228 1.7 mrg <pre class="smallexample">make -j<var>N</var> check-<var>testsuite</var>//<var>test-target</var>/<var>option1</var>/<var>option2</var>/…
229 1.7 mrg </pre></div>
230 1.7 mrg
231 1.7 mrg <p>For example,
232 1.7 mrg </p>
233 1.7 mrg <div class="smallexample">
234 1.7 mrg <pre class="smallexample">make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
235 1.7 mrg </pre></div>
236 1.1 mrg
237 1.7 mrg <p>will run three concurrent “make-gcc” testsuites, eventually testing all
238 1.1 mrg ten combinations as described above. Note that this is currently only
239 1.7 mrg supported in the <samp>gcc</samp> subdirectory. (To see how this works, try
240 1.7 mrg typing <code>echo</code> before the example given here.)
241 1.7 mrg </p>
242 1.1 mrg
243 1.7 mrg <a name="Additional-testing-for-Java-Class-Libraries"></a>
244 1.7 mrg <h3 class="section">Additional testing for Java Class Libraries</h3>
245 1.1 mrg
246 1.7 mrg <p>The Java runtime tests can be executed via ‘<samp>make check</samp>’
247 1.7 mrg in the <samp><var>target</var>/libjava/testsuite</samp> directory in
248 1.1 mrg the build tree.
249 1.7 mrg </p>
250 1.7 mrg <p>The <a href="http://sourceware.org/mauve/">Mauve Project</a> provides
251 1.1 mrg a suite of tests for the Java Class Libraries. This suite can be run
252 1.1 mrg as part of libgcj testing by placing the Mauve tree within the libjava
253 1.7 mrg testsuite at <samp>libjava/testsuite/libjava.mauve/mauve</samp>, or by
254 1.7 mrg specifying the location of that tree when invoking ‘<samp>make</samp>’, as in
255 1.7 mrg ‘<samp>make MAUVEDIR=~/mauve check</samp>’.
256 1.7 mrg </p>
257 1.7 mrg <a name="How-to-interpret-test-results"></a>
258 1.7 mrg <h3 class="section">How to interpret test results</h3>
259 1.1 mrg
260 1.7 mrg <p>The result of running the testsuite are various <samp>*.sum</samp> and <samp>*.log</samp>
261 1.7 mrg files in the testsuite subdirectories. The <samp>*.log</samp> files contain a
262 1.1 mrg detailed log of the compiler invocations and the corresponding
263 1.7 mrg results, the <samp>*.sum</samp> files summarize the results. These summaries
264 1.1 mrg contain status codes for all tests:
265 1.7 mrg </p>
266 1.7 mrg <ul>
267 1.7 mrg <li> PASS: the test passed as expected
268 1.7 mrg </li><li> XPASS: the test unexpectedly passed
269 1.7 mrg </li><li> FAIL: the test unexpectedly failed
270 1.7 mrg </li><li> XFAIL: the test failed as expected
271 1.7 mrg </li><li> UNSUPPORTED: the test is not supported on this platform
272 1.7 mrg </li><li> ERROR: the testsuite detected an error
273 1.7 mrg </li><li> WARNING: the testsuite detected a possible problem
274 1.7 mrg </li></ul>
275 1.1 mrg
276 1.7 mrg <p>It is normal for some tests to report unexpected failures. At the
277 1.1 mrg current time the testing harness does not allow fine grained control
278 1.1 mrg over whether or not a test is expected to fail. This problem should
279 1.1 mrg be fixed in future releases.
280 1.7 mrg </p>
281 1.1 mrg
282 1.7 mrg <a name="Submitting-test-results"></a>
283 1.7 mrg <h3 class="section">Submitting test results</h3>
284 1.1 mrg
285 1.1 mrg <p>If you want to report the results to the GCC project, use the
286 1.7 mrg <samp>contrib/test_summary</samp> shell script. Start it in the <var>objdir</var> with
287 1.7 mrg </p>
288 1.7 mrg <div class="smallexample">
289 1.7 mrg <pre class="smallexample"><var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
290 1.7 mrg -m gcc-testresults (a] gcc.gnu.org |sh
291 1.7 mrg </pre></div>
292 1.1 mrg
293 1.7 mrg <p>This script uses the <code>Mail</code> program to send the results, so
294 1.7 mrg make sure it is in your <code>PATH</code>. The file <samp>your_commentary.txt</samp> is
295 1.1 mrg prepended to the testsuite summary and should contain any special
296 1.1 mrg remarks you have on your results or your build environment. Please
297 1.1 mrg do not edit the testsuite result block or the subject line, as these
298 1.1 mrg messages may be automatically processed.
299 1.7 mrg </p>
300 1.7 mrg <hr />
301 1.7 mrg <p>
302 1.7 mrg <p><a href="./index.html">Return to the GCC Installation page</a>
303 1.7 mrg </p>
304 1.7 mrg
305 1.7 mrg
306 1.7 mrg
307 1.7 mrg
308 1.7 mrg
309 1.7 mrg
310 1.7 mrg <hr>
311 1.6 mrg
312 1.1 mrg
313 1.1 mrg
314 1.7 mrg </body>
315 1.7 mrg </html>
316