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 E2838A055A; Thu, 27 Feb 2020 05:26:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DBAE1BFF3; Thu, 27 Feb 2020 05:26:01 +0100 (CET) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id CD54C1BFDD for ; Thu, 27 Feb 2020 05:25:55 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id x7so1759655ljc.1 for ; Wed, 26 Feb 2020 20:25:55 -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=4Nixsc32kpWJ4zJ/2CnlOTuLHD9kQffcjsEkC8b9lXs=; b=N0LyoqrINX8OHBiDKjF8Ruue35aY0A+3tN3yrRpVvIJ1+f426C7lPBKwkolF9+dLdM oo9s6mwtDJ9c+CRwa7G45SuzSTx1hAQcUqG0JlHUje9tPNGIkobj/GgKUdvY8h/lnre/ VCcn9YyvAa4jYdnpP2B38qL2Ja4bdTuUBDxL6yp7ok2sdYixqKd02FLVimRp1rrjhnfx QQJhIx2gcVr9TQijih6cBblG90eh/awAZTjegFB4lgHwm2++JnHzR8JTOeTV2Gvv2UQ0 ODsIgaF7f1SWCO7M9weLdqU0c5nQxsA6iEv1C/BHnsU3JQmmLBhbwYFTg9uDeudRE8q+ 9Q1g== 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=4Nixsc32kpWJ4zJ/2CnlOTuLHD9kQffcjsEkC8b9lXs=; b=i4WpMx3Kit8Ay2aNmsBNGpinqffaK7zq5tbPwy8zOdoVNXQwQp3Lmd0GXz1QE3G9zD Wt+gZfJn3+lqwenLSzCK7jCqOPaqhDVQz4O7K8anyhMksYK2oSMV/uA+y6FgxAmi+ptN Hdy/0rBeEK9QuW//obkwU8DePDnZnQz5YiROqEiHLkeizouBqwjOaIMJ0t4NIomQMt1E DNFBWtOU15BTxV6dFHM4vapp3WArs7sP9vVdWtJC9ktoe6N1EMDGCJFEnTBt6Fs0c3Ct J879bFGj6DjsZ7nFsQPF+C2F5aOsFRkXwkEsndumc8aJp6u6FJ/tq6NWjfT9/00G85mO 2iQw== X-Gm-Message-State: ANhLgQ3sig0F2LfM3lONkkrLkJM2GIJdbY71Bl2GPS6SsnmVYIAHYRzt b1uUUsVUKCG1QqGA7iDEu4l9+wh2vZQ= X-Google-Smtp-Source: ADFU+vsLwAIgsSf3EeTV/U46wTOcRT2d/bn2WBMiK4AmUw43nzxu7T+21q7hDI1tkmpqBUMXaIZMbg== X-Received: by 2002:a2e:909a:: with SMTP id l26mr1355245ljg.209.1582777554993; Wed, 26 Feb 2020 20:25:54 -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 g21sm2224350ljj.53.2020.02.26.20.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 20:25:54 -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, 27 Feb 2020 07:25:36 +0300 Message-Id: <20200227042537.187459-7-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227042537.187459-1-dmitry.kozliuk@gmail.com> References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> <20200227042537.187459-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 6/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 | 62 +++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/doc/guides/windows_gsg/build_dpdk.rst b/doc/guides/windows_gsg/build_dpdk.rst index 6711e07e2..d46e84e3f 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,18 @@ 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. + +Version 4.0.4 for Ubuntu 16.04 cannot be used due to a +`MinGW-w64 bug `_. + + Install the Build System ------------------------ @@ -43,6 +62,8 @@ 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 +Recommended version is either Meson 0.47.1 (baseline) or the latest release. + Install the Backend ------------------- @@ -56,23 +77,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 +126,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). -- 2.25.1