From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7309DA04C3; Fri, 22 Nov 2019 17:05:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C93131BE95; Fri, 22 Nov 2019 17:04:28 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2843D2BB1 for ; Fri, 22 Nov 2019 17:04:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 08:04:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,230,1571727600"; d="scan'208";a="408931113" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by fmsmga006.fm.intel.com with ESMTP; 22 Nov 2019 08:04:15 -0800 From: Bruce Richardson To: john.mcnamara@intel.com Cc: dev@dpdk.org, Bruce Richardson Date: Fri, 22 Nov 2019 16:03:57 +0000 Message-Id: <20191122160359.11625-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191122160359.11625-1-bruce.richardson@intel.com> References: <20191122160359.11625-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 6/8] doc: add meson install instructions for FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Update the FreeBSD GSG doc with instructions for installing using meson and ninja rather than make. Signed-off-by: Bruce Richardson --- doc/guides/freebsd_gsg/build_dpdk.rst | 164 +++++++------------------- 1 file changed, 40 insertions(+), 124 deletions(-) diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst index 7abd85aa5..c5d5379f6 100644 --- a/doc/guides/freebsd_gsg/build_dpdk.rst +++ b/doc/guides/freebsd_gsg/build_dpdk.rst @@ -6,147 +6,63 @@ Compiling the DPDK Target from Source ===================================== -System Requirements -------------------- +Prerequisites +------------- -The DPDK and its applications require the GNU make system (gmake) -to build on FreeBSD. Optionally, gcc may also be used in place of clang -to build the DPDK, in which case it too must be installed prior to -compiling the DPDK. The installation of these tools is covered in this -section. +The following FreeBSD packages are required to build DPDK: -Compiling the DPDK requires the FreeBSD kernel sources, which should be -included during the installation of FreeBSD on the development platform. -The DPDK also requires the use of FreeBSD ports to compile and function. +* meson +* ninja +* pkgconf -To use the FreeBSD ports system, it is required to update and extract the FreeBSD -ports tree by issuing the following commands: +These can be installed using (as root):: -.. code-block:: console - - portsnap fetch - portsnap extract - -If the environment requires proxies for external communication, these can be set -using: - -.. code-block:: console - - setenv http_proxy : - setenv ftp_proxy : - -The FreeBSD ports below need to be installed prior to building the DPDK. -In general these can be installed using the following set of commands:: - - cd /usr/ports/ - - make config-recursive - - make install - - make clean - -Each port location can be found using:: - - whereis - -The ports required and their locations are as follows: - -* dialog4ports: ``/usr/ports/ports-mgmt/dialog4ports`` - -* GNU make(gmake): ``/usr/ports/devel/gmake`` - -* coreutils: ``/usr/ports/sysutils/coreutils`` - -For compiling and using the DPDK with gcc, the compiler must be installed -from the ports collection: - -* gcc: version 4.9 is recommended ``/usr/ports/lang/gcc49``. - Ensure that ``CPU_OPTS`` is selected (default is OFF). - -When running the make config-recursive command, a dialog may be presented to the -user. For the installation of the DPDK, the default options were used. - -.. note:: + pkg install meson pkgconf - To avoid multiple dialogs being presented to the user during make install, - it is advisable before running the make install command to re-run the - make config-recursive command until no more dialogs are seen. +To compile the required kernel modules for memory management and working +with physical NIC devices, the kernel sources for FreeBSD also +need to be installed. If not already present on the system, these can be +installed via commands like the following, for FreeBSD 12.1 on x86_64:: + fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.1-RELEASE/src.txz + tar -C / -xJvf src.txz -Install the DPDK and Browse Sources ------------------------------------ +To enable the telemetry library in DPDK, the jansson library also needs to +be installed, and can be installed via:: -First, uncompress the archive and move to the DPDK source directory: + pkg install jansson -.. code-block:: console - - unzip DPDK-.zip - cd DPDK- - -The DPDK is composed of several directories: - -* lib: Source code of DPDK libraries - -* app: Source code of DPDK applications (automatic tests) - -* examples: Source code of DPDK applications - -* config, buildtools, mk: Framework-related makefiles, scripts and configuration - -Installation of the DPDK Target Environments --------------------------------------------- - -The format of a DPDK target is:: - - ARCH-MACHINE-EXECENV-TOOLCHAIN - -Where: +Individual drivers may have additional requirements. Consult the relevant +driver guide for any driver-specific requirements of interest. -* ``ARCH`` is: ``x86_64`` +Building DPDK +------------- -* ``MACHINE`` is: ``native`` +The following commands can be used to build and install DPDK on a system. +The final, install, step generally needs to be run as root:: -* ``EXECENV`` is: ``freebsd`` + meson build + cd build + ninja + ninja install -* ``TOOLCHAIN`` is: ``gcc`` | ``clang`` - -The configuration files for the DPDK targets can be found in the DPDK/config -directory in the form of:: - - defconfig_ARCH-MACHINE-EXECENV-TOOLCHAIN +This will install the DPDK libraries and drivers to `/usr/local/lib` with a +pkg-config file `libdpdk.pc` installed to `/usr/local/lib/pkgconfig`. The +DPDK test applications, such as `dpdk-testpmd` are installed to +`/usr/local/bin`. To use these applications, it is recommended that the +`contigmem` and `nic_uio` kernel modules be loaded first, as described in +the next section. .. note:: - Configuration files are provided with the ``RTE_MACHINE`` optimization level set. - Within the configuration files, the ``RTE_MACHINE`` configuration value is set - to native, which means that the compiled software is tuned for the platform - on which it is built. For more information on this setting, and its - possible values, see the *DPDK Programmers Guide*. - -To make the target, use ``gmake install T=``. - -For example to compile for FreeBSD use: - -.. code-block:: console - - gmake install T=x86_64-native-freebsd-clang - -.. note:: - - If the compiler binary to be used does not correspond to that given in the - TOOLCHAIN part of the target, the compiler command may need to be explicitly - specified. For example, if compiling for gcc, where the gcc binary is called - gcc4.9, the command would need to be ``gmake install T= CC=gcc4.9``. - -Browsing the Installed DPDK Environment Target ----------------------------------------------- + It is recommended that pkg-config be used to query information + about the compiler and linker flags needed to build applications + against DPDK. In some cases, the path `/usr/local/lib/pkgconfig` + may not be in the default search paths for `.pc` files, which means + that queries for DPDK information may fail. This can be fixed by + setting the appropriate path in `PKG_CONFIG_PATH` environment + variable. -Once a target is created, it contains all the libraries and header files for the -DPDK environment that are required to build customer applications. -In addition, the test and testpmd applications are built under the build/app -directory, which may be used for testing. A kmod directory is also present that -contains the kernel modules to install. .. _loading_contigmem: -- 2.21.0