John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 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. |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame^] | 9 | For more 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 | |
| 16 | Depending on the environment, proxies may need to be set. |
| 17 | You 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 | |
| 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 | |
| 38 | Before building, make sure there are no FD.io VPP or DPDK packages installed by entering the following |
| 39 | commands: |
| 40 | |
| 41 | .. code-block:: console |
| 42 | |
| 43 | $ dpkg -l | grep vpp |
| 44 | $ dpkg -l | grep DPDK |
| 45 | |
| 46 | There should be no output, or packages showing after each of the above commands. |
| 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. |
| 49 | If it hangs at any point during the download, then you may need to set up |
| 50 | :ref:`proxies for this to work <setupproxies>`. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 51 | |
| 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 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 76 | Build VPP (Debug) |
| 77 | ---------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 78 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame^] | 79 | This 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 |
| 81 | debug images, can be found in /build-root/vpp_debug-native. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 82 | |
| 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 | |
| 104 | Build VPP (Release Version) |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 105 | ----------------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 106 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 107 | To build the release version of FD.io VPP. This build is optimized and will not create debug symbols. |
| 108 | The binaries when building the release images can be found in /build-root/vpp-native. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 109 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame^] | 110 | Use the following **make** command below to build the release version of FD.io VPP. This build is |
| 111 | optimized and will not create debug symbols. When building the release images, the binaries can |
| 112 | be found in /build-root/vpp-native. |
| 113 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 114 | .. code-block:: console |
| 115 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 116 | $ make build-release |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 117 | |
| 118 | |
| 119 | Building Necessary Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 120 | -------------------------------------------- |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 121 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 122 | Building Debian Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 123 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 124 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame^] | 125 | To build the debian packages, use one of the following commands below, depending on the system: |
| 126 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 127 | .. code-block:: console |
| 128 | |
| 129 | $ make pkg-deb |
| 130 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 131 | Building RPM Packages |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 132 | ^^^^^^^^^^^^^^^^^^^^^^^ |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 133 | |
John DeNisco | ce96dda | 2018-08-14 16:04:09 -0400 | [diff] [blame^] | 134 | To build the rpm packages, use one of the following commands below, depending on the system: |
| 135 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 136 | .. code-block:: console |
| 137 | |
| 138 | $ make pkg-rpm |
| 139 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 140 | Once the packages are builty they can be found in the build-root directory. |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 141 | |
| 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 | |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 153 | Finally, the packages can be installed with the following: |
| 154 | |
| 155 | For Ubuntu: |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 156 | |
| 157 | .. code-block:: console |
| 158 | |
| 159 | $ sudo bash |
| 160 | # dpkg -i *.deb |
andrew | a38d001 | 2018-08-06 00:25:33 -0400 | [diff] [blame] | 161 | |
| 162 | For Centos or Redhat: |
| 163 | |
| 164 | .. code-block:: console |
| 165 | |
| 166 | $ sudo bash |
| 167 | # rpm -ivh *.rpm |