More bugs fixed!
[oota-llvm.git] / docs / GettingStarted.html
index ea273a395579a54971445f40e35e48f00e3a2e27..252f3caf4b034f57d9f177be231abf3a5488acdc 100644 (file)
 
     <ul>
       <li><a href="#overview">Overview</a>
+      <li><a href="#quickstart">Getting Started Quickly (A Summary)</a>
+      <li><a href="#requirements">Requirements</a>
       <ol>
-          <li><a href="#requirements">Requirements</a>
-          <ol>
-              <li><a href="#hardware">Hardware</a>
-              <li><a href="#software">Software</a>
-          </ol>
+          <li><a href="#hardware">Hardware</a>
+          <li><a href="#software">Software</a>
       </ol>
-      <li><a href="#quickstart">Getting Started Quickly (A Summary)</a>
+
       <li><a href="#starting">Getting Started with LLVM</a>
         <ol>
           <li><a href="#terminology">Terminology and Notation</tt></a>
@@ -67,8 +66,9 @@
     <p>
     First, LLVM comes in two pieces.  The first piece is the LLVM suite.  This
     contains all of the tools, libraries, and header files needed to use the
-    low level virtual machine.  It also contains a test suite that can be used
-    to test the LLVM tools and the GCC front end.
+    low level virtual machine.  It contains an assembler, disassembler,
+    bytecode analyzer, and bytecode optimizer.  It also contains a test suite
+    that can be used to test the LLVM tools and the GCC front end.
     <p>
     The second piece is the GCC front end.  This component provides a version
     of GCC that compiles C  and C++ code into LLVM bytecode.  Currently, the
     development).  Once compiled into LLVM bytecode, a program can be
     manipulated with the LLVM tools from the LLVM suite.
 
-    <!--=====================================================================-->
-    <h3><a name="requirements"><b>Requirements</b></a></h3>
-    <!--=====================================================================-->
-
-    Before you begin to use the LLVM system, review the requirements given
-    below.  This may save you some trouble by knowing ahead of time what
-    hardware and software you will need.
-
-    <!--=====================================================================-->
-    <h4><a name="hardware"><b>Hardware</b></a></h4>
-    <!--=====================================================================-->
-    LLVM is known to work on the following platforms:
-    <ul>
-        <li> Linux on x86 (Pentium and above)
-        <ul>
-            <li> Approximately 760 MB of Free Disk Space
-            <ul>
-                <li>Source code: 30 MB
-                <li>Object code: 670 MB
-                <li>GCC front end: 60 MB
-            </ul>
-        </ul>
-
-        <p>
-
-        <li> Solaris on SparcV9 (Ultrasparc)
-        <ul>
-            <li> Approximately 1.24 GB of Free Disk Space
-            <ul>
-                <li>Source code: 30 MB
-                <li>Object code: 1000 MB
-                <li>GCC front end: 210 MB
-            </ul>
-        </ul>
-    </ul>
-
-    LLVM <i>may</i> compile on other platforms.  The LLVM utilities should work
-    on other platforms, so it should be possible to generate and produce LLVM
-    bytecode on unsupported platforms (although bytecode generated on one
-    platform may not work on another platform).  However, the code generators
-    and Just-In-Time (JIT) compilers only generate SparcV9 or x86 machine code.
-    </p>
-
-    <!--=====================================================================-->
-    <h4><a name="software"><b>Software</b></a></h4>
-    <!--=====================================================================-->
-    <p>
-
-    Unpacking the distribution requires the following tools:
-    <dl compact>
-        <dt>
-        <A href="http://www.gnu.org/software/gzip/gzip.html">GNU Zip (gzip)</A>
-        <dt><A href="http://www.gnu.org/software/tar/tar.html">GNU Tar</A>
-        <dd>
-        These tools are needed to uncompress and unarchive the software.
-        Regular Solaris <tt>tar</tt> may work for unpacking the TAR archive but
-        is untested.
-    </dl>
-
-    Compiling LLVM requires that you have several different software packages
-    installed:
-
-    <dl compact>
-        <dt> <A href="http://gcc.gnu.org">GCC</A>
-        <dd>
-        The GNU Compiler Collection must be installed with C and C++ language
-        support.  GCC 3.2.x works, and GCC 3.x is generally supported.
-
-        <p>
-        Note that we currently do not support any other C++ compiler.
-        </p>
-
-        <dt> <A href="http://savannah.gnu.org/projects/make">GNU Make</A>
-        <dd>
-        The LLVM build system relies upon GNU Make extensions.  Therefore, you
-        will need GNU Make (sometimes known as gmake) to build LLVM.
-        <p>
-
-        <dt> <A href="http://www.gnu.org/software/flex">Flex</A>
-        and
-        <A href="http://www.gnu.org/software/bison/bison.html">Bison</A>
-        <dd>
-        The LLVM source code is built using flex and bison.  You will not be
-        able to configure and compile LLVM without them.
-        <p>
-
-        <dt> <A href="http://savannah.gnu.org/projects/m4">GNU M4</A>
-        <dd>
-        If you are installing Bison on your machine for the first time, you
-        will need GNU M4 (version 1.4 or higher).
-    </dl>
-
-    <p>
-    There are some additional tools that you may want to have when working with
-    LLVM:
-    </p>
-
-    <ul>
-        <li><A href="http://www.gnu.org/software/autoconf">GNU Autoconf</A>
-        <li><A href="http://savannah.gnu.org/projects/m4">GNU M4</A>
-        <p>
-        If you want to make changes to the configure scripts, you will need
-        GNU autoconf (2.53 or higher), and consequently, GNU M4 (version 1.4
-        or higher).
-        </p>
-
-               <li><A href="http://www.codesourcery.com/qm/qmtest">QMTest</A>
-               <li><A href="http://www.python.org">Python</A>
-        <p>
-        In order to run the tests in the LLVM test suite, you will need QMTest and
-        a version of the Python interpreter that works with QMTest.
-    </ul>
-
-
-    <p>The remainder of this guide is meant to get you up and running with
-    LLVM and to give you some basic information about the LLVM environment.
-    The <a href"#quickstart">next section</a> gives a short summary for those
-    who are already familiar with the system and want to get started as quickly
-    as possible.  A <a href="#starting">complete guide to installation</a> is
-    provided in the subsequent section.
-
-    <p>The later sections of this guide describe the <a
-    href="#layout">general layout</a> of the the LLVM source-tree, a <a
-    href="#tutorial">simple example</a> using the LLVM tool chain, and <a
-    href="#links">links</a> to find more information about LLVM or to get
-    help via e-mail.
-
     <!--=====================================================================-->
     <center>
     <h2><a name="quickstart"><b>Getting Started Quickly (A Summary)</b></a></h2>
             <li><tt>cd <i>where-you-want-the-C-front-end-to-live</i></tt>
             <li><tt>gunzip --stdout cfrontend.<i>platform</i>.tar.gz | tar -xvf
             -</tt>
+            <li><b>Sparc Only:</b><br>
+            <tt>
+            cd cfrontend/sparc<br>
+            ./fixheaders
+            </tt>
         </ol>
 
         <p>
 
             <li>With anonymous CVS access:
             <ol>
-                <li>Find the path to the CVS repository containing LLVM (we'll
-                call this <i>CVSROOTDIR</i>).
                 <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
-                <li><tt>cvs -d <i>CVSROOTDIR</i> checkout llvm</tt>
+                <li><tt>cvs -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login</tt>
+                               <li>Hit the return key when prompted for the password.
+                <li><tt>cvs -z3 -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co llvm</tt>
                 <li><tt>cd llvm</tt>
             </ol>
         </ul>
 
     </ol>
 
-    <p>See <a href="#environment">Setting Up Your Environment</a> on tips to
-    simplify working with the LLVM front-end and compiled tools.  See the
-    next section for other useful details in working with LLVM,
-    or go straight to <a href="#layout">Program Layout</a> to learn about the
-    layout of the source code tree.
+    <p>
+    Consult the <a href="starting">Getting Started with LLVM</a> section for
+    detailed information on configuring and compiling LLVM.  See
+    <a href="#environment">Setting Up Your Environment</a> for tips that
+    simplify working with the GCC front end and LLVM tools.  Go to
+    <a href="#layout">Program Layout</a> to learn about the layout of the
+    source code tree.
+
+    <!--=====================================================================-->
+    <center>
+    <h2><a name="requirements"><b>Requirements</b></a></h2>
+    </center>
+    <hr>
+    <!--=====================================================================-->
+
+    Before you begin to use the LLVM system, review the requirements given
+    below.  This may save you some trouble by knowing ahead of time what
+    hardware and software you will need.
+
+    <!--=====================================================================-->
+    <h3><a name="hardware"><b>Hardware</b></a></h3>
+    <!--=====================================================================-->
+    LLVM is known to work on the following platforms:
+    <ul>
+        <li> Linux on x86 (Pentium and above)
+        <ul>
+            <li> Approximately 760 MB of Free Disk Space
+            <ul>
+                <li>Source code: 30 MB
+                <li>Object code: 670 MB
+                <li>GCC front end: 60 MB
+            </ul>
+        </ul>
+
+        <p>
+
+        <li> Solaris on SparcV9 (Ultrasparc)
+        <ul>
+            <li> Approximately 1.24 GB of Free Disk Space
+            <ul>
+                <li>Source code: 30 MB
+                <li>Object code: 1000 MB
+                <li>GCC front end: 210 MB
+            </ul>
+        </ul>
+    </ul>
+
+    The LLVM suite <i>may</i> compile on other platforms, but it is not
+    guaranteed to do so.  If compilation is successful, the LLVM utilities
+    should be able to assemble, disassemble, analyze, and optimize LLVM
+    bytecode.  Code generation should work as well, although the generated
+    native code may not work on your platform.
+    <p>
+    The GCC front end is not very portable at the moment.  If you want to get
+    it to work on another platform, you can download a copy of the source
+    and try to compile it on your platform.
+    </p>
+
+    <!--=====================================================================-->
+    <h3><a name="software"><b>Software</b></a></h3>
+    <!--=====================================================================-->
+    <p>
+
+    Compiling LLVM requires that you have several software packages installed:
+
+    <ul compact>
+        <li>
+        <a href="http://gcc.gnu.org">GCC 3.x with C and C++ language support</a>
+
+        <li>
+        <a href="http://savannah.gnu.org/projects/make">GNU Make</a>
+
+        <li>
+        <a href="http://www.gnu.org/software/flex">Flex</a>
+
+        <li>
+        <a href="http://www.gnu.org/software/bison/bison.html">Bison</a>
+    </ul>
+
+    <p>
+    There are some additional tools that you may want to have when working with
+    LLVM:
+    </p>
+
+    <ul>
+        <li><A href="http://www.gnu.org/software/autoconf">GNU Autoconf</A>
+        <li><A href="http://savannah.gnu.org/projects/m4">GNU M4</A>
+        <p>
+        If you want to make changes to the configure scripts, you will need
+        GNU autoconf (2.57 or higher), and consequently, GNU M4 (version 1.4
+        or higher).
+        </p>
+
+               <li><A href="http://www.codesourcery.com/qm/qmtest">QMTest</A>
+               <li><A href="http://www.python.org">Python</A>
+        <p>
+        These are needed to use the LLVM test suite.
+    </ul>
+
+
+    <p>The remainder of this guide is meant to get you up and running with
+    LLVM and to give you some basic information about the LLVM environment.
+    A <a href="#starting">complete guide to installation</a> is provided in the
+    next section.
+
+    <p>The later sections of this guide describe the <a
+    href="#layout">general layout</a> of the the LLVM source tree, a <a
+    href="#tutorial">simple example</a> using the LLVM tool chain, and <a
+    href="#links">links</a> to find more information about LLVM or to get
+    help via e-mail.
 
     <!--=====================================================================-->
     <center>
     each of these names with the appropriate pathname on your local system.
     All these paths are absolute:</p>
     <dl compact>
-        <dt>CVSROOTDIR
-        <dd>
-        This is the path for the CVS repository containing the LLVM source
-        code.  Ask the person responsible for your local LLVM installation to
-        give you this path.
-        <p>
-
         <dt>SRC_ROOT
         <dd>
         This is the top level directory of the LLVM source tree.
     follows:
     <ul>
     <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
-    <li><tt>cvs -d <i>CVSROOTDIR</i> checkout llvm</tt></p>
+       <li><tt>cvs -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login</tt>
+       <li>Hit the return key when prompted for the password.
+       <li><tt>cvs -z3 -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co llvm</tt>
     </ul>
 
     <p>This will create an '<tt>llvm</tt>' directory in the current
 
     <p>
     Before configuring and compiling the LLVM suite, you need to extract the
-    LLVM GCC front end from the binary distribution.  It is used for building the
+    LLVM GCC front end from the binary distribution.  It is used for building
+    the
     bytecode libraries later used by the GCC front end for linking programs, and
     its location must be specified when the LLVM suite is configured.
     </p>
         -</tt>
     </ol>
 
+    If you are on a Sparc/Solaris machine, you will need to fix the header
+    files:
+
+    <p>
+
+    <tt>
+    cd cfrontend/sparc
+    <br>
+    ./fixheaders
+    </tt>
+
+    <p>
+    The binary versions of the GCC front end may not suit all of your needs.
+    For example, the binary distribution may include an old version of a system
+    header file, not "fix" a header file that needs to be fixed for GCC, or it
+    may be linked with libraries not available on your system.
+    </p>
+
+    <p>
+    In cases like these, you may want to try
+    <a href="CFEBuildInstrs.html">building the GCC front end from source.</a>
+    This is not for the faint of heart, so be forewarned.
+    </p>
     <!------------------------------------------------------------------------->
     <h3><a name="config">Local LLVM Configuration</a></h3>
     <!------------------------------------------------------------------------->
     <p>Once checked out from the CVS repository, the LLVM suite source code
     must be configured via the <tt>configure</tt> script.  This script sets
     variables in <tt>llvm/Makefile.config</tt> and
-    <tt>llvm/include/Config/config.h</tt>.  It also populates <i>OBJ_ROOT</i> with
-    the Makefiles needed to build LLVM.
+    <tt>llvm/include/Config/config.h</tt>.  It also populates <i>OBJ_ROOT</i>
+    with the Makefiles needed to build LLVM.
 
     <p>
     The following environment variables are used by the <tt>configure</tt>
         <p>
     <dt><i>--enable-optimized</i>
     <dd>
-        Enables optimized compilation by defaulat (debugging symbols are removed
+        Enables optimized compilation by default (debugging symbols are removed
         and GCC optimization flags are enabled).  The default is to use an
         unoptimized build (also known as a debug build).
         <p>
       <dt><tt>llvm/lib/Transforms/</tt><dd> This directory contains the source
       code for the LLVM to LLVM program transformations, such as Aggressive Dead
       Code Elimination, Sparse Conditional Constant Propagation, Inlining, Loop
-      Invarient Code Motion, Dead Global Elimination, and many others...
+      Invariant Code Motion, Dead Global Elimination, and many others...
 
       <dt><tt>llvm/lib/Target/</tt><dd> This directory contains files that
       describe various target architectures for code generation.  For example,
       that has been retargeted to emit LLVM code as the machine code output.  It
       works just like any other GCC compiler, taking the typical <tt>-c, -S, -E,
       -o</tt> options that are typically used.  The source code for the
-      <tt>llvmgcc</tt> tool is currently not included in the LLVM cvs tree
+      <tt>llvmgcc</tt> tool is currently not included in the LLVM CVS tree
       because it is quite large and not very interesting.<p>
 
       <ol>
     <h3><a name="utils"><tt>llvm/utils</tt></a></h3>
     <!------------------------------------------------------------------------->
 
-    This directory contains utilities for working with LLVM sourcecode, and some
+    This directory contains utilities for working with LLVM source code, and some
     of the utilities are actually required as part of the build process because
     they are code generators for parts of LLVM infrastructure.
 
 
       <dt><tt><b>cvsupdate</b></tt><dd> <tt>cvsupdate</tt> is a script that will
       update your CVS tree, but produce a much cleaner and more organized output
-      than simply running <tt>`cvs up -dP'</tt> will. For example, it will group
+      than simply running <tt>`cvs -z3 up -dP'</tt> will. For example, it will group
       together all the new and updated files and modified files in separate
       sections, so you can see at a glance what has changed. If you are at the
       top of your LLVM CVS tree, running <tt>utils/cvsupdate</tt> is the
     <hr>
     <!--=====================================================================-->
 
-    Below are common problems and their remedies:
-
-    <dl compact>
-        <dt><b>When I run configure, it finds the wrong C compiler.</b>
-        <dd>
-        The <tt>configure</tt> script attempts to locate first <tt>gcc</tt> and
-        then <tt>cc</tt>, unless it finds compiler paths set in <tt>CC</tt> and
-        <tt>CXX</tt> for the C and C++ compiler, respectively.
-
-        If <tt>configure</tt> finds the wrong compiler, either adjust your
-        <tt>PATH</tt> environment variable or set <tt>CC</tt> and <tt>CXX</tt>
-        explicitly.
-        <p>
-
-        <dt><b>I compile the code, and I get some error about /localhome</b>.
-        <dd>
-        There are several possible causes for this.  The first is that you
-        didn't set a pathname properly when using <tt>configure</tt>, and it
-        defaulted to a pathname that we use on our research machines.
-        <p>
-        Another possibility is that we hardcoded a path in our Makefiles.  If
-        you see this, please email the LLVM bug mailing list with the name of
-        the offending Makefile and a description of what is wrong with it.
-
-        <dt><b>The <tt>configure</tt> script finds the right C compiler, but it
-        uses the LLVM linker from a previous build.  What do I do?</b>
-        <dd>
-        The <tt>configure</tt> script uses the <tt>PATH</tt> to find
-        executables, so if it's grabbing the wrong linker/assembler/etc, there
-        are two ways to fix it:
-        <ol>
-            <li>Adjust your <tt>PATH</tt> environment variable so that the
-            correct program appears first in the <tt>PATH</tt>.  This may work,
-            but may not be convenient when you want them <i>first</i> in your
-            path for other work.
-            <p>
-
-            <li>Run <tt>configure</tt> with an alternative <tt>PATH</tt> that
-            is correct.  In a Borne compatible shell, the syntax would be:
-            <p>
-            <tt>PATH=<the path without the bad program> ./configure ...</tt>
-            <p>
-            This is still somewhat inconvenient, but it allows
-            <tt>configure</tt> to do its work without having to adjust your
-            <tt>PATH</tt> permanently.
-        </ol>
-
-        <dt><b>I've upgraded to a new version of LLVM, and I get strange build
-        errors.</b>
-        <dd>
-        Sometimes changes to the LLVM source code alters how the build system
-        works.  Changes in libtool, autoconf, or header file dependencies are
-        especially prone to this sort of problem.
-        <p>
-        The best thing to try is to remove the old files and re-build.  In most
-        cases, this takes care of the problem.  To do this, just type <tt>make
-        clean</tt> and then <tt>make</tt> in the directory that fails to build.
-        <p>
-
-    </dl>
+    If you are having problems building or using LLVM, or if you have any other
+    general questions about LLVM, please consult the
+       <a href="FAQ.html">Frequently Asked Questions</a> page.
 
     <!--=====================================================================-->
     <h2><center><a name="links">Links</a></center></h2>
     If you have any questions or run into any snags (or you have any
     additions...), please send an email to
     <a href="mailto:sabre@nondot.org">Chris Lattner</a>.</p>
+    <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
+    <br>
 
-           <!-- Created: Mon Jul  1 02:29:02 CDT 2002 -->
-           <!-- hhmts start -->
-Last modified: Mon Aug 11 13:52:22 CDT 2003
-<!-- hhmts end -->
+       <!-- Created: Mon Jul  1 02:29:02 CDT 2002 -->
+       <!-- hhmts start -->
+    Last modified: Mon Oct 27 12:00:00 CDT 2003
+    <!-- hhmts end -->
   </body>
 </html>