John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 1 | .. _building: |
| 2 | |
| 3 | .. toctree:: |
| 4 | |
| 5 | Building VPP |
| 6 | ============ |
| 7 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 8 | To get started developing with VPP, you need to get the required VPP sources and then build the packages. |
| 9 | For more detailed information on the build system please refer to :ref:`buildsystem`. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 10 | |
| 11 | .. _setupproxies: |
| 12 | |
| 13 | Set up Proxies |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 14 | -------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 15 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 16 | Depending on the environment you are operating in, proxies may need to be set. |
| 17 | Run these proxy commands to specify the *proxy-server-name* and corresponding *port-number*: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 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 | |
| 25 | Get the VPP Sources |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 26 | ----------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 27 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 28 | To get the VPP sources that are used to create the build, run the following commands: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 29 | |
| 30 | .. code-block:: console |
| 31 | |
| 32 | $ git clone https://gerrit.fd.io/r/vpp |
| 33 | $ cd vpp |
| 34 | |
| 35 | Build VPP Dependencies |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 36 | -------------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 37 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 38 | Before building a VPP image, make sure there are no FD.io VPP or DPDK packages |
| 39 | installed, by entering the following commands: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 40 | |
| 41 | .. code-block:: console |
| 42 | |
| 43 | $ dpkg -l | grep vpp |
| 44 | $ dpkg -l | grep DPDK |
| 45 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 46 | There should be no output, or no packages shown after the above commands are run. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 47 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 48 | Run the following **make** command to install the dependencies for FD.io VPP. |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 49 | |
| 50 | If the download hangs at any point, then you may need to |
| 51 | :ref:`set up proxies <setupproxies>` for the download to work. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 52 | |
| 53 | .. code-block:: console |
| 54 | |
| 55 | $ make install-dep |
| 56 | Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease |
| 57 | Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] |
| 58 | Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] |
| 59 | Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] |
| 60 | Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [803 kB] |
| 61 | Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [732 kB] |
| 62 | ... |
| 63 | ... |
| 64 | Update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode |
| 65 | Setting up default-jdk-headless (2:1.8-56ubuntu2) ... |
| 66 | Processing triggers for libc-bin (2.23-0ubuntu3) ... |
| 67 | Processing triggers for systemd (229-4ubuntu6) ... |
| 68 | Processing triggers for ureadahead (0.100.0-19) ... |
| 69 | Processing triggers for ca-certificates (20160104ubuntu1) ... |
| 70 | Updating certificates in /etc/ssl/certs... |
| 71 | 0 added, 0 removed; done. |
| 72 | Running hooks in /etc/ca-certificates/update.d... |
| 73 | |
| 74 | done. |
| 75 | done. |
| 76 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 77 | Build VPP (Debug) |
| 78 | ---------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 79 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 80 | This build version contains debug symbols which are useful for modifying VPP. The |
| 81 | **make** command below builds a debug version of VPP. The binaries, when building the |
| 82 | debug images, can be found in /build-root/vpp_debug-native. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 83 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 84 | The Debug build version contains debug symbols, which are useful for troubleshooting |
| 85 | or modifying VPP. The **make** command below, builds a debug version of VPP. The |
| 86 | binaries used for building the debug image can be found in */build-root/vpp_debug-native*. |
| 87 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 88 | .. code-block:: console |
| 89 | |
| 90 | $ make build |
| 91 | make[1]: Entering directory '/home/vagrant/vpp-master/build-root' |
| 92 | @@@@ Arch for platform 'vpp' is native @@@@ |
| 93 | @@@@ Finding source for dpdk @@@@ |
| 94 | @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/dpdk.mk @@@@ |
| 95 | @@@@ Source found in /home/vagrant/vpp-master/dpdk @@@@ |
| 96 | @@@@ Arch for platform 'vpp' is native @@@@ |
| 97 | @@@@ Finding source for vpp @@@@ |
| 98 | @@@@ Makefile fragment found in /home/vagrant/vpp-master/build-data/packages/vpp.mk @@@@ |
| 99 | @@@@ Source found in /home/vagrant/vpp-master/src @@@@ |
| 100 | ... |
| 101 | ... |
| 102 | make[5]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java' |
| 103 | make[4]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp/vpp-api/java' |
| 104 | make[3]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp' |
| 105 | make[2]: Leaving directory '/home/vagrant/vpp-master/build-root/build-vpp_debug-native/vpp' |
| 106 | @@@@ Installing vpp: nothing to do @@@@ |
| 107 | make[1]: Leaving directory '/home/vagrant/vpp-master/build-root' |
| 108 | |
| 109 | Build VPP (Release Version) |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 110 | ----------------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 111 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 112 | This section describes how to build the regular release version of FD.io VPP. The |
| 113 | release build is optimized and does not create any debug symbols. |
| 114 | The binaries used in building the release images are found in */build-root/vpp-native*. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 115 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 116 | Use the following **make** command below to build the release version of FD.io VPP. |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 117 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 118 | .. code-block:: console |
| 119 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 120 | $ make build-release |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 121 | |
| 122 | |
| 123 | Building Necessary Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 124 | -------------------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 125 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 126 | The package that needs to be built depends on the type system VPP will be running on: |
| 127 | |
| 128 | * The :ref:`Debian package <debianpackages>` is built if VPP is going to run on Ubuntu |
| 129 | * The :ref:`RPM package <rpmpackages>` is built if VPP is going to run on Centos or Redhat |
| 130 | |
| 131 | .. _debianpackages: |
| 132 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 133 | Building Debian Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 134 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 135 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 136 | To build the debian packages, use the following command: |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 137 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 138 | .. code-block:: console |
| 139 | |
| 140 | $ make pkg-deb |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 141 | |
| 142 | .. _rpmpackages: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 143 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 144 | Building RPM Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 145 | ^^^^^^^^^^^^^^^^^^^^^^^ |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 146 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame] | 147 | To build the rpm packages, use one of the following commands below, depending on the system: |
| 148 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 149 | .. code-block:: console |
| 150 | |
| 151 | $ make pkg-rpm |
| 152 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 153 | Once the packages are built they can be found in the build-root directory. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 154 | |
| 155 | .. code-block:: console |
| 156 | |
| 157 | $ ls *.deb |
| 158 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 159 | If the packages are built correctly, then this should be the corresponding output: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 160 | |
| 161 | vpp_18.07-rc0~456-gb361076_amd64.deb vpp-dbg_18.07-rc0~456-gb361076_amd64.deb |
| 162 | vpp-api-java_18.07-rc0~456-gb361076_amd64.deb vpp-dev_18.07-rc0~456-gb361076_amd64.deb |
| 163 | vpp-api-lua_18.07-rc0~456-gb361076_amd64.deb vpp-lib_18.07-rc0~456-gb361076_amd64.deb |
| 164 | vpp-api-python_18.07-rc0~456-gb361076_amd64.deb vpp-plugins_18.07-rc0~456-gb361076_amd64.deb |
| 165 | |
John DeNisco | 2ba9dcf | 2018-08-23 14:04:22 -0400 | [diff] [blame] | 166 | Finally, the created packages can be installed using the following commands. Install |
| 167 | the package that correspnds to OS that VPP will be running on: |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 168 | |
| 169 | For Ubuntu: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 170 | |
| 171 | .. code-block:: console |
| 172 | |
| 173 | $ sudo bash |
| 174 | # dpkg -i *.deb |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 175 | |
| 176 | For Centos or Redhat: |
| 177 | |
| 178 | .. code-block:: console |
| 179 | |
| 180 | $ sudo bash |
| 181 | # rpm -ivh *.rpm |