blob: 15754b53cb9005b247686d3e085f37c56a1a5fd6 [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.
John DeNiscoce96dda2018-08-14 16:04:09 -04009For more information on the build system please refer to :ref:`buildsystem`.
John DeNisco06dcd452018-07-26 12:45:10 -040010
11.. _setupproxies:
12
13Set up Proxies
andrewa38d0012018-08-06 00:25:33 -040014--------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040015
16Depending on the environment, proxies may need to be set.
17You may run these commands:
18
19.. code-block:: console
20
21 $ export http_proxy=http://<proxy-server-name>.com:<port-number>
22 $ export https_proxy=https://<proxy-server-name>.com:<port-number>
23
24
25Get the VPP Sources
andrewa38d0012018-08-06 00:25:33 -040026-----------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040027
John DeNiscoce96dda2018-08-14 16:04:09 -040028To get the VPP sources that are used to create the build, run the following commands:
John DeNisco06dcd452018-07-26 12:45:10 -040029
30.. code-block:: console
31
32 $ git clone https://gerrit.fd.io/r/vpp
33 $ cd vpp
34
35Build VPP Dependencies
andrewa38d0012018-08-06 00:25:33 -040036--------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040037
38Before building, make sure there are no FD.io VPP or DPDK packages installed by entering the following
39commands:
40
41.. code-block:: console
42
43 $ dpkg -l | grep vpp
44 $ dpkg -l | grep DPDK
45
46There should be no output, or packages showing after each of the above commands.
47
John DeNiscoce96dda2018-08-14 16:04:09 -040048Run the following **make** command to install the dependencies for FD.io VPP.
49If it hangs at any point during the download, then you may need to set up
50:ref:`proxies for this to work <setupproxies>`.
John DeNisco06dcd452018-07-26 12:45:10 -040051
52.. code-block:: console
53
54 $ make install-dep
55 Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
56 Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
57 Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
58 Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
59 Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [803 kB]
60 Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [732 kB]
61 ...
62 ...
63 Update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
64 Setting up default-jdk-headless (2:1.8-56ubuntu2) ...
65 Processing triggers for libc-bin (2.23-0ubuntu3) ...
66 Processing triggers for systemd (229-4ubuntu6) ...
67 Processing triggers for ureadahead (0.100.0-19) ...
68 Processing triggers for ca-certificates (20160104ubuntu1) ...
69 Updating certificates in /etc/ssl/certs...
70 0 added, 0 removed; done.
71 Running hooks in /etc/ca-certificates/update.d...
72
73 done.
74 done.
75
andrewa38d0012018-08-06 00:25:33 -040076Build VPP (Debug)
77----------------------------
John DeNisco06dcd452018-07-26 12:45:10 -040078
John DeNiscoce96dda2018-08-14 16:04:09 -040079This build version contains debug symbols which are useful for modifying VPP. The
80**make** command below builds a debug version of VPP. The binaries, when building the
81debug images, can be found in /build-root/vpp_debug-native.
John DeNisco06dcd452018-07-26 12:45:10 -040082
83.. code-block:: console
84
85 $ make build
86 make[1]: Entering directory '/home/vagrant/vpp-master/build-root'
87 @@@@ Arch for platform 'vpp' is native @@@@
88 @@@@ Finding source for dpdk @@@@
89 @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/dpdk.mk @@@@
90 @@@@ Source found in /home/vagrant/vpp-master/dpdk @@@@
91 @@@@ Arch for platform 'vpp' is native @@@@
92 @@@@ Finding source for vpp @@@@
93 @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/vpp.mk @@@@
94 @@@@ Source found in /home/vagrant/vpp-master/src @@@@
95 ...
96 ...
97 make[5]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
98 make[4]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
99 make[3]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
100 make[2]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
101 @@@@ Installing vpp: nothing to do @@@@
102 make[1]: Leaving directory '/home/vagrant/vpp-master/build-root'
103
104Build VPP (Release Version)
andrewa38d0012018-08-06 00:25:33 -0400105-----------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -0400106
andrewa38d0012018-08-06 00:25:33 -0400107To build the release version of FD.io VPP. This build is optimized and will not create debug symbols.
108The binaries when building the release images can be found in /build-root/vpp-native.
John DeNisco06dcd452018-07-26 12:45:10 -0400109
John DeNiscoce96dda2018-08-14 16:04:09 -0400110Use the following **make** command below to build the release version of FD.io VPP. This build is
111optimized and will not create debug symbols. When building the release images, the binaries can
112be found in /build-root/vpp-native.
113
John DeNisco06dcd452018-07-26 12:45:10 -0400114.. code-block:: console
115
andrewa38d0012018-08-06 00:25:33 -0400116 $ make build-release
John DeNisco06dcd452018-07-26 12:45:10 -0400117
118
119Building Necessary Packages
andrewa38d0012018-08-06 00:25:33 -0400120--------------------------------------------
John DeNisco06dcd452018-07-26 12:45:10 -0400121
John DeNisco06dcd452018-07-26 12:45:10 -0400122Building Debian Packages
andrewa38d0012018-08-06 00:25:33 -0400123^^^^^^^^^^^^^^^^^^^^^^^^^
John DeNisco06dcd452018-07-26 12:45:10 -0400124
John DeNiscoce96dda2018-08-14 16:04:09 -0400125To build the debian packages, use one of the following commands below, depending on the system:
126
John DeNisco06dcd452018-07-26 12:45:10 -0400127.. code-block:: console
128
129 $ make pkg-deb
130
John DeNisco06dcd452018-07-26 12:45:10 -0400131Building RPM Packages
andrewa38d0012018-08-06 00:25:33 -0400132^^^^^^^^^^^^^^^^^^^^^^^
John DeNisco06dcd452018-07-26 12:45:10 -0400133
John DeNiscoce96dda2018-08-14 16:04:09 -0400134To build the rpm packages, use one of the following commands below, depending on the system:
135
John DeNisco06dcd452018-07-26 12:45:10 -0400136.. code-block:: console
137
138 $ make pkg-rpm
139
andrewa38d0012018-08-06 00:25:33 -0400140Once the packages are builty they can be found in the build-root directory.
John DeNisco06dcd452018-07-26 12:45:10 -0400141
142.. code-block:: console
143
144 $ ls *.deb
145
146 If packages built correctly, this should be the Output
147
148 vpp_18.07-rc0~456-gb361076_amd64.deb vpp-dbg_18.07-rc0~456-gb361076_amd64.deb
149 vpp-api-java_18.07-rc0~456-gb361076_amd64.deb vpp-dev_18.07-rc0~456-gb361076_amd64.deb
150 vpp-api-lua_18.07-rc0~456-gb361076_amd64.deb vpp-lib_18.07-rc0~456-gb361076_amd64.deb
151 vpp-api-python_18.07-rc0~456-gb361076_amd64.deb vpp-plugins_18.07-rc0~456-gb361076_amd64.deb
152
andrewa38d0012018-08-06 00:25:33 -0400153Finally, the packages can be installed with the following:
154
155For Ubuntu:
John DeNisco06dcd452018-07-26 12:45:10 -0400156
157.. code-block:: console
158
159 $ sudo bash
160 # dpkg -i *.deb
andrewa38d0012018-08-06 00:25:33 -0400161
162For Centos or Redhat:
163
164.. code-block:: console
165
166 $ sudo bash
167 # rpm -ivh *.rpm