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 51F2EA0524; Fri, 31 Jan 2020 04:08:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 643B41C0D8; Fri, 31 Jan 2020 04:08:05 +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 A15C31C0B9 for ; Fri, 31 Jan 2020 04:07:57 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id q8so5620464ljb.2 for ; Thu, 30 Jan 2020 19:07:57 -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=kYup3UILgKLePgHKM51+bveaaI7180cEgRh4dsMKBa4=; b=mP/KPbSzsLjC2pdTwYUzpiVZ7/T8SDzM6PPQD9WQvEororD2VRTSZ3CnF5TBeP/pI1 fdijYAgpcNFiAspiceFTnvsKBVAnKx/WaKk0R2iSadOMFtwAaU6r7XKnq0SneI89OmOO QzitjZ2P6vU6f9XuOBEVu3Emb6NqDgQG0rvbIjjmI3dLaHVp1O4P6kwRJLlGIq1APxag WmKCK/ZnqveJJgMH8sCi2gvvNmBz8BvbmNhJDiayWrmUmyBkCDWtRZDNbfLT3Ry05/wD BGY8oceSP6NRxoMlArwCz9rw/dr4K9AzUnUZKKaOKf+BY+CZD+qd5op8souljOgkNcFa nRZA== 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=kYup3UILgKLePgHKM51+bveaaI7180cEgRh4dsMKBa4=; b=l73+uHXfRPOsqBj260fZhsLeh5ms5YfRzx6150gIgjruuKbG2PCu0DwTsSOPi99fgw HtQeVC9LPyk9HV3D4BoiqdaFPM0bQdcvyOgf/+5cdZAKf3RPRDg6hhz5Ln8BE0+ODjv7 AQri4HYLNkSwy02sGco5cA7EL3QIjArHny+4MIwIEhWdguHp2ulSO8cRs43Q1gRMFDMj ryuBv9Es+pM22Vq9NU+kmHwei5WGSi358+ihMUF3acC/QKR/IRV0LYQCnpDTmwosGSFN 2iB5zRUHiZpo7xmktWrtF8sMFLk/2pV069qINvf9TxlBUfCTKoToRs5NjOpOwO8vPSBJ y+QQ== X-Gm-Message-State: APjAAAU703cvgQVSzzdyNns5fj7laprvzf1xcm2RiWxDz8m7Kgkldd0B lwaiv3/bATSvj7jFL1rBpicss8GMeFWS2Q== X-Google-Smtp-Source: APXvYqxmQi9M5pEEtDfes3rpzGZiki4TrYjU+lRaed5VfJBCRuEr7BwE1Bulh3ynLlBhWNyWUogi2g== X-Received: by 2002:a2e:88c5:: with SMTP id a5mr4707961ljk.201.1580440076869; Thu, 30 Jan 2020 19:07:56 -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 e12sm3630332lfc.70.2020.01.30.19.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 19:07:56 -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: Fri, 31 Jan 2020 06:07:44 +0300 Message-Id: <20200131030744.19596-7-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200131030744.19596-1-dmitry.kozliuk@gmail.com> References: <20200131030744.19596-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 6/6] 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 diff --git a/doc/guides/windows_gsg/build_dpdk.rst b/doc/guides/windows_gsg/build_dpdk.rst index 6711e07e2..eabc459fb 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 ------------------------ @@ -56,23 +72,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 meson_mingw.txt -Dexamples=helloworld build + ninja -C build + Run the helloworld example ========================== @@ -87,3 +121,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