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 3551AA054F; Tue, 18 Feb 2020 22:28:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A22E1C000; Tue, 18 Feb 2020 22:28:25 +0100 (CET) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by dpdk.org (Postfix) with ESMTP id 25F131BFFA for ; Tue, 18 Feb 2020 22:28:24 +0100 (CET) Received: by mail-qv1-f68.google.com with SMTP id l14so9826340qvu.12 for ; Tue, 18 Feb 2020 13:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qF21h56PpvhjetsOpJ0XYgz1hqD1Y+9CY+odld/T0hE=; b=q3PJLas5WdwnquDYpIHLuJsLqwHRUjB/SnK7nIqcmE0S32iuD6IRjSYkv/zZ/JCfm4 DfWOh1slSQ+ggFDxt5mOYyUK4eDWgEoGadNzHPWalu2U0ZROu2VLLSPFopEa3a1CqYvl x91zx+0fm5w53AXotzlMecLT23doo1AewPnQuxMAvsE8hpjNzDtJlUiHBrV7C0FhDi12 s0qclYyx727R8zl2US0y2qlUYaTPPwDpyJE/LBwp0/q5Hb0qGTqZtEPa8hctMimEeSPn Y8FiIJEN+9XpwYCoz6s+6mZBxeN4aR9AkwhmODMAEq2/J4Vu1xmwK4iLSBn3OtJ8wpCC BEtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qF21h56PpvhjetsOpJ0XYgz1hqD1Y+9CY+odld/T0hE=; b=A+IdWMTwM8bXYa+tNHeA4XBiBnFsX+s4LrMNpG7ko5v+bfn18LtI7YKRAmsidYUNkL 7prTD1wwcrMgaCtIWLLpcgBTztaGxwlbXpXGsYj1DCuMSspgCS4PU3YM1RqCDat/wNF2 W9pHgcuu1Vf91vwYYDv94h1PqKYsrVMswX0mC6wJ7q0xXatgWXKDNNIoJNxdNWTSkqED Tn7RXQFrYPU4W+xFl0aIBwzILctwkH1C894wNeYBcdGOXmE/Fhq1P/lLHZPGSMSoZEyk 6hK5tdFhE2Bp7oryjMM4WSuZXsb2D4NY85LwS3KQuiqs692qG1LTDCIVW3x6FuLrjnTl 6tZA== X-Gm-Message-State: APjAAAWQF539fEihkO/jhwfgqPn31/ks0OMBEWAss6w2O8nzFYLBGrxb CMP5m7UnM4svmW9ec+L1xvIqDilJWzdDFgNiN84= X-Google-Smtp-Source: APXvYqxXvCufsNg3+U9R42xmArXvDsv+wZiH2xZMt7cV4OdEJkFDwK4jgoly/GZDBMoBuOc3dI4YjfV3Tr3Ky+EYhZk= X-Received: by 2002:a0c:f6cd:: with SMTP id d13mr18065645qvo.20.1582061302947; Tue, 18 Feb 2020 13:28:22 -0800 (PST) MIME-Version: 1.0 References: <20200218000229.86621-1-dmitry.kozliuk@gmail.com> <20200218000229.86621-7-dmitry.kozliuk@gmail.com> In-Reply-To: <20200218000229.86621-7-dmitry.kozliuk@gmail.com> From: William Tu Date: Tue, 18 Feb 2020 13:27:47 -0800 Message-ID: To: Dmitry Kozlyuk Cc: dev@dpdk.org, Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , Ranjit Menon , John McNamara , Marko Kovacevic Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Mon, Feb 17, 2020 at 4:03 PM Dmitry Kozlyuk wrote: > > 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). > -- btw, just share my experience. Using mingw-w64 4.0.4 on ubuntu 1604 does not work due to lib/librte_eal.a(librte_eal_common_eal_common_thread.c.obj):eal_common_thread.c:(.text+0x1f): undefined reference to `EnterSynchronizationBarrier' https://sourceforge.net/p/mingw-w64/bugs/562/ This is fixed in mingw-w64 5.0.3 ubuntu 1804. William