3 Getting Started: Building and Running lld
4 =========================================
6 This page gives you the shortest path to checking out and building lld. If you
7 run into problems, please file bugs in the `LLVM Bugzilla`__
9 __ https://bugs.llvm.org/
17 1. Get the required tools.
20 * make (or any build system CMake supports).
21 * `Clang 3.1`_\+ or GCC 4.7+ (C++11 support is required).
23 * If using Clang, you will also need `libc++`_.
24 * `Python 2.4`_\+ (not 3.x) for running tests.
26 .. _CMake 2.8: http://www.cmake.org/cmake/resources/software.html
27 .. _Clang 3.1: http://clang.llvm.org/
28 .. _libc++: http://libcxx.llvm.org/
29 .. _Python 2.4: http://python.org/download/
31 2. Check out LLVM and subprojects (including lld)::
33 $ git clone https://github.com/llvm/llvm-project.git
35 4. Build LLVM and lld::
38 $ mkdir build && cd build
39 $ cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=lld ../llvm
42 * If you want to build with clang and it is not the default compiler or
43 it is installed in an alternate location, you'll need to tell the cmake tool
44 the location of the C and C++ compiler via CMAKE_C_COMPILER and
45 CMAKE_CXX_COMPILER. For example::
47 $ cmake -DCMAKE_CXX_COMPILER=/path/to/clang++ -DCMAKE_C_COMPILER=/path/to/clang ...
56 #. Get the required tools.
59 * `Visual Studio 12 (2013) or later`_ (required for C++11 support)
60 * `Python 2.4`_\+ (not 3.x) for running tests.
62 .. _CMake 2.8: http://www.cmake.org/cmake/resources/software.html
63 .. _Visual Studio 12 (2013) or later: http://www.microsoft.com/visualstudio/11/en-us
64 .. _Python 2.4: http://python.org/download/
66 #. Check out LLVM as above.
68 #. Generate Visual Studio project files::
70 $ cd llvm-project/build (out of source build required)
71 $ cmake -G "Visual Studio 11" -DLLVM_ENABLE_PROJECTS=lld ../llvm
75 * Open LLVM.sln in Visual Studio.
76 * Build the ``ALL_BUILD`` target.
80 * Build the ``lld-test`` target.
85 For more information on using CMake see the `LLVM CMake guide`_.
87 .. _LLVM CMake guide: https://llvm.org/docs/CMake.html