#. Configure and build LLVM and Clang:
- *Warning:* Make sure you've checked out *all of* the source code
+ *Warning:* Make sure you've checked out *all of* the source code
before trying to configure with cmake. cmake does not pickup newly
- added source directories in incremental builds.
+ added source directories in incremental builds.
The build uses `CMake <CMake.html>`_. LLVM requires CMake 3.4.3 to build. It
is generally recommended to use a recent CMake, especially if you're
* CMake will generate build targets for each tool and library, and most
LLVM sub-projects generate their own ``check-<project>`` target.
- * Running a serial build will be *slow*. Make sure you run a
- parallel build; for ``make``, use ``make -j``.
+ * Running a serial build will be *slow*. Make sure you run a
+ parallel build; for ``make``, use ``make -j``.
* For more information see `CMake <CMake.html>`_
`below`_.
Consult the `Getting Started with LLVM`_ section for detailed information on
-configuring and compiling LLVM. Go to `Directory Layout`_ to learn about the
+configuring and compiling LLVM. Go to `Directory Layout`_ to learn about the
layout of the source code tree.
Requirements
Note that Debug builds require a lot of time and disk space. An LLVM-only build
will need about 1-3 GB of space. A full build of LLVM and Clang will need around
15-20 GB of disk space. The exact space requirements will vary by system. (It
-is so large because of all the debugging information and the fact that the
-libraries are statically linked into multiple tools).
+is so large because of all the debugging information and the fact that the
+libraries are statically linked into multiple tools).
-If you you are space-constrained, you can build only selected tools or only
+If you you are space-constrained, you can build only selected tools or only
selected targets. The Release build requires considerably less space.
The LLVM suite *may* compile on other platforms, but it is not guaranteed to do
.. code-block:: console
- % git clone http://llvm.org/git/llvm.git
+ % git clone https://git.llvm.org/git/llvm.git/
If you want to check out clang too, run:
.. code-block:: console
% cd llvm/tools
- % git clone http://llvm.org/git/clang.git
+ % git clone https://git.llvm.org/git/clang.git/
If you want to check out compiler-rt (required to build the sanitizers), run:
.. code-block:: console
% cd llvm/projects
- % git clone http://llvm.org/git/compiler-rt.git
+ % git clone https://git.llvm.org/git/compiler-rt.git/
If you want to check out libomp (required for OpenMP support), run:
.. code-block:: console
% cd llvm/projects
- % git clone http://llvm.org/git/openmp.git
+ % git clone https://git.llvm.org/git/openmp.git/
If you want to check out libcxx and libcxxabi (optional), run:
.. code-block:: console
% cd llvm/projects
- % git clone http://llvm.org/git/libcxx.git
- % git clone http://llvm.org/git/libcxxabi.git
+ % git clone https://git.llvm.org/git/libcxx.git/
+ % git clone https://git.llvm.org/git/libcxxabi.git/
If you want to check out the Test Suite Source Code (optional), run:
.. code-block:: console
% cd llvm/projects
- % git clone http://llvm.org/git/test-suite.git
+ % git clone https://git.llvm.org/git/test-suite.git/
Since the upstream repository is in Subversion, you should use ``git
pull --rebase`` instead of ``git pull`` to avoid generating a non-linear history
.. code-block:: console
- % git clone http://llvm.org/git/llvm.git
+ % git clone https://git.llvm.org/git/llvm.git/
% cd llvm
% git svn init https://llvm.org/svn/llvm-project/llvm/trunk --username=<username>
% git config svn-remote.svn.fetch :refs/remotes/origin/master
# If you have clang too:
% cd tools
- % git clone http://llvm.org/git/clang.git
+ % git clone https://git.llvm.org/git/clang.git/
% cd clang
% git svn init https://llvm.org/svn/llvm-project/cfe/trunk --username=<username>
% git config svn-remote.svn.fetch :refs/remotes/origin/master
================
One useful source of information about the LLVM source base is the LLVM `doxygen
-<http://www.doxygen.org/>`_ documentation available at
+<http://www.doxygen.org/>`_ documentation available at
`<http://llvm.org/doxygen/>`_. The following is a brief introduction to code
layout:
``llvm/include/llvm``
- All LLVM-specific header files, and subdirectories for different portions of
+ All LLVM-specific header files, and subdirectories for different portions of
LLVM: ``Analysis``, ``CodeGen``, ``Target``, ``Transforms``, etc...
``llvm/include/llvm/Support``
- Generic support libraries provided with LLVM but not necessarily specific to
- LLVM. For example, some C++ STL utilities and a Command Line option processing
+ Generic support libraries provided with LLVM but not necessarily specific to
+ LLVM. For example, some C++ STL utilities and a Command Line option processing
library store header files here.
``llvm/include/llvm/Config``
``llvm/lib``
------------
-Most source files are here. By putting code in libraries, LLVM makes it easy to
+Most source files are here. By putting code in libraries, LLVM makes it easy to
share code among the `tools`_.
``llvm/lib/IR/``
- Core LLVM source files that implement core classes like Instruction and
+ Core LLVM source files that implement core classes like Instruction and
BasicBlock.
``llvm/lib/AsmParser/``
``llvm/lib/Analysis/``
- A variety of program analyses, such as Call Graphs, Induction Variables,
+ A variety of program analyses, such as Call Graphs, Induction Variables,
Natural Loop Identification, etc.
``llvm/lib/Transforms/``
- IR-to-IR program transformations, such as Aggressive Dead Code Elimination,
- Sparse Conditional Constant Propagation, Inlining, Loop Invariant Code Motion,
+ IR-to-IR program transformations, such as Aggressive Dead Code Elimination,
+ Sparse Conditional Constant Propagation, Inlining, Loop Invariant Code Motion,
Dead Global Elimination, and many others.
``llvm/lib/Target/``
- Files describing target architectures for code generation. For example,
+ Files describing target architectures for code generation. For example,
``llvm/lib/Target/X86`` holds the X86 machine description.
``llvm/lib/CodeGen/``
- The major parts of the code generator: Instruction Selector, Instruction
+ The major parts of the code generator: Instruction Selector, Instruction
Scheduling, and Register Allocation.
``llvm/lib/MC/``
``llvm/lib/ExecutionEngine/``
- Libraries for directly executing bitcode at runtime in interpreted and
+ Libraries for directly executing bitcode at runtime in interpreted and
JIT-compiled scenarios.
``llvm/lib/Support/``
``llvm/projects``
-----------------
-Projects not strictly part of LLVM but shipped with LLVM. This is also the
+Projects not strictly part of LLVM but shipped with LLVM. This is also the
directory for creating your own LLVM-based projects which leverage the LLVM
build system.
``test-suite``
--------------
-A comprehensive correctness, performance, and benchmarking test suite for LLVM.
-Comes in a separate Subversion module because not every LLVM user is interested
+A comprehensive correctness, performance, and benchmarking test suite for LLVM.
+Comes in a separate Subversion module because not every LLVM user is interested
in such a comprehensive suite. For details see the :doc:`Testing Guide
<TestingGuide>` document.
``emacs/``
- Emacs and XEmacs syntax highlighting for LLVM assembly files and TableGen
+ Emacs and XEmacs syntax highlighting for LLVM assembly files and TableGen
description files. See the ``README`` for information on using them.
``getsrcs.sh``