From patchwork Thu Feb 6 06:44:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 65614 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EBD09A04FA; Thu, 6 Feb 2020 07:46:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 347101C114; Thu, 6 Feb 2020 07:44:50 +0100 (CET) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id A4D851C0BC for ; Thu, 6 Feb 2020 07:44:45 +0100 (CET) Received: by mail-lf1-f68.google.com with SMTP id n25so3292215lfl.0 for ; Wed, 05 Feb 2020 22:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T+BJHT9aLjhplHlmKvEnoRrPkDvHR4a9vEMOo5TQDKc=; b=GVAGOePWw3U3eGhD3Kfhzj/AQ++pdWAqUAgoG4KSjpiGmy0tRMdtj1eIBPQkHTTElR AiIEa4DjT8wyYhrgn/SpPoyZpjBRWttzdKvuKqP8bZfmW6LrVjUvITsS/QOhRkSnV4V5 PHHSVNt3WAaMWApDdUh/tk+O8Vi+ny+9riAv3BKYHUA1Y/J8w5+qND6+uTW9NzfJWSsl KZ48jKjO7uJQd7stqL2FiwEkx0wDgM/sivHbsXPb52hxFCGdApqO+RJhtA7xsa/zxj0q UcR0OYj2kDnDKyFYyAvds9pduatI9X+4v1bn5r6XNj0m1tNJ5sqApsJx/XD/JcUR8oYm xHSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+BJHT9aLjhplHlmKvEnoRrPkDvHR4a9vEMOo5TQDKc=; b=h1kBaPeV1220s/0K8LEiPe5pUjXTjopXk89rgrGwdMD8E1N6rLS1lwZxOQ2Sjp84c+ cXLxcnUnKLJGSuW/9NIxpvWqkc6HkBkZhnrmhalMJlBSXld6waJd7O+z7Z+OhDEOYOtp SAIwn2igBTNgNiCNqBwO1ySZLP7kSUBNAW1KZ317aSBBiwADhxuASvqAm+sRE1v+2BtG EcWBuVbkItXUG43hkPji5aWspEX3S2DCv6pDwb8f4fUfOikFUeTtuoJtiC2gvYAt8GAF 5svcs8kS+mKU5XJKWvHpfp44p6HoXlQmDOeO6QE/7xUenQUYXc70gg/etREaIb8M4icy oeng== X-Gm-Message-State: APjAAAWkDYaLeU4fizwzePFq/kxRrNj4oWwa+Tw++iH4clC2d/soYsN0 PrFm4VXI8JJcyjvma5RUNYcp0nSQxfQ= X-Google-Smtp-Source: APXvYqzKwbe9GUCZsg0fFQKLJ52uEkPucEgKcSSFHZeGM9n9U3npILqO7/VpHdKXpPzgeW4yKxtoKA== X-Received: by 2002:ac2:4436:: with SMTP id w22mr903460lfl.185.1580971484884; Wed, 05 Feb 2020 22:44:44 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.googlemail.com with ESMTPSA id o19sm939669lji.54.2020.02.05.22.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 22:44:44 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , Ranjit Menon , John McNamara , Marko Kovacevic Date: Thu, 6 Feb 2020 09:44:26 +0300 Message-Id: <20200206064426.45697-8-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> References: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 7/7] doc: guide for Windows build using MinGW-w64 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" Instructions for different toolchains presented as options on the corresponging steps of the guide, so that common parts may be reused. Signed-off-by: Dmitry Kozlyuk --- doc/guides/windows_gsg/build_dpdk.rst | 65 +++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/doc/guides/windows_gsg/build_dpdk.rst b/doc/guides/windows_gsg/build_dpdk.rst index 6711e07e2..6d093d235 100644 --- a/doc/guides/windows_gsg/build_dpdk.rst +++ b/doc/guides/windows_gsg/build_dpdk.rst @@ -7,15 +7,22 @@ Compiling the DPDK Target from Source System Requirements ------------------- -The DPDK and its applications require the Clang-LLVM C compiler -and Microsoft MSVC linker. +Building the DPDK and its applications 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. The installation of these tools is covered in this section. +Option 1. Clang-LLVM C Compiler and Microsoft MSVC Linker +--------------------------------------------------------- + Install the Compiler --------------------- +~~~~~~~~~~~~~~~~~~~~ Download and install the clang compiler from `LLVM website `_. @@ -25,7 +32,7 @@ For example, Clang-LLVM direct download link:: Install the Linker ------------------- +~~~~~~~~~~~~~~~~~~ Download and install the Build Tools for Visual Studio to link and build the files on windows, @@ -34,6 +41,15 @@ When installing build tools, select the "Visual C++ build tools" option and ensure the Windows SDK is selected. +Option 2. MinGW-w64 Toolchain +----------------------------- + +Obtain the latest version from +`MinGW-w64 website `_. +On Windows, 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 ------------------------ @@ -43,6 +59,14 @@ A good option to choose is the MSI installer for both meson and ninja together:: http://mesonbuild.com/Getting-meson.html#installing-meson-and-ninja-with-the-msi-installer%22 +.. warning:: + + Meson 0.53 has `issue #6431 `_ + that prevents cross-compilation and another linker issue with Clang + (`workaround patch `_). + Meson 0.47.1 is recommended, Meson 0.52 can also be used if new features + are required. + Install the Backend ------------------- @@ -56,23 +80,41 @@ Build the code The build environment is setup to build the EAL and the helloworld example by default. -Using the ninja backend -~~~~~~~~~~~~~~~~~~~~~~~~ +Option 1. Native Build on Windows +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Specifying the compiler might be required to complete the meson command. +When using Clang-LLVM, specifying the compiler might be required to complete +the meson command: .. code-block:: console set CC=clang +When using MinGW-w64, it is sufficient to have toolchain executables in PATH: + +.. code-block:: console + + set PATH=C:\MinGW\mingw64\bin;%PATH% + To compile the examples, the flag ``-Dexamples`` is required. .. code-block:: console cd C:\Users\me\dpdk meson -Dexamples=helloworld build - cd build - ninja + 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. + +.. code-block:: console + + meson --cross-file config/x86/meson_mingw.txt -Dexamples=helloworld build + ninja -C build + Run the helloworld example ========================== @@ -87,3 +129,8 @@ Navigate to the examples in the build directory and run `dpdk-helloworld.exe`. hello from core 3 hello from core 0 hello from core 2 + +Note for MinGW-w64: applications are linked to ``libwinpthread-1.dll`` +by default. To run the example, either add toolchain executables directory +to the PATH or copy the library to the working directory. +Alternatively, static linking may be used (mind the LGPLv2.1 license).