Message ID | 20200206064426.45697-1-dmitry.kozliuk@gmail.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 52B19A04FA; Thu, 6 Feb 2020 07:44:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 92AD51BFAD; Thu, 6 Feb 2020 07:44:40 +0100 (CET) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id F0B6C1BFAA for <dev@dpdk.org>; Thu, 6 Feb 2020 07:44:38 +0100 (CET) Received: by mail-lj1-f193.google.com with SMTP id r19so4888577ljg.3 for <dev@dpdk.org>; Wed, 05 Feb 2020 22:44:38 -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:mime-version :content-transfer-encoding; bh=+dp9pFwFTegkt/cwIWryNUcElOw3Sh66ugtWhg0UpUo=; b=OJI8n/4A1KDStPpOtHzLDqsQMNiWvBtRaJAWBX1E2g7nqruna7YlHE/UjXjyHg0wwz VvhPEmt+CJXa4gEo1Vgm0JIuMOuJBJ52Sotp5OhFdhaRS+9g/nRMm9yk+x1unqZOSs/8 CLbiZZmUpku740FYluL/l4NCgX+tiS7QN2ADcNtrobB9c3FZ2ecuQ3/q/BH/hJSbbML+ RU3nQCtgMz2Q2MHgh4Ej2OVAS1RIFgcdGod71Rj8PPJ3jgNY3Yta4UU4vPH3wBzklspz daQJbE6dLzqG1FboR+EtD8GXDbL1YV3s20uNrJw7aKOKm/ARZZJOSN7pDlT4LxUAyNMF w3yw== 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:mime-version :content-transfer-encoding; bh=+dp9pFwFTegkt/cwIWryNUcElOw3Sh66ugtWhg0UpUo=; b=Ge+mJ7okNrbg/ohzVFcdRvDxjn/lWB8Z/Yw4ApGuGq++lvHSMshNkl8nZdkae/gJ54 mdJZ/6UEHMhvMMjUYxDDjGPC90xI/fxCm96LuL/9GYdbIlxJptK2dn7/Ya3jbS2YkDFV ySYGzQ7Ufx/XfvgAO2oN4MLYLwCxpMGX4RrxNQfYglRfd2L8ZMl8ad7rQ4ALV7PWzP1P wXBHJii1jCQ0NUhKurK0OkByLaTLSMXoZ8bkNMfH9zUrgTW8SyIqSgmEdwVnX9JBzB6B UNMrCNGYNk4dyVGxXQDS2rvBSsLBrzZ2QerMcPlsLPO1xEtR35CJSGQOzhdsC3rhZvgM fqhw== X-Gm-Message-State: APjAAAWxKKsMnuNt+qbGO5UG8obaJ5ArLspwvT+KGFiPCcWA/hRaYVjo SLVhiM1aJKdDJiE1SPF4l73uA6qUkk8= X-Google-Smtp-Source: APXvYqzdT9TnL8nljtuStovJbQgCX518oi0jPDkzJMQhbygdWHAyfRqnDtY1nVyLyq/jL5tmh5wm0A== X-Received: by 2002:a2e:9748:: with SMTP id f8mr1088273ljj.178.1580971478155; Wed, 05 Feb 2020 22:44:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 22:44:37 -0800 (PST) From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> To: dev@dpdk.org Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, Bruce Richardson <bruce.richardson@intel.com>, Thomas Monjalon <thomas@monjalon.net>, Olivier Matz <olivier.matz@6wind.com>, Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>, Omar Cardona <ocardona@microsoft.com>, Pallavi Kadam <pallavi.kadam@intel.com>, Ranjit Menon <ranjit.menon@intel.com>, John McNamara <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com> Date: Thu, 6 Feb 2020 09:44:19 +0300 Message-Id: <20200206064426.45697-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 0/7] MinGW-w64 support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
MinGW-w64 support
|
|
Message
Dmitry Kozlyuk
Feb. 6, 2020, 6:44 a.m. UTC
This patch series add support for building DPDK using MinGW-w64. MinGW-w64 provides GNU toolchain and independent platform SDK on Windows. It also supports cross-compilation to Windows from POSIX systems by providing cross tollchains and libraries [0]. It does NOT emulate a full POSIX environment, like Cygwin or MSYS do. There are advantages in using MinGW-w64 in addition to Clang: 1. Cross-compilation out-of-the-box. MinGW-w64 is provides a pthread implementation, GNU getopt, and Windows platform SDK. 2. Easier porting of POSIX applications using DPDK to Windows, because application code can use the same benefits as mentioned above. 3. Having both primary compilers enabled on Windows provides more diagnostics and generally prevents non-portable code. [0]: http://mingw-w64.org v2 Changes: Add patch to use lowercase system header filenames. Move Meson cross-file for x86 to arch directory. Change wording in comments. Add Meson version warning in documentation. Dmitry Kozlyuk (7): eal: introduce portable format attribute eal: use portable format attribute cmdline: use portable format attribute eal/windows: use lowercase filenames for system headers build: MinGW-w64 support for Meson build: add cross-file for MinGW-w64 doc: guide for Windows build using MinGW-w64 config/meson.build | 14 +++++ config/x86/meson_mingw.txt | 14 +++++ doc/guides/windows_gsg/build_dpdk.rst | 65 ++++++++++++++++++--- lib/librte_cmdline/cmdline.h | 4 +- lib/librte_eal/common/include/rte_common.h | 17 +++++- lib/librte_eal/common/include/rte_debug.h | 2 +- lib/librte_eal/common/include/rte_devargs.h | 2 +- lib/librte_eal/common/include/rte_log.h | 4 +- lib/librte_eal/meson.build | 3 + lib/librte_eal/windows/eal/include/rte_os.h | 4 +- lib/meson.build | 8 ++- 11 files changed, 118 insertions(+), 19 deletions(-) create mode 100644 config/x86/meson_mingw.txt
Comments
On Wed, Feb 5, 2020 at 10:44 PM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote: > > This patch series add support for building DPDK using MinGW-w64. > > MinGW-w64 provides GNU toolchain and independent platform SDK on > Windows. It also supports cross-compilation to Windows from POSIX > systems by providing cross tollchains and libraries [0]. It does NOT > emulate a full POSIX environment, like Cygwin or MSYS do. > > There are advantages in using MinGW-w64 in addition to Clang: > > 1. Cross-compilation out-of-the-box. MinGW-w64 is provides a pthread > implementation, GNU getopt, and Windows platform SDK. > > 2. Easier porting of POSIX applications using DPDK to Windows, because > application code can use the same benefits as mentioned above. > > 3. Having both primary compilers enabled on Windows provides more > diagnostics and generally prevents non-portable code. > > [0]: http://mingw-w64.org > > v2 Changes: > > Add patch to use lowercase system header filenames. > Move Meson cross-file for x86 to arch directory. > Change wording in comments. > Add Meson version warning in documentation. > > Dmitry Kozlyuk (7): > eal: introduce portable format attribute > eal: use portable format attribute > cmdline: use portable format attribute > eal/windows: use lowercase filenames for system headers > build: MinGW-w64 support for Meson > build: add cross-file for MinGW-w64 > doc: guide for Windows build using MinGW-w64 > > config/meson.build | 14 +++++ > config/x86/meson_mingw.txt | 14 +++++ > doc/guides/windows_gsg/build_dpdk.rst | 65 ++++++++++++++++++--- > lib/librte_cmdline/cmdline.h | 4 +- > lib/librte_eal/common/include/rte_common.h | 17 +++++- > lib/librte_eal/common/include/rte_debug.h | 2 +- > lib/librte_eal/common/include/rte_devargs.h | 2 +- > lib/librte_eal/common/include/rte_log.h | 4 +- > lib/librte_eal/meson.build | 3 + > lib/librte_eal/windows/eal/include/rte_os.h | 4 +- > lib/meson.build | 8 ++- > 11 files changed, 118 insertions(+), 19 deletions(-) > create mode 100644 config/x86/meson_mingw.txt > > -- > 2.25.0 > Hi Dmitry, I applied your v2 patch and I did a native build on windows 10. Hit an error showing ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: error: 'for' loop initial declarations are only allowed in C99 mode for (unsigned int socket = 0; socket < ^ ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: note: use option -std=c99 or -std=gnu99 to compile your code Then I fixed them by having separate declaration out side for loop. then $ ninja -C build works However the output looks weird: C:\dpdk\build\examples>dpdk-helloworld.exe EAL: Detected 2 lcore(s) EAL: Detected 1 NUMA nodes hehello fllo frorom cm core 1 ore 0 Regards, William --- more detailed --- C:\dpdk>meson -v 0.53.999 C:\dpdk>gcc -v Reading specs from c:/mingw-w64/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/specs COLLECT_GCC=gcc C:\dpdk>meson --reconfigure -Dexamples=helloworld build The Meson build system Version: 0.53.999 Source dir: C:\dpdk Build dir: C:\dpdk\build Build type: native build Program cat found: NO Program more found: YES (C:\WINDOWS\system32\more.COM) Project name: DPDK Project version: 20.02.0-rc2 C compiler for the host machine: cc (gcc 4.8.3 "cc (GCC) 4.8.3") C linker for the host machine: cc GNU ld.bfd 2.24 Host machine cpu family: x86_64 Host machine cpu: x86_64 Program cat found: NO Program more found: YES (C:\WINDOWS\system32\more.COM) Program ../buildtools/symlink-drivers-solibs.sh found: YES (sh C:\dpdk\config\../buildtools/symlink-drivers-so libs.sh) Checking for size of "void *" : 8 Library m found: YES Library numa found: NO Found pkg-config: C:\mingw-w64\bin\pkg-config.EXE (0.25)
Hi William, I applied your v2 patch and I did a native build on windows 10. > Hit an error showing > ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: error: 'for' loop > initial declarations are only allowed in C99 mode > Thanks, will fix in v3. However the output looks weird: > C:\dpdk\build\examples>dpdk-helloworld.exe > EAL: Detected 2 lcore(s) > EAL: Detected 1 NUMA nodes > hehello fllo frorom cm core 1 > ore 0 > It looks like your stdout is unbuffered (default is line-buffered). What terminal are you using (cmd, Power Shell, Terminal App, conemu, etc)? C compiler for the host machine: cc (gcc 4.8.3 "cc (GCC) 4.8.3") > GCC 4.8.3 is quite outdated, MinGW-w64 ships GCC 8 nowadays. Do we need to support it for Windows (I doubt MinGW-w64 does)? -- Dmitry Kozlyuk >
Hi Dmitry, Thanks for your reply. On Fri, Feb 7, 2020 at 2:24 AM Dmitry Kozliuk <dmitry.kozliuk@gmail.com> wrote: > > Hi William, > >> I applied your v2 patch and I did a native build on windows 10. >> Hit an error showing >> ../lib/librte_eal/windows/eal/eal_lcore.c:54:2: error: 'for' loop >> initial declarations are only allowed in C99 mode > > > Thanks, will fix in v3. > >> However the output looks weird: >> C:\dpdk\build\examples>dpdk-helloworld.exe >> EAL: Detected 2 lcore(s) >> EAL: Detected 1 NUMA nodes >> hehello fllo frorom cm core 1 >> ore 0 > > > It looks like your stdout is unbuffered (default is line-buffered). What terminal are you using (cmd, Power Shell, Terminal App, conemu, etc)? > I'm using the "Command Prompt" from windows 10 >> C compiler for the host machine: cc (gcc 4.8.3 "cc (GCC) 4.8.3") > > > GCC 4.8.3 is quite outdated, MinGW-w64 ships GCC 8 nowadays. Do we need to support it for Windows (I doubt MinGW-w64 does)? > Oh, I download a pretty old version (mingw-w64 3.3.0). Let me update. BTW, I also tested cross-compile using my Ubuntu Box and everything works! William