blob: a408b510ca0b858577fa80539e2ef0e42fc635ac [file] [log] [blame]
John DeNisco06dcd452018-07-26 12:45:10 -04001.. _building:
2
3.. toctree::
4
5Building VPP
6============
7
8To get started developing with VPP you need to get the sources and build the packages.
9
10.. _setupproxies:
11
12Set up Proxies
andrewa38d0012018-08-06 00:25:33 -040013--------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040014
15Depending on the environment, proxies may need to be set.
16You 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
24Get the VPP Sources
andrewa38d0012018-08-06 00:25:33 -040025-----------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040026
27To 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
34Build VPP Dependencies
andrewa38d0012018-08-06 00:25:33 -040035--------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040036
37Before building, make sure there are no FD.io VPP or DPDK packages installed by entering the following
38commands:
39
40.. code-block:: console
41
42 $ dpkg -l | grep vpp
43 $ dpkg -l | grep DPDK
44
45There should be no output, or packages showing after each of the above commands.
46
andrewa38d0012018-08-06 00:25:33 -040047Run these commands to install the dependencies for FD.io VPP.
John DeNisco06dcd452018-07-26 12:45:10 -040048If 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
andrewa38d0012018-08-06 00:25:33 -040074Build VPP (Debug)
75----------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040076
andrewa38d0012018-08-06 00:25:33 -040077This build version contains debug symbols which is useful to modify VPP. The command
78below will build debug version of VPP. The binaries when building the debug images
79can be found in /build-root/vpp_debug-native.
John DeNisco06dcd452018-07-26 12:45:10 -040080
81.. code-block:: console
82
83 $ make build
84 make[1]: Entering directory '/home/vagrant/vpp-master/build-root'
85 @@@@ Arch for platform 'vpp' is native @@@@
86 @@@@ Finding source for dpdk @@@@
87 @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/dpdk.mk @@@@
88 @@@@ Source found in /home/vagrant/vpp-master/dpdk @@@@
89 @@@@ Arch for platform 'vpp' is native @@@@
90 @@@@ Finding source for vpp @@@@
91 @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/vpp.mk @@@@
92 @@@@ Source found in /home/vagrant/vpp-master/src @@@@
93 ...
94 ...
95 make[5]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
96 make[4]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
97 make[3]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
98 make[2]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
99 @@@@ Installing vpp: nothing to do @@@@
100 make[1]: Leaving directory '/home/vagrant/vpp-master/build-root'
101
102Build VPP (Release Version)
andrewa38d0012018-08-06 00:25:33 -0400103-----------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -0400104
andrewa38d0012018-08-06 00:25:33 -0400105To build the release version of FD.io VPP. This build is optimized and will not create debug symbols.
106The binaries when building the release images can be found in /build-root/vpp-native.
John DeNisco06dcd452018-07-26 12:45:10 -0400107
108.. code-block:: console
109
andrewa38d0012018-08-06 00:25:33 -0400110 $ make build-release
John DeNisco06dcd452018-07-26 12:45:10 -0400111
112
113Building Necessary Packages
andrewa38d0012018-08-06 00:25:33 -0400114--------------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -0400115
116To build the debian packages, one of the following commands below depending on the system:
117
118Building Debian Packages
andrewa38d0012018-08-06 00:25:33 -0400119^^^^^^^^^^^^^^^^^^^^^^^^^
John DeNisco06dcd452018-07-26 12:45:10 -0400120
121.. code-block:: console
122
123 $ make pkg-deb
124
125
126Building RPM Packages
andrewa38d0012018-08-06 00:25:33 -0400127^^^^^^^^^^^^^^^^^^^^^^^
John DeNisco06dcd452018-07-26 12:45:10 -0400128
129.. code-block:: console
130
131 $ make pkg-rpm
132
andrewa38d0012018-08-06 00:25:33 -0400133Once the packages are builty they can be found in the build-root directory.
John DeNisco06dcd452018-07-26 12:45:10 -0400134
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
andrewa38d0012018-08-06 00:25:33 -0400146Finally, the packages can be installed with the following:
147
148For Ubuntu:
John DeNisco06dcd452018-07-26 12:45:10 -0400149
150.. code-block:: console
151
152 $ sudo bash
153 # dpkg -i *.deb
andrewa38d0012018-08-06 00:25:33 -0400154
155For Centos or Redhat:
156
157.. code-block:: console
158
159 $ sudo bash
160 # rpm -ivh *.rpm