Home | History | Annotate | Line # | Download | only in INSTALL
test.html revision 1.6
      1  1.6  mrg <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2  1.6  mrg <html>
      3  1.6  mrg <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc.
      4  1.1  mrg 
      5  1.6  mrg Permission is granted to copy, distribute and/or modify this document
      6  1.3  mrg 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.6  mrg license is included in the section entitled "GNU
     11  1.6  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.6  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.6  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.6  mrg      funds for GNU development. -->
     22  1.6  mrg <!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
     23  1.6  mrg <head>
     24  1.6  mrg <title>Installing GCC</title>
     25  1.6  mrg 
     26  1.6  mrg <meta name="description" content="Installing GCC">
     27  1.6  mrg <meta name="keywords" content="Installing GCC">
     28  1.6  mrg <meta name="resource-type" content="document">
     29  1.6  mrg <meta name="distribution" content="global">
     30  1.6  mrg <meta name="Generator" content="makeinfo">
     31  1.6  mrg <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     32  1.6  mrg <style type="text/css">
     33  1.6  mrg <!--
     34  1.6  mrg a.summary-letter {text-decoration: none}
     35  1.6  mrg blockquote.indentedblock {margin-right: 0em}
     36  1.6  mrg blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
     37  1.6  mrg blockquote.smallquotation {font-size: smaller}
     38  1.6  mrg div.display {margin-left: 3.2em}
     39  1.6  mrg div.example {margin-left: 3.2em}
     40  1.6  mrg div.lisp {margin-left: 3.2em}
     41  1.6  mrg div.smalldisplay {margin-left: 3.2em}
     42  1.6  mrg div.smallexample {margin-left: 3.2em}
     43  1.6  mrg div.smalllisp {margin-left: 3.2em}
     44  1.6  mrg kbd {font-style: oblique}
     45  1.6  mrg pre.display {font-family: inherit}
     46  1.6  mrg pre.format {font-family: inherit}
     47  1.6  mrg pre.menu-comment {font-family: serif}
     48  1.6  mrg pre.menu-preformatted {font-family: serif}
     49  1.6  mrg pre.smalldisplay {font-family: inherit; font-size: smaller}
     50  1.6  mrg pre.smallexample {font-size: smaller}
     51  1.6  mrg pre.smallformat {font-family: inherit; font-size: smaller}
     52  1.6  mrg pre.smalllisp {font-size: smaller}
     53  1.6  mrg span.nolinebreak {white-space: nowrap}
     54  1.6  mrg span.roman {font-family: initial; font-weight: normal}
     55  1.6  mrg span.sansserif {font-family: sans-serif; font-weight: normal}
     56  1.6  mrg ul.no-bullet {list-style: none}
     57  1.6  mrg -->
     58  1.6  mrg </style>
     59  1.6  mrg 
     60  1.6  mrg 
     61  1.1  mrg </head>
     62  1.6  mrg 
     63  1.6  mrg <body lang="en">
     64  1.6  mrg <h1 class="settitle" align="center">Installing GCC</h1>
     65  1.6  mrg 
     66  1.6  mrg 
     67  1.6  mrg 
     68  1.6  mrg 
     69  1.6  mrg 
     70  1.6  mrg 
     71  1.6  mrg 
     72  1.6  mrg 
     73  1.6  mrg 
     74  1.6  mrg 
     75  1.6  mrg 
     76  1.6  mrg 
     77  1.6  mrg 
     78  1.6  mrg 
     79  1.6  mrg 
     80  1.6  mrg 
     81  1.6  mrg 
     82  1.6  mrg 
     83  1.6  mrg 
     84  1.6  mrg 
     85  1.6  mrg 
     86  1.6  mrg <a name="index-Testing"></a>
     87  1.6  mrg <a name="index-Installing-GCC_003a-Testing"></a>
     88  1.6  mrg <a name="index-Testsuite"></a>
     89  1.6  mrg 
     90  1.6  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.6  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.6  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.6  mrg </p>
    101  1.6  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 &ldquo;core&rdquo; compiler plus any front ends, you must download the testsuites
    104  1.1  mrg separately.
    105  1.6  mrg </p>
    106  1.6  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.6  mrg </p>
    110  1.6  mrg <p>If the directories where <code>runtest</code> and <code>expect</code> were
    111  1.6  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.6  mrg assumes that DejaGnu has been installed under <samp>/usr/local</samp>):
    114  1.6  mrg </p>
    115  1.6  mrg <div class="smallexample">
    116  1.6  mrg <pre class="smallexample">TCL_LIBRARY = /usr/local/share/tcl8.0
    117  1.6  mrg DEJAGNULIBS = /usr/local/share/dejagnu
    118  1.6  mrg </pre></div>
    119  1.1  mrg 
    120  1.6  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.6  mrg </p>
    124  1.1  mrg 
    125  1.6  mrg <p>Finally, you can run the testsuite (which may take a long time):
    126  1.6  mrg </p><div class="smallexample">
    127  1.6  mrg <pre class="smallexample">cd <var>objdir</var>; make -k check
    128  1.6  mrg </pre></div>
    129  1.6  mrg 
    130  1.6  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.6  mrg &lsquo;<samp>WARNING: Couldn't find the global config file.</samp>&rsquo; or
    134  1.6  mrg &lsquo;<samp>WARNING: Couldn't find tool init file</samp>&rsquo; that can be ignored.
    135  1.6  mrg </p>
    136  1.6  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.6  mrg </p>
    139  1.6  mrg <a name="How-can-you-run-the-testsuite-on-selected-tests_003f"></a>
    140  1.6  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.6  mrg &lsquo;<samp>make check-gcc</samp>&rsquo; and language specific &lsquo;<samp>make check-c</samp>&rsquo;,
    144  1.6  mrg &lsquo;<samp>make check-c++</samp>&rsquo;, &lsquo;<samp>make check-fortran</samp>&rsquo;, &lsquo;<samp>make check-java</samp>&rsquo;,
    145  1.6  mrg &lsquo;<samp>make check-ada</samp>&rsquo;, &lsquo;<samp>make check-objc</samp>&rsquo;, &lsquo;<samp>make check-obj-c++</samp>&rsquo;,
    146  1.6  mrg &lsquo;<samp>make check-lto</samp>&rsquo;
    147  1.6  mrg in the <samp>gcc</samp> subdirectory of the object directory.  You can also
    148  1.6  mrg just run &lsquo;<samp>make check</samp>&rsquo; in a subdirectory of the object directory.
    149  1.6  mrg </p>
    150  1.1  mrg 
    151  1.6  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.6  mrg </p>
    154  1.6  mrg <div class="smallexample">
    155  1.6  mrg <pre class="smallexample">make check-gcc RUNTESTFLAGS=&quot;execute.exp <var>other-options</var>&quot;
    156  1.6  mrg </pre></div>
    157  1.6  mrg 
    158  1.6  mrg <p>Likewise, in order to run only the <code>g++</code> &ldquo;old-deja&rdquo; tests in
    159  1.6  mrg the testsuite with filenames matching &lsquo;<samp>9805*</samp>&rsquo;, you would use
    160  1.6  mrg </p>
    161  1.6  mrg <div class="smallexample">
    162  1.6  mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;old-deja.exp=9805* <var>other-options</var>&quot;
    163  1.6  mrg </pre></div>
    164  1.6  mrg 
    165  1.6  mrg <p>The <samp>*.exp</samp> files are located in the testsuite directories of the GCC
    166  1.6  mrg source, the most important ones being <samp>compile.exp</samp>,
    167  1.6  mrg <samp>execute.exp</samp>, <samp>dg.exp</samp> and <samp>old-deja.exp</samp>.
    168  1.6  mrg To get a list of the possible <samp>*.exp</samp> files, pipe the
    169  1.6  mrg output of &lsquo;<samp>make check</samp>&rsquo; into a file and look at the
    170  1.6  mrg &lsquo;<samp>Running &hellip;  .exp</samp>&rsquo; lines.
    171  1.6  mrg </p>
    172  1.6  mrg <a name="Passing-options-and-running-multiple-testsuites"></a>
    173  1.6  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.6  mrg &lsquo;<samp>--target_board</samp>&rsquo; option of DejaGNU, either passed as part of
    177  1.6  mrg &lsquo;<samp>RUNTESTFLAGS</samp>&rsquo;, or directly to <code>runtest</code> if you prefer to
    178  1.1  mrg work outside the makefiles.  For example,
    179  1.6  mrg </p>
    180  1.6  mrg <div class="smallexample">
    181  1.6  mrg <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;--target_board=unix/-O3/-fmerge-constants&quot;
    182  1.6  mrg </pre></div>
    183  1.1  mrg 
    184  1.6  mrg <p>will run the standard <code>g++</code> testsuites (&ldquo;unix&rdquo; is the target name
    185  1.1  mrg for a standard native testsuite situation), passing
    186  1.6  mrg &lsquo;<samp>-O3 -fmerge-constants</samp>&rsquo; to the compiler on every test, i.e.,
    187  1.1  mrg slashes separate options.
    188  1.6  mrg </p>
    189  1.6  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.6  mrg </p>
    192  1.6  mrg <div class="smallexample">
    193  1.6  mrg <pre class="smallexample">&hellip;&quot;--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}&quot;
    194  1.6  mrg </pre></div>
    195  1.1  mrg 
    196  1.6  mrg <p>(Note the empty option caused by the trailing comma in the final group.)
    197  1.6  mrg The following will run each testsuite eight times using the &lsquo;<samp>arm-sim</samp>&rsquo;
    198  1.1  mrg target, as if you had specified all possible combinations yourself:
    199  1.6  mrg </p>
    200  1.6  mrg <div class="smallexample">
    201  1.6  mrg <pre class="smallexample">--target_board='arm-sim/-mhard-float/-O1 \
    202  1.6  mrg                 arm-sim/-mhard-float/-O2 \
    203  1.6  mrg                 arm-sim/-mhard-float/-O3 \
    204  1.6  mrg                 arm-sim/-mhard-float \
    205  1.6  mrg                 arm-sim/-msoft-float/-O1 \
    206  1.6  mrg                 arm-sim/-msoft-float/-O2 \
    207  1.6  mrg                 arm-sim/-msoft-float/-O3 \
    208  1.6  mrg                 arm-sim/-msoft-float'
    209  1.6  mrg </pre></div>
    210  1.1  mrg 
    211  1.6  mrg <p>They can be combined as many times as you wish, in arbitrary ways.  This
    212  1.1  mrg list:
    213  1.6  mrg </p>
    214  1.6  mrg <div class="smallexample">
    215  1.6  mrg <pre class="smallexample">&hellip;&quot;--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}&quot;
    216  1.6  mrg </pre></div>
    217  1.6  mrg 
    218  1.6  mrg <p>will generate four combinations, all involving &lsquo;<samp>-Wextra</samp>&rsquo;.
    219  1.6  mrg </p>
    220  1.6  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.6  mrg parallel by having the shell perform the combinations and <code>make</code>
    224  1.6  mrg do the parallel runs.  Instead of using &lsquo;<samp>--target_board</samp>&rsquo;, use a
    225  1.1  mrg special makefile target:
    226  1.6  mrg </p>
    227  1.6  mrg <div class="smallexample">
    228  1.6  mrg <pre class="smallexample">make -j<var>N</var> check-<var>testsuite</var>//<var>test-target</var>/<var>option1</var>/<var>option2</var>/&hellip;
    229  1.6  mrg </pre></div>
    230  1.6  mrg 
    231  1.6  mrg <p>For example,
    232  1.6  mrg </p>
    233  1.6  mrg <div class="smallexample">
    234  1.6  mrg <pre class="smallexample">make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
    235  1.6  mrg </pre></div>
    236  1.1  mrg 
    237  1.6  mrg <p>will run three concurrent &ldquo;make-gcc&rdquo; testsuites, eventually testing all
    238  1.1  mrg ten combinations as described above.  Note that this is currently only
    239  1.6  mrg supported in the <samp>gcc</samp> subdirectory.  (To see how this works, try
    240  1.6  mrg typing <code>echo</code> before the example given here.)
    241  1.6  mrg </p>
    242  1.1  mrg 
    243  1.6  mrg <a name="Additional-testing-for-Java-Class-Libraries"></a>
    244  1.6  mrg <h3 class="section">Additional testing for Java Class Libraries</h3>
    245  1.1  mrg 
    246  1.6  mrg <p>The Java runtime tests can be executed via &lsquo;<samp>make check</samp>&rsquo;
    247  1.6  mrg in the <samp><var>target</var>/libjava/testsuite</samp> directory in
    248  1.1  mrg the build tree.
    249  1.6  mrg </p>
    250  1.6  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.6  mrg testsuite at <samp>libjava/testsuite/libjava.mauve/mauve</samp>, or by
    254  1.6  mrg specifying the location of that tree when invoking &lsquo;<samp>make</samp>&rsquo;, as in
    255  1.6  mrg &lsquo;<samp>make MAUVEDIR=~/mauve check</samp>&rsquo;.
    256  1.6  mrg </p>
    257  1.6  mrg <a name="How-to-interpret-test-results"></a>
    258  1.6  mrg <h3 class="section">How to interpret test results</h3>
    259  1.1  mrg 
    260  1.6  mrg <p>The result of running the testsuite are various <samp>*.sum</samp> and <samp>*.log</samp>
    261  1.6  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.6  mrg results, the <samp>*.sum</samp> files summarize the results.  These summaries
    264  1.1  mrg contain status codes for all tests:
    265  1.6  mrg </p>
    266  1.6  mrg <ul>
    267  1.6  mrg <li> PASS: the test passed as expected
    268  1.6  mrg </li><li> XPASS: the test unexpectedly passed
    269  1.6  mrg </li><li> FAIL: the test unexpectedly failed
    270  1.6  mrg </li><li> XFAIL: the test failed as expected
    271  1.6  mrg </li><li> UNSUPPORTED: the test is not supported on this platform
    272  1.6  mrg </li><li> ERROR: the testsuite detected an error
    273  1.6  mrg </li><li> WARNING: the testsuite detected a possible problem
    274  1.6  mrg </li></ul>
    275  1.1  mrg 
    276  1.6  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.6  mrg </p>
    281  1.1  mrg 
    282  1.6  mrg <a name="Submitting-test-results"></a>
    283  1.6  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.6  mrg <samp>contrib/test_summary</samp> shell script.  Start it in the <var>objdir</var> with
    287  1.6  mrg </p>
    288  1.6  mrg <div class="smallexample">
    289  1.6  mrg <pre class="smallexample"><var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
    290  1.6  mrg     -m gcc-testresults (a] gcc.gnu.org |sh
    291  1.6  mrg </pre></div>
    292  1.1  mrg 
    293  1.6  mrg <p>This script uses the <code>Mail</code> program to send the results, so
    294  1.6  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.6  mrg </p>
    300  1.6  mrg <hr />
    301  1.6  mrg <p>
    302  1.6  mrg <p><a href="./index.html">Return to the GCC Installation page</a>
    303  1.6  mrg </p>
    304  1.6  mrg 
    305  1.6  mrg 
    306  1.6  mrg 
    307  1.6  mrg 
    308  1.6  mrg 
    309  1.6  mrg 
    310  1.6  mrg <hr>
    311  1.1  mrg 
    312  1.1  mrg 
    313  1.1  mrg 
    314  1.6  mrg </body>
    315  1.6  mrg </html>
    316