From patchwork Wed Sep 20 15:48:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dave Young X-Patchwork-Id: 131745 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E9EE425F1; Wed, 20 Sep 2023 17:49:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EE2F410E3; Wed, 20 Sep 2023 17:49:53 +0200 (CEST) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by mails.dpdk.org (Postfix) with ESMTP id E485940ED2 for ; Wed, 20 Sep 2023 17:49:50 +0200 (CEST) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-59be81cf0d8so7215127b3.0 for ; Wed, 20 Sep 2023 08:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=youngcopy-com.20230601.gappssmtp.com; s=20230601; t=1695224990; x=1695829790; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KK9VyI49layBKZYhNrRz+kEOLivwLK4sFFqNWsOqpYk=; b=WaotOTKZTGIeMjpiU2X43HtyQeObsCw91nKVcGXN+o2+tI3MiKJW+wiOInEbolOGyL R7+Is/Mf4ga+SMggyP1xAkcHPUiKD2TMnD3asAnFhZK8x16qes54VFdkj/rLSnXqgvtA mLJwLm6xNM2ZVvBgm6Ed3ymEUEpILI02C6y7ckBV/dZEc+X6TT7FRb68aNHJPMjlqw5f xP1nGlmFZrIT1srGcAbtS1jruTjNSEHM+7mh8sym6fcyCNY5H6+BDIBJ59DFgmD6OKOF FxVCMR9KoFAzFqVjSolohgGkaGUWaEmWB8s7LOjg/C/2Y21D/y2UC7So9LPncKoxS3RB OKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695224990; x=1695829790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KK9VyI49layBKZYhNrRz+kEOLivwLK4sFFqNWsOqpYk=; b=TQyA7n0ydgA5sts3IhpVD9Haxyrys6M+bsFUDfMnpfdcF+6+NE2wzYu/Ll1DtmhkUs Kkw+q/BSD/wcawnM3PvdaH4G6uNhfXIQIeTWGskw26V/gRYjOq0U+plD34IaqnBBZ5ol TQCke5JANk/Tp9ONLrumRAhOON4ipalj0mK6J+OSPfG/cXiSR726jvIO+QcoWs0Ch8mt qKB9HJBAM+ROqRdDYy5EhgUp1cjochq4BW9SMNfujLBqITzxMlmzX10Dy0ss9cxdtQiC A0WE7YMcJxL69cfBH+ETfKkco0ECE9YOVbw2BYuSv8R3Yf3xwU2xVB5SccCyQbjCrzOf UZKQ== X-Gm-Message-State: AOJu0Yw8vOJWv96/P2lgGnrr39xjFCC803m/3UkKb8NvxGupAXY6bIma Vp2SndJNaI61u0t0C/AVNZWNxmenW5IAormysG8= X-Google-Smtp-Source: AGHT+IEKHVU9mgXe9fXMecY0oFmrxCKcoUXGUIXwb/8Ztpo6m5LcpbKX9cWXkwalFzkMZ+duneN+5Q== X-Received: by 2002:a0d:dfc5:0:b0:583:adc6:10b8 with SMTP id i188-20020a0ddfc5000000b00583adc610b8mr2453906ywe.3.1695224989791; Wed, 20 Sep 2023 08:49:49 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:20c0:a560:1d8e:3ea8:ad75:14a1]) by smtp.gmail.com with ESMTPSA id r2-20020a818102000000b0059a34cfa2a5sm3806348ywf.67.2023.09.20.08.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 08:49:49 -0700 (PDT) From: David Young To: dev@dpdk.org Cc: Bruce Richardson , David Young Subject: [PATCH 2/6] Section 2: Install and Build DPDK Date: Wed, 20 Sep 2023 11:48:06 -0400 Message-ID: <20230920154817.617-3-dave@youngcopy.com> X-Mailer: git-send-email 2.41.0.windows.1 In-Reply-To: <20230920154817.617-1-dave@youngcopy.com> References: <20230920154817.617-1-dave@youngcopy.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --- .../building_from_sources.rst | 108 ++++++++++++++++++ .../install_and_build/index.rst | 15 +++ .../installing_prebuilt_packages.rst | 54 +++++++++ .../windows_install_build.rst | 93 +++++++++++++++ 4 files changed, 270 insertions(+) create mode 100644 doc/guides/getting_started_guide/install_and_build/building_from_sources.rst create mode 100644 doc/guides/getting_started_guide/install_and_build/index.rst create mode 100644 doc/guides/getting_started_guide/install_and_build/installing_prebuilt_packages.rst create mode 100644 doc/guides/getting_started_guide/install_and_build/windows_install_build.rst diff --git a/doc/guides/getting_started_guide/install_and_build/building_from_sources.rst b/doc/guides/getting_started_guide/install_and_build/building_from_sources.rst new file mode 100644 index 0000000000..e4ee8e436d --- /dev/null +++ b/doc/guides/getting_started_guide/install_and_build/building_from_sources.rst @@ -0,0 +1,108 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2010-2025 Intel Corporation. + +.. _building_from_sources: + +Building and Installing DPDK from Sources +========================================= + +This chapter provides a comprehensive guide for building DPDK from sources on both +Linux and FreeBSD platforms. It covers the necessary steps, prerequisites, +and considerations for different architectures and compilers. + +Required Tools +-------------- + +To build DPDK, you'll need the following tools: + +- A C compiler like ``gcc`` (version 5+) or ``clang`` (version 3.6+) +- ``pkg-config`` or ``pkgconf`` +- Python 3.6 or later +- ``meson`` (version 0.53.2+) and ``ninja`` +- ``pyelftools`` (version 0.22+) + +Here's how to install them: + +Linux +^^^^^ + +Alpine + +.. code-block:: bash + + sudo apk add alpine-sdk bsd-compat-headers + pip install meson ninja + +Debian and Ubuntu and derivatives + +.. code-block:: bash + + sudo apt install build-essential + pip install meson ninja + +Fedora and RedHat Enterprise Linux RHEL + +.. code-block:: bash + + sudo dnf groupinstall "Development Tools" + pip install meson ninja + +openSUSE + +.. code-block:: bash + + sudo zypper install -t pattern devel_basis python3-pyelftools + pip install meson ninja + +FreeBSD +^^^^^^^ + +FreeBSD (as root) + +.. code-block:: bash + + pkg install meson pkgconf py38-pyelftools + +Note: If you're using FreeBSD, you'll also need kernel sources. Make sure they're included during the FreeBSD installation. + +Getting the DPDK Source +----------------------- + +Download the DPDK source code from the official repository +``https://fast.dpdk.org/rel/``. + +Use ``wget`` to grab the DPDK version:: + + wget https://fast.dpdk.org/rel/dpdk-.tar.xz + +Extract the downloaded archive: + +.. code-block:: bash + + tar -xvf dpdk-.tar.gz + +Navigate to the DPDK directory: + +.. code-block:: bash + + cd dpdk- + +Building DPDK +------------- + +Configure the build based on your needs, hardware, and environment. +This might include setting specific flags or options. For example: “meson setup -Dbuildtype=debugoptimized build”. Then compile using “ninja” and install using “meson install”. + +.. code-block:: bash + + ninja -C build + cd build + sudo ninja install + ldconfig + +For detailed information on Meson build configuration options specific to DPDK, see :ref:`DPDK Meson Build Configuration Options `. + +Cross-Compilation Instructions for Different Architectures +---------------------------------------------------------- + +For instructions on building DPDK for ARM64, LoongArch, and RISC-V, refer to :ref:`cross_compile_dpdk`. diff --git a/doc/guides/getting_started_guide/install_and_build/index.rst b/doc/guides/getting_started_guide/install_and_build/index.rst new file mode 100644 index 0000000000..f4d8740fb6 --- /dev/null +++ b/doc/guides/getting_started_guide/install_and_build/index.rst @@ -0,0 +1,15 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2010-2025 Intel Corporation. + +.. _install_and_build: + +Install and Build DPDK +====================== + +.. toctree:: + :maxdepth: 2 + + + installing_prebuilt_packages + building_from_sources + windows_install_build \ No newline at end of file diff --git a/doc/guides/getting_started_guide/install_and_build/installing_prebuilt_packages.rst b/doc/guides/getting_started_guide/install_and_build/installing_prebuilt_packages.rst new file mode 100644 index 0000000000..3e395d65f1 --- /dev/null +++ b/doc/guides/getting_started_guide/install_and_build/installing_prebuilt_packages.rst @@ -0,0 +1,54 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2010-2025 Intel Corporation. + +.. _installing_prebuilt_packages: + +Installing Pre-built Packages +============================= + +Pre-built packages provide a convenient way to install DPDK without the need to compile +the source code manually. These packages are created and maintained by the DPDK +community or OS vendors and are available for various operating systems and +distributions. + +Available Distributions +----------------------- + +Linux +^^^^^ + +Pre-built DPDK packages are available for several popular Linux distributions, +including but not limited to: + +Alpine + +.. code-block:: bash + + sudo apk add dpdk + +Debian and Ubuntu and derivatives + +.. code-block:: bash + + sudo apt-get install dpdk + +Fedora and RedHat Enterprise Linux RHEL + +.. code-block:: bash + + sudo dnf install dpdk + +openSUSE + +.. code-block:: bash + + sudo zypper install dpdk + +FreeBSD +^^^^^^^ + +To install DPDK on FreeBSD, use the following command: + +.. code-block:: bash + + sudo pkg install dpdk \ No newline at end of file diff --git a/doc/guides/getting_started_guide/install_and_build/windows_install_build.rst b/doc/guides/getting_started_guide/install_and_build/windows_install_build.rst new file mode 100644 index 0000000000..ea0e131766 --- /dev/null +++ b/doc/guides/getting_started_guide/install_and_build/windows_install_build.rst @@ -0,0 +1,93 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2010-2015 Intel Corporation. + +.. _windows_install_build: + +Windows DPDK Build +================== + +Before you begin the process of building DPDK on Windows, +make sure your system meets all the necessary requirements as outlined below. + +Windows System Requirements +--------------------------- + +Building the DPDK and its applications on Windows requires one of the following +environments: + +- The Clang-LLVM C compiler and Microsoft MSVC linker. +- The MinGW-w64 toolchain (either native or cross). + +The Meson Build system is used to prepare the sources for compilation with the Ninja backend. + +Option 1: Clang-LLVM C Compiler and Microsoft MSVC Linker +--------------------------------------------------------- + +1. Install the Compiler: Download and install the clang compiler from the +`LLVM website `_. + +2. Install the Linker: Download and install the Build Tools for Visual Studio from the +`Microsoft website `_. +When installing build tools, select the “Visual C++ build tools” option and make sure +the Windows SDK is selected. + +Option 2: MinGW-w64 Toolchain +----------------------------- + +1. On Linux (for cross-compilation): Install MinGW-w64 via a package manager. +Version 4.0.4 for Ubuntu 16.04 cannot be used due to a MinGW-w64 bug. + +2. On Windows: Obtain the latest version installer from the +`MinGW-w64 repository `_. +Any thread model (POSIX or Win32) can be chosen, DPDK does not rely on it. +Install to a folder without spaces in its name, like ``C:\MinGW``. +This path is assumed for the rest of this guide. + +Install the Build System +------------------------ + +Download and install the build system from the +`Meson website `_. +A good option to choose is the MSI installer for both meson and ninja together. +Recommended version is either Meson 0.57.0 (baseline) or the latest release. + +Install the Backend +------------------- + +If using Ninja, download and install the backend from the +`Ninja website `_ or install along with the meson build +system. + +Once you have verified that your system meets these requirements, +you can proceed with the following steps to build DPDK. + +Build the Code +-------------- + +The build environment is setup to build the EAL and the helloworld example by default. +To compile the examples, the flag -Dexamples is required. + +**Option 1. Native Build on Windows** + +When using Clang-LLVM, specifying the compiler might be required to complete the meson +command:: + + set CC=clang + +When using MinGW-w64, it is sufficient to have toolchain executables in PATH:: + + set PATH=C:\MinGW\mingw64\bin;%PATH% + +To compile the examples:: + + cd C:\Users\me\dpdk + meson -Dexamples=helloworld build + ninja -C build + +**Option 2. Cross-Compile with MinGW-w64** + +The cross-file option must be specified for Meson. +Depending on the distribution, paths in this file may need adjustments:: + + meson --cross-file config/x86/cross-mingw -Dexamples=helloworld build + ninja -C build \ No newline at end of file