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 D274FA0554; Tue, 18 Feb 2020 01:03:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84E941DA83; Tue, 18 Feb 2020 01:02:48 +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 E92861DA92 for ; Tue, 18 Feb 2020 01:02:42 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id a13so20805161ljm.10 for ; Mon, 17 Feb 2020 16:02:42 -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=KqRrEqJRFRftz8s0057ej5A0HfY0B+hLlC0CZAouhbw=; b=SvuwuRgA5yA4SN9UOlYsWRiJ4kRocus6vYbA0u2Tga/qXFtjwA8bS1UPMeyjRK1KX+ dcarxRDbdUQqN+4kB4sZ29SxRgCiuJgfD7XnM8+jCK+cF7WK7H/eHSPbItBU3V1rgWdC uX0JjU9s7HjGwCl1xtHvupn4kjLh4xuzRhr5ktsFg3m+JJ0+tJ1cJsRfupifvJezhQ2L SoycFeU50zK+PXht4aF1hoHEOqd/pN5Sq++Np8+K0yaQhEmiReg+dLG+Y6qmUm4yBDWC fDuQk5CabtWjRMrPiHkTPaR+Qkxn3jdrie1qnSMcb2YEaYPveIjfnqdAB+IpPNpnPPuH 3cuQ== 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=KqRrEqJRFRftz8s0057ej5A0HfY0B+hLlC0CZAouhbw=; b=ljm5jxNvz5N+I/hx3lW+o7Wm3x/fvZyOiK1vA4BTKyqMYI4u4ZC2El41hu/0bYAGed KtZtoFVhQIPQF+5OIr5L9itcB5bXhUo5kDfxS/t9yieuMdfrOaJX1JGBPqbztYR2N0Zs ZVNHTXQpn0vqJDike1HGfe3ut17g0jrzbDkw/JcxsFgU5qIL0lRG5PzLjDjWSfMB+ib4 jnH8K47q8nEqpVs4DDdGax8D2t0lXZi/6ty69JU9ngyenWMNKRvlsTD9cvIo8iyuzwu0 HcDoTJLG6Z7KlRPlwC6NmpdurWf5i9osaXHkPiE1zyBcW6Rl8KNgHLkD2AvgRi2SP+OH KVkQ== X-Gm-Message-State: APjAAAWCV4M6NrcRX8kXDUgIN15EvIOT/b5g3iiQYW0fM7an1uuXnl5u YKZgQFufu08eFhcUeJ0q9B0Umb73HC4= X-Google-Smtp-Source: APXvYqyCQt5DUFFHRxp6r+12tGVRHcoyYRtkBu4Ry3IzCqTw/A5bPVGEfi0s9fRXZhms5xhNpP14AA== X-Received: by 2002:a2e:8e63:: with SMTP id t3mr11187091ljk.239.1581984162229; Mon, 17 Feb 2020 16:02:42 -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 r20sm1068864lfi.91.2020.02.17.16.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 16:02:41 -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: Tue, 18 Feb 2020 03:02:28 +0300 Message-Id: <20200218000229.86621-7-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 | 63 +++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/doc/guides/windows_gsg/build_dpdk.rst b/doc/guides/windows_gsg/build_dpdk.rst index 6711e07e2..c77384785 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,12 @@ 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.47.1 is recommended, Meson 0.52 is the latest version known + to build DPDK successfully. Meson 0.53 has fatal issues with Clang + that prevent both native and cross-compilation. + Install the Backend ------------------- @@ -56,23 +78,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 +127,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.0