X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FGettingStarted.html;h=ea273a395579a54971445f40e35e48f00e3a2e27;hb=abb1b588c2eb08ab9dd306b50001805bdce89553;hp=c2aac2fb66c0586ff7a3a234606c5ac343201c19;hpb=c56e582143edb016bb588af56e8d9ba894254c1e;p=oota-llvm.git diff --git a/docs/GettingStarted.html b/docs/GettingStarted.html index c2aac2fb66c..ea273a39557 100644 --- a/docs/GettingStarted.html +++ b/docs/GettingStarted.html @@ -8,7 +8,8 @@

Getting Started with the LLVM System
By: Guochun Shi, Chris Lattner, - John Criswell, and + John Criswell, + Misha Brukman, and Vikram Adve

@@ -25,26 +26,30 @@
  • Software -
  • Getting started with LLVM +
  • Getting Started Quickly (A Summary) +
  • Getting Started with LLVM
      -
    1. Getting started quickly (a summary)
    2. Terminology and Notation -
    3. Setting up your environment +
    4. Setting Up Your Environment +
    5. Unpacking the LLVM Archives
    6. Checkout LLVM from CVS -
    7. Local LLVM Configuration +
    8. Install the GCC Front End +
    9. Local LLVM Configuration
    10. Compiling the LLVM Suite Source Code -
    11. Building the LLVM C Front End -
    12. The location for object files +
    13. The Location of LLVM Object Files
  • Program layout -
      -
    1. CVS directories -
    2. llvm/include -
    3. llvm/lib -
    4. llvm/test -
    5. llvm/tools -
    -
  • An example using the LLVM tool chain +
      +
    1. CVS directories +
    2. llvm/include +
    3. llvm/lib +
    4. llvm/runtime +
    5. llvm/test +
    6. llvm/tools +
    7. llvm/utils +
    +
  • An Example Using the LLVM Tool Chain +
  • Common Problems
  • Links @@ -53,6 +58,7 @@

    Overview

    +
    Welcome to LLVM! In order to get started, you first need to know some @@ -65,10 +71,10 @@ to test the LLVM tools and the GCC front end.

    The second piece is the GCC front end. This component provides a version - of GCC that compiles C code into LLVM bytecode. Currently, the C front end - is a modified version of GCC 3.4 (we track the GCC 3.4 development). - Once compiled into LLVM bytecode, a program can be manipulated with the - LLVM tools. + of GCC that compiles C and C++ code into LLVM bytecode. Currently, the + GCC front end is a modified version of GCC 3.4 (we track the GCC 3.4 + development). Once compiled into LLVM bytecode, a program can be + manipulated with the LLVM tools from the LLVM suite.

    Requirements

    @@ -83,20 +89,25 @@ LLVM is known to work on the following platforms: @@ -106,16 +117,29 @@ 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. +

    Software

    + + Unpacking the distribution requires the following tools: +

    +
    + GNU Zip (gzip) +
    GNU Tar +
    + These tools are needed to uncompress and unarchive the software. + Regular Solaris tar may work for unpacking the TAR archive but + is untested. +
    + Compiling LLVM requires that you have several different software packages installed:
    -
    GCC +
    GCC
    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. @@ -124,19 +148,21 @@ Note that we currently do not support any other C++ compiler.

    -
    GNU Make +
    GNU Make
    The LLVM build system relies upon GNU Make extensions. Therefore, you will need GNU Make (sometimes known as gmake) to build LLVM.

    -

    Flex and Bison +
    Flex + and + Bison
    The LLVM source code is built using flex and bison. You will not be able to configure and compile LLVM without them.

    -

    GNU M4 +
    GNU M4
    If you are installing Bison on your machine for the first time, you will need GNU M4 (version 1.4 or higher). @@ -148,21 +174,28 @@

      -
    • GNU Autoconf -
    • GNU M4 +
    • GNU Autoconf +
    • GNU M4

      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).

      + +
    • QMTest +
    • Python +

      + 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.

    -

    The next section 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 first subsection gives - a short summary for those who are already familiar with the system and - want to get started as quickly as possible. +

    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 next section gives a short summary for those + who are already familiar with the system and want to get started as quickly + as possible. A complete guide to installation is + provided in the subsequent section.

    The later sections of this guide describe the general layout of the the LLVM source-tree, a

    -

    Getting Started

    +

    Getting Started Quickly (A Summary)

    - - - -

    Getting Started Quickly (A Summary)

    +
    Here's the short story for getting up and running quickly with LLVM:
      -
    1. Build the LLVM suite +
    2. Install the GCC front end:
        -
      1. Find the path to the CVS repository containing LLVM (we'll call this CVSROOTDIR). -
      2. cd where-you-want-llvm-to-live -
      3. cvs -d CVSROOTDIR checkout llvm -
      4. cd llvm -
      5. Run configure to configure the Makefiles and header files. - Useful options include: -
          -
        • --with-objroot=directory -
          - Specify where object files should be placed during the build. +
        • cd where-you-want-the-C-front-end-to-live +
        • gunzip --stdout cfrontend.platform.tar.gz | tar -xvf + - +
      -
    3. --with-llvmgccdir=directory -
      - Specify where the LLVM C frontend is going to be installed. - -
    4. Set your LLVM_LIB_SEARCH_PATH environment variable. -
    5. gmake -k |& tee gnumake.out -    # this is csh or tcsh syntax +

      + +

    6. Get the Source Code +
        +
      • With the distributed files: +
          +
        1. cd where-you-want-llvm-to-live +
        2. gunzip --stdout llvm.tar.gz | tar -xvf - +
        3. cd llvm +
        + +

        + +

      • With anonymous CVS access: +
          +
        1. Find the path to the CVS repository containing LLVM (we'll + call this CVSROOTDIR). +
        2. cd where-you-want-llvm-to-live +
        3. cvs -d CVSROOTDIR checkout llvm +
        4. cd llvm +
        +
      + + +

      + +

    7. Configure the LLVM Build Environment +
        +
      1. Change directory to where you want to store the LLVM object + files and run configure to configure the Makefiles and + header files for the default platform. + Useful options include: +
          +
        • --with-llvmgccdir=directory +
          + Specify where the LLVM GCC frontend is installed. +

          + +

        • --enable-spec2000=directory +
          + Enable the SPEC2000 benchmarks for testing. The SPEC2000 + benchmarks should be available in directory. +
      +

      -

    8. Build the LLVM C Front End (optional) + +
    9. Build the LLVM Suite
        -
      1. Create a directory for the object files to live. -
      2. cd object file directory -
      3. Run Pathname-to-where-the-source-code-lives/configure --prefix=LLVMGCCDIR to configure GCC. -
      4. make bootstrap -
      5. make install +
      6. Set your LLVM_LIB_SEARCH_PATH environment variable. +
      7. gmake -k |& tee gnumake.out +    # this is csh or tcsh syntax
      + +

      +

    -

    See Setting up your environment on tips to +

    See Setting Up Your Environment on tips to simplify working with the LLVM front-end and compiled tools. See the - other sub-sections below for other useful details in working with LLVM, + next section for other useful details in working with LLVM, or go straight to Program Layout to learn about the layout of the source code tree. + +

    +

    Getting Started with LLVM

    +
    +
    + +

    Terminology and Notation

    @@ -238,35 +308,28 @@ give you this path.

    -

    OBJ_ROOT +
    SRC_ROOT
    - This is the top level directory for where the LLVM suite object files - will be placed during the build. + This is the top level directory of the LLVM source tree.

    -

    LLVMGCCDIR +
    OBJ_ROOT
    - This is the pathname to the location where the LLVM C Front End will - be installed. Note that the C front end does not need to be installed - during the LLVM suite build; you will just need to know where it will - go for configuring the build system and running the test suite later. + This is the top level directory of the LLVM object tree (i.e. the + tree where object files and compiled programs will be placed. It + can be the same as SRC_ROOT).

    -

    GCCSRC +
    LLVMGCCDIR
    - This is the pathname of the directory where the LLVM C front end source - code can be found. + This is the where the LLVM GCC Front End is installed.

    - -

    GCCOBJ -
    - This is the pathname of the directory where the LLVM C front end object - code will be placed during the build. It can be safely removed once - the build is complete. + For the pre-built GCC front end binaries, the LLVMGCCDIR is + cfrontend/platform/llvm-gcc.
    -

    Setting up your environment

    +

    Setting Up Your Environment

    @@ -278,48 +341,48 @@

    LLVM_LIB_SEARCH_PATH=LLVMGCCDIR/llvm-gcc/bytecode-libs
    - This environment variable helps the LLVM C front end find bytecode + This environment variable helps the LLVM GCC front end find bytecode libraries that it will need for compilation.

    -

    PATH=${PATH}:OBJ_ROOT/llvm/tools/Debug +
    alias llvmgcc LLVMGCCDIR/llvm-gcc/bin/gcc +
    alias llvmg++ LLVMGCCDIR/llvm-gcc/bin/g++
    - Adding this directory to the end of your path will allow the - compilation of the C front end to find the LLVM tools. The LLVM tools - are needed for the C front end compile. -

    + This alias allows you to use the LLVM C and C++ front ends without putting + them in your PATH or typing in their complete pathnames. +

    -
    CC=Pathname to your GCC compiler -
    - The GCC compiler that you want to use must be the first C compiler in - your PATH. Otherwise, set this variable so that - configure will use the GCC compiler that you want to use. -

    + +

    Unpacking the LLVM Archives

    + -
    CXX=Pathname to your GCC C++ compiler -
    - The GCC compiler that you want to use must be the first C++ compiler in - your PATH. Otherwise, set this variable so that - configure will use the GCC compiler that you want to use. +

    + If you have the LLVM distribution, you will need to unpack it before you + can begin to compile it. LLVM is distributed as a set of three files. Each + file is a TAR archive that is compressed with the gzip program. +

    + +

    The three files are as follows: +

    +
    llvm.tar.gz +
    This is the source code to the LLVM suite.

    -

    CVSROOT=CVSROOT -
    - This environment variable tells CVS where to find the CVS repository. +
    cfrontend.sparc.tar.gz +
    This is the binary release of the GCC front end for Solaris/Sparc.

    -

    alias llvmgcc LLVMGCCDIR/bin/llvm-gcc -
    - This alias allows you to use the LLVM C front end without putting it in - your PATH or typing in its complete pathname. +
    cfrontend.x86.tar.gz +
    This is the binary release of the GCC front end for Linux/x86.

    Checkout LLVM from CVS

    -

    To get a fresh copy of the entire source code, all you - need to do is check it out from CVS as follows: +

    If you have access to our CVS repository, you can get a fresh copy of + the entire source code. All you need to do is check it out from CVS as + follows: