2018-07-26 12:45:10 -04:00
|
|
|
.. _building:
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
|
|
|
Building VPP
|
|
|
|
============
|
|
|
|
|
|
|
|
To get started developing with VPP you need to get the sources and build the packages.
|
|
|
|
|
|
|
|
.. _setupproxies:
|
|
|
|
|
|
|
|
Set up Proxies
|
2018-08-06 00:25:33 -04:00
|
|
|
--------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
Depending on the environment, proxies may need to be set.
|
|
|
|
You may run these commands:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ export http_proxy=http://<proxy-server-name>.com:<port-number>
|
|
|
|
$ export https_proxy=https://<proxy-server-name>.com:<port-number>
|
|
|
|
|
|
|
|
|
|
|
|
Get the VPP Sources
|
2018-08-06 00:25:33 -04:00
|
|
|
-----------------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
To get the VPP sources and get ready to build execute the following:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ git clone https://gerrit.fd.io/r/vpp
|
|
|
|
$ cd vpp
|
|
|
|
|
|
|
|
Build VPP Dependencies
|
2018-08-06 00:25:33 -04:00
|
|
|
--------------------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
Before building, make sure there are no FD.io VPP or DPDK packages installed by entering the following
|
|
|
|
commands:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ dpkg -l | grep vpp
|
|
|
|
$ dpkg -l | grep DPDK
|
|
|
|
|
|
|
|
There should be no output, or packages showing after each of the above commands.
|
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
Run these commands to install the dependencies for FD.io VPP.
|
2018-07-26 12:45:10 -04:00
|
|
|
If it hangs during downloading at any point, you may need to set up :ref:`proxies for this to work <setupproxies>`.
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ make install-dep
|
|
|
|
Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
|
|
|
|
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
|
|
|
|
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
|
|
|
|
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
|
|
|
|
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [803 kB]
|
|
|
|
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [732 kB]
|
|
|
|
...
|
|
|
|
...
|
|
|
|
Update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
|
|
|
|
Setting up default-jdk-headless (2:1.8-56ubuntu2) ...
|
|
|
|
Processing triggers for libc-bin (2.23-0ubuntu3) ...
|
|
|
|
Processing triggers for systemd (229-4ubuntu6) ...
|
|
|
|
Processing triggers for ureadahead (0.100.0-19) ...
|
|
|
|
Processing triggers for ca-certificates (20160104ubuntu1) ...
|
|
|
|
Updating certificates in /etc/ssl/certs...
|
|
|
|
0 added, 0 removed; done.
|
|
|
|
Running hooks in /etc/ca-certificates/update.d...
|
|
|
|
|
|
|
|
done.
|
|
|
|
done.
|
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
Build VPP (Debug)
|
|
|
|
----------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
This build version contains debug symbols which is useful to modify VPP. The command
|
|
|
|
below will build debug version of VPP. The binaries when building the debug images
|
|
|
|
can be found in /build-root/vpp_debug-native.
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ make build
|
|
|
|
make[1]: Entering directory '/home/vagrant/vpp-master/build-root'
|
|
|
|
@@@@ Arch for platform 'vpp' is native @@@@
|
|
|
|
@@@@ Finding source for dpdk @@@@
|
|
|
|
@@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/dpdk.mk @@@@
|
|
|
|
@@@@ Source found in /home/vagrant/vpp-master/dpdk @@@@
|
|
|
|
@@@@ Arch for platform 'vpp' is native @@@@
|
|
|
|
@@@@ Finding source for vpp @@@@
|
|
|
|
@@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/vpp.mk @@@@
|
|
|
|
@@@@ Source found in /home/vagrant/vpp-master/src @@@@
|
|
|
|
...
|
|
|
|
...
|
|
|
|
make[5]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
|
|
|
|
make[4]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java'
|
|
|
|
make[3]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
|
|
|
|
make[2]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp'
|
|
|
|
@@@@ Installing vpp: nothing to do @@@@
|
|
|
|
make[1]: Leaving directory '/home/vagrant/vpp-master/build-root'
|
|
|
|
|
|
|
|
Build VPP (Release Version)
|
2018-08-06 00:25:33 -04:00
|
|
|
-----------------------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
To build the release version of FD.io VPP. This build is optimized and will not create debug symbols.
|
|
|
|
The binaries when building the release images can be found in /build-root/vpp-native.
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
$ make build-release
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
Building Necessary Packages
|
2018-08-06 00:25:33 -04:00
|
|
|
--------------------------------------------
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
To build the debian packages, one of the following commands below depending on the system:
|
|
|
|
|
|
|
|
Building Debian Packages
|
2018-08-06 00:25:33 -04:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ make pkg-deb
|
|
|
|
|
|
|
|
|
|
|
|
Building RPM Packages
|
2018-08-06 00:25:33 -04:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ make pkg-rpm
|
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
Once the packages are builty they can be found in the build-root directory.
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ ls *.deb
|
|
|
|
|
|
|
|
If packages built correctly, this should be the Output
|
|
|
|
|
|
|
|
vpp_18.07-rc0~456-gb361076_amd64.deb vpp-dbg_18.07-rc0~456-gb361076_amd64.deb
|
|
|
|
vpp-api-java_18.07-rc0~456-gb361076_amd64.deb vpp-dev_18.07-rc0~456-gb361076_amd64.deb
|
|
|
|
vpp-api-lua_18.07-rc0~456-gb361076_amd64.deb vpp-lib_18.07-rc0~456-gb361076_amd64.deb
|
|
|
|
vpp-api-python_18.07-rc0~456-gb361076_amd64.deb vpp-plugins_18.07-rc0~456-gb361076_amd64.deb
|
|
|
|
|
2018-08-06 00:25:33 -04:00
|
|
|
Finally, the packages can be installed with the following:
|
|
|
|
|
|
|
|
For Ubuntu:
|
2018-07-26 12:45:10 -04:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ sudo bash
|
|
|
|
# dpkg -i *.deb
|
2018-08-06 00:25:33 -04:00
|
|
|
|
|
|
|
For Centos or Redhat:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ sudo bash
|
|
|
|
# rpm -ivh *.rpm
|