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

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

@@ -17,27 +19,37 @@ @@ -46,75 +58,331 @@

Overview

+
+ + + Welcome to LLVM! In order to get started, you first need to know some + basic information. + +

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

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

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

Hardware

+ + LLVM is known to work on the following platforms: + + + LLVM may 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. +

+ + +

Software

+

-

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

+ Note that we currently do not support any other C++ compiler. +

+ +
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 +
+ The LLVM source code is built using flex and bison. You will not be + able to configure and compile LLVM without them. +

+ +

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

+ There are some additional tools that you may want to have when working with + LLVM: +

+ + + + +

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 general layout of the the LLVM source-tree, a simple example using the LLVM tool chain, and links to find more information about LLVM or to get help via e-mail.

-

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. 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. Edit Makefile.config to set local paths. This includes - setting the install location of the C frontend, and the various paths - to the C and C++ compilers used to build LLVM itself. -
  6. Set your LLVM_LIB_SEARCH_PATH environment variable. -
  7. gmake -k |& tee gnumake.out -    # this is csh or tcsh syntax +
  8. Install the GCC front end: +
      +
    1. cd where-you-want-the-C-front-end-to-live +
    2. gunzip --stdout cfrontend.platform.tar.gz | tar -xvf + - +
    + +

    + +

  9. Get the Source Code + + + +

    + +

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

    + +

  11. Build the LLVM Suite +
      +
    1. Set your LLVM_LIB_SEARCH_PATH environment variable. +
    2. 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

-

Through this manual, the following names are used to denote paths +

Throughout this manual, the following names are used to denote paths specific to the local system and working environment. These are not - environment variables you need to set, but just strings used in the rest - of this document below.. In any of the examples below, simply replace + environment variables you need to set but just strings used in the rest + of this document below. In any of the examples below, simply replace each of these names with the appropriate pathname on your local system. All these paths are absolute:

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

+ +

SRC_ROOT +
+ This is the top level directory of the LLVM source tree. +

+ +

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

+ +

LLVMGCCDIR +
+ This is the where the LLVM GCC Front End is installed. +

+ For the pre-built GCC front end binaries, the LLVMGCCDIR is + cfrontend/platform/llvm-gcc. +

-

Checkout LLVM from CVS

+

Setting Up Your Environment

-

Before checking out the source code, you will need to know the path to - CVS repository containing LLVM source code (we'll call this - CVSROOTDIR below). Ask the person responsible for your local LLVM - installation to give you this path. +

+ In order to compile and use LLVM, you will need to set some environment + variables. There are also some shell aliases which you may find useful. + You can set these on the command line, or better yet, set them in your + .cshrc or .profile. -

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

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

+ +

alias llvmgcc LLVMGCCDIR/llvm-gcc/bin/gcc +
alias llvmg++ LLVMGCCDIR/llvm-gcc/bin/g++ +
+ 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. +
+ + +

Unpacking the LLVM Archives

+ + +

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

+ +

cfrontend.sparc.tar.gz +
This is the binary release of the GCC front end for Solaris/Sparc. +

+ +

cfrontend.x86.tar.gz +
This is the binary release of the GCC front end for Linux/x86. +
+ + +

Checkout LLVM from CVS

+ + +

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: