====================================
-Getting Started with the LLVM System
+Getting Started with the LLVM System
====================================
.. contents::
* ``svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite``
#. Configure and build LLVM and Clang:
-
+
The usual build uses `CMake <CMake.html>`_. If you would rather use
autotools, see `Building LLVM with autotools <BuildingLLVMWithAutotools.html>`_.
* ``mkdir build``
* ``cd build``
* ``cmake -G <generator> [options] <path to llvm sources>``
-
+
Some common generators are:
* ``Unix Makefiles`` --- for generating make-compatible parallel makefiles.
* ``Visual Studio`` --- for generating Visual Studio projects and
solutions.
* ``Xcode`` --- for generating Xcode projects.
-
+
Some Common options:
* ``-DCMAKE_INSTALL_PREFIX=directory`` --- Specify for *directory* the full
LLVM is known to work on the following host platforms:
================== ===================== =============
-OS Arch Compilers
+OS Arch Compilers
================== ===================== =============
-Linux x86\ :sup:`1` GCC, Clang
-Linux amd64 GCC, Clang
-Linux ARM\ :sup:`4` GCC, Clang
-Linux PowerPC GCC, Clang
-Solaris V9 (Ultrasparc) GCC
-FreeBSD x86\ :sup:`1` GCC, Clang
-FreeBSD amd64 GCC, Clang
-MacOS X\ :sup:`2` PowerPC GCC
-MacOS X x86 GCC, Clang
-Cygwin/Win32 x86\ :sup:`1, 3` GCC
-Windows x86\ :sup:`1` Visual Studio
-Windows x64 x86-64 Visual Studio
+Linux x86\ :sup:`1` GCC, Clang
+Linux amd64 GCC, Clang
+Linux ARM\ :sup:`4` GCC, Clang
+Linux PowerPC GCC, Clang
+Solaris V9 (Ultrasparc) GCC
+FreeBSD x86\ :sup:`1` GCC, Clang
+FreeBSD amd64 GCC, Clang
+MacOS X\ :sup:`2` PowerPC GCC
+MacOS X x86 GCC, Clang
+Cygwin/Win32 x86\ :sup:`1, 3` GCC
+Windows x86\ :sup:`1` Visual Studio
+Windows x64 x86-64 Visual Studio
================== ===================== =============
.. note::
* **chmod** --- change permissions on a file
* **cat** --- output concatenation utility
* **cp** --- copy files
-* **date** --- print the current date/time
+* **date** --- print the current date/time
* **echo** --- print to standard output
* **egrep** --- extended regular expression search utility
* **find** --- find files/dirs in a file system
* **grep** --- regular expression search utility
* **gzip** --- gzip command for distribution generation
* **gunzip** --- gunzip command for distribution checking
-* **install** --- install directories/files
+* **install** --- install directories/files
* **mkdir** --- create a directory
* **mv** --- move (rename) files
* **ranlib** --- symbol table builder for archive libraries
For example:
.. code-block:: console
-
+
% cd llvm_build_dir
% find lib/Support/ -name APFloat*
lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o
code generation. For example, the ``llvm/lib/Target/X86`` directory holds the
X86 machine description while ``llvm/lib/Target/ARM`` implements the ARM
backend.
-
+
``llvm/lib/CodeGen/``
This directory contains the major parts of the code generator: Instruction
The archiver produces an archive containing the given LLVM bitcode files,
optionally with an index for faster lookup.
-
+
``llvm-as``
The assembler transforms the human readable LLVM assembly to LLVM bitcode.
``llvm-link``, not surprisingly, links multiple LLVM modules into a single
program.
-
+
``lli``
``lli`` is the LLVM interpreter, which can directly execute LLVM bitcode
.. code-block:: console
% ./hello
-
+
and
.. code-block:: console