doc: fix helloworld build on Windows
[dpdk.git] / doc / guides / windows_gsg / build_dpdk.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2019 Intel Corporation.
3
4 Compiling the DPDK Target from Source
5 =====================================
6
7 System Requirements
8 -------------------
9
10 The DPDK and its applications require the Clang-LLVM C compiler
11 and Microsoft MSVC linker.
12 The Meson Build system is used to prepare the sources for compilation
13 with the Ninja backend.
14 The installation of these tools is covered in this section.
15
16
17 Install the Compiler
18 --------------------
19
20 Download and install the clang compiler from
21 `LLVM website <http://releases.llvm.org/download.html>`_.
22 For example, Clang-LLVM direct download link::
23
24         http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe
25
26
27 Install the Linker
28 ------------------
29
30 Download and install the Build Tools for Visual Studio to link and build the
31 files on windows,
32 from `Microsoft website <https://visualstudio.microsoft.com/downloads>`_.
33 When installing build tools, select the "Visual C++ build tools" option
34 and ensure the Windows SDK is selected.
35
36
37 Install the Build System
38 ------------------------
39
40 Download and install the build system from
41 `Meson website <http://mesonbuild.com/Getting-meson.html>`_.
42 A good option to choose is the MSI installer for both meson and ninja together::
43
44         http://mesonbuild.com/Getting-meson.html#installing-meson-and-ninja-with-the-msi-installer%22
45
46 Install the Backend
47 -------------------
48
49 If using Ninja, download and install the backend from
50 `Ninja website <https://ninja-build.org/>`_ or
51 install along with the meson build system.
52
53 Build the code
54 --------------
55
56 The build environment is setup to build the EAL and the helloworld example by
57 default.
58
59 Using the ninja backend
60 ~~~~~~~~~~~~~~~~~~~~~~~~
61
62 Specifying the compiler might be required to complete the meson command.
63
64 .. code-block:: console
65
66     set CC=clang
67
68 To compile the examples, the flag ``-Dexamples`` is required.
69
70 .. code-block:: console
71
72     cd C:\Users\me\dpdk
73     meson -Dexamples=helloworld build
74     cd build
75     ninja
76
77 Run the helloworld example
78 ==========================
79
80 Navigate to the examples in the build directory and run `dpdk-helloworld.exe`.
81
82 .. code-block:: console
83
84     cd C:\Users\me\dpdk\build\examples
85     dpdk-helloworld.exe
86     hello from core 1
87     hello from core 3
88     hello from core 0
89     hello from core 2