Initial commit of Sphinx docs
[vpp.git] / docs / gettingstarted / developers / building.rst
1 .. _building:
2
3 .. toctree::
4
5 Building VPP
6 ============
7
8 To get started developing with VPP you need to get the sources and build the packages.
9
10 .. _setupproxies:
11
12 Set up Proxies
13 --------------
14
15 Depending on the environment, proxies may need to be set. 
16 You may run these commands:
17
18 .. code-block:: console
19
20     $ export http_proxy=http://<proxy-server-name>.com:<port-number>
21     $ export https_proxy=https://<proxy-server-name>.com:<port-number>
22
23
24 Get the VPP Sources
25 -------------------
26
27 To get the VPP sources and get ready to build execute the following:
28
29 .. code-block:: console
30
31     $ git clone https://gerrit.fd.io/r/vpp
32     $ cd vpp
33
34 Build VPP Dependencies
35 ----------------------
36
37 Before building, make sure there are no FD.io VPP or DPDK packages installed by entering the following
38 commands:
39
40 .. code-block:: console
41
42     $ dpkg -l | grep vpp 
43     $ dpkg -l | grep DPDK
44
45 There should be no output, or packages showing after each of the above commands.
46
47 Run this to install the dependencies for FD.io VPP. 
48 If it hangs during downloading at any point, you may need to set up :ref:`proxies for this to work <setupproxies>`.
49
50 .. code-block:: console
51
52     $ make install-dep
53     Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
54     Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
55     Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
56     Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
57     Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [803 kB]
58     Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [732 kB]
59     ...
60     ...
61     Update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
62     Setting up default-jdk-headless (2:1.8-56ubuntu2) ...
63     Processing triggers for libc-bin (2.23-0ubuntu3) ...
64     Processing triggers for systemd (229-4ubuntu6) ...
65     Processing triggers for ureadahead (0.100.0-19) ...
66     Processing triggers for ca-certificates (20160104ubuntu1) ...
67     Updating certificates in /etc/ssl/certs...
68     0 added, 0 removed; done.
69     Running hooks in /etc/ca-certificates/update.d...
70
71     done.
72     done.
73
74 Build VPP (Debug Mode)
75 ----------------------
76
77 This build version contains debug symbols which is useful to modify VPP. The command below will build debug version of VPP. 
78 This build will come with /build-root/vpp_debug-native.
79
80 .. code-block:: console
81
82     $ make build
83     make[1]: Entering directory '/home/vagrant/vpp-master/build-root'
84     @@@@ Arch for platform 'vpp' is native @@@@
85     @@@@ Finding source for dpdk @@@@
86     @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/dpdk.mk @@@@
87     @@@@ Source found in /home/vagrant/vpp-master/dpdk @@@@
88     @@@@ Arch for platform 'vpp' is native @@@@
89     @@@@ Finding source for vpp @@@@
90     @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/vpp.mk @@@@
91     @@@@ Source found in /home/vagrant/vpp-master/src @@@@
92     ...
93     ...
94     make[5]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
95     make[4]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
96     make[3]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
97     make[2]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
98     @@@@ Installing vpp: nothing to do @@@@
99     make[1]: Leaving directory '/home/vagrant/vpp-master/build-root'
100
101 Build VPP (Release Version)
102 ---------------------------
103
104 To build the release version of FD.io VPP.
105 This build is optimized and will not create debug symbols.
106 This build will come with /build-root/build-vpp-native
107
108 .. code-block:: console
109
110     $ make release
111
112
113 Building Necessary Packages
114 ---------------------------
115
116 To build the debian packages, one of the following commands below depending on the system:
117
118 Building Debian Packages
119 ^^^^^^^^^^^^^^^^^^^^^^^^
120
121 .. code-block:: console
122
123     $ make pkg-deb 
124
125
126 Building RPM Packages
127 ^^^^^^^^^^^^^^^^^^^^^
128
129 .. code-block:: console
130
131     $ make pkg-rpm
132
133 The packages will be found in the build-root directory.
134
135 .. code-block:: console
136     
137     $ ls *.deb
138
139     If packages built correctly, this should be the Output
140
141     vpp_18.07-rc0~456-gb361076_amd64.deb             vpp-dbg_18.07-rc0~456-gb361076_amd64.deb
142     vpp-api-java_18.07-rc0~456-gb361076_amd64.deb    vpp-dev_18.07-rc0~456-gb361076_amd64.deb
143     vpp-api-lua_18.07-rc0~456-gb361076_amd64.deb     vpp-lib_18.07-rc0~456-gb361076_amd64.deb
144     vpp-api-python_18.07-rc0~456-gb361076_amd64.deb  vpp-plugins_18.07-rc0~456-gb361076_amd64.deb
145
146 Packages built installed end up in build-root directory. Finally, the command below installs all built packages.
147
148 .. code-block:: console
149
150    $ sudo bash
151    # dpkg -i *.deb