blob: d20b25700d640845a7ce0a35e6db0582e344c59a [file] [log] [blame]
Michael J. Spencer365f1ec2012-04-25 19:34:24 +00001.. _getting_started:
2
3Getting Started: Building and Running lld
4=========================================
5
6This page gives you the shortest path to checking out and building lld. If you
7run into problems, please file bugs in the `LLVM Bugzilla`__
8
9__ http://llvm.org/bugs/
10
11Building lld
12------------
13
14On Unix-like Systems
15~~~~~~~~~~~~~~~~~~~~
16
17#. Get the required tools.
18
19 * `CMake 2.8`_\+.
20 * make (or any build system CMake supports).
21 * `Clang 3.1`_\+ or GCC 4.7+ (C++11 support is required).
22
23 * If using Clang, you will also need `libc++`_.
24 * `Python 2.4`_\+ (not 3.x) for running tests.
25
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/
30
31#. Check out LLVM::
32
33 $ cd path/to/llvm-project
34 $ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
35
36#. Check out lld::
37
38 $ cd llvm/tools
39 $ svn co http://llvm.org/svn/llvm-project/lld/trunk lld
40
41 * lld can also be checked out to ``path/to/llvm-project`` and built as an external
42 project.
43
44#. Build LLVM and lld::
45
46 $ cd path/to/llvm-build/llvm (out of source build required)
47 $ cmake -G "Unix Makefiles" path/to/llvm-project/llvm
48 $ make
49
50#. Test::
51
52 $ make lld-test
53
54Using Visual Studio
55~~~~~~~~~~~~~~~~~~~
56
57#. Get the required tools.
58
59 * `CMake 2.8`_\+.
60 * `Visual Studio 11`_ (required for C++11 support)
61 * `Python 2.4`_\+ (not 3.x) for running tests.
62
63.. _CMake 2.8: http://www.cmake.org/cmake/resources/software.html
64.. _Visual Studio 11: http://www.microsoft.com/visualstudio/11/en-us
65.. _Python 2.4: http://python.org/download/
66
67#. Check out LLVM::
68
69 $ cd path/to/llvm-project
70 $ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
71
72#. Check out lld::
73
74 $ cd llvm/tools
75 $ svn co http://llvm.org/svn/llvm-project/lld/trunk lld
76
77 * lld can also be checked out to ``path/to/llvm-project`` and built as an external
78 project.
79
80#. Generate Visual Studio project files::
81
82 $ cd path/to/llvm-build/llvm (out of source build required)
83 $ cmake -G "Visual Studio 11" path/to/llvm-project/llvm
84
85#. Build
86
87 * Open LLVM.sln in Visual Studio.
88 * Build the ``ALL_BUILD`` target.
89
90#. Test
91
92 * Build the ``lld-test`` target.
93
94More Information
95~~~~~~~~~~~~~~~~
96
97For more information on using CMake see the `LLVM CMake guide`_.
98
99.. _LLVM Cmake guide: http://llvm.org/docs/CMake.html