The Windows user guide is referencing a general link to download MinGW: http://mingw-w64.org/doku.php/download For those who want to install MinGW on Windows, I thing it is simpler to give this more direct link: http://mingw-w64.org/doku.php/download/mingw-builds It avoids hesitating between different bundles (Cygwin, Msys2, Win-Builds, etc). Then when installing mingw-w64-install.exe, a choice must be done between threads POSIX or Win32. If I understand well, POSIX must be chosen? If it is important, it should be documented in my opinion.
On Sat, 13 Jun 2020 10:55:14 +0200 Thomas Monjalon <thomas@monjalon.net> wrote: > The Windows user guide is referencing a general link to download MinGW: > http://mingw-w64.org/doku.php/download > For those who want to install MinGW on Windows, I thing it is simpler > to give this more direct link: > http://mingw-w64.org/doku.php/download/mingw-builds > It avoids hesitating between different bundles (Cygwin, Msys2, Win-Builds, etc). Agreed, at least while no package manager is used. I believe the most direct link would be this one: https://sourceforge.net/projects/mingw-w64/files/ > Then when installing mingw-w64-install.exe, a choice must be done > between threads POSIX or Win32. > If I understand well, POSIX must be chosen? Yes. DPDK config/meson.build now links with pthread if linker is not link.exe. Note that maybe this can be relaxed (test needed!), i. e. link with pthread if it is found, otherwise use shim. Benefit, if this works: no runtime dependency on "libwinpthread-1.dll" for Windows. -- Dmitry Kozlyuk
> Subject: Re: MinGW guide > > On Sat, 13 Jun 2020 10:55:14 +0200 > Thomas Monjalon <thomas@monjalon.net> wrote: [snip] > > Then when installing mingw-w64-install.exe, a choice must be done > > between threads POSIX or Win32. > > If I understand well, POSIX must be chosen? > > Yes. DPDK config/meson.build now links with pthread if linker is not link.exe. > Where do we actually use pthread in Windows? > Note that maybe this can be relaxed (test needed!), i. e. link with pthread if > it is found, otherwise use shim. Benefit, if this works: no runtime > dependency on "libwinpthread-1.dll" for Windows. I was sure, since we create the threads with Win32 API (CreateThread), the correct option is Win32. My mingw-w64 is installed with that option and I didn't see issues with it. > > -- > Dmitry Kozlyuk
On Mon, 15 Jun 2020 09:25:07 +0000 Tal Shnaiderman <talshn@mellanox.com> wrote: > > Subject: Re: MinGW guide > > > > On Sat, 13 Jun 2020 10:55:14 +0200 > > Thomas Monjalon <thomas@monjalon.net> wrote: > > [snip] > > > > Then when installing mingw-w64-install.exe, a choice must be done > > > between threads POSIX or Win32. > > > If I understand well, POSIX must be chosen? > > > > Yes. DPDK config/meson.build now links with pthread if linker is not link.exe. > > > > Where do we actually use pthread in Windows? Nowhere indeed. Probably it was my mistake to link with it when adding MinGW support. Shim is always used anyway. > > > Note that maybe this can be relaxed (test needed!), i. e. link with pthread if > > it is found, otherwise use shim. Benefit, if this works: no runtime > > dependency on "libwinpthread-1.dll" for Windows. > > I was sure, since we create the threads with Win32 API (CreateThread), the correct option is Win32. > My mingw-w64 is installed with that option and I didn't see issues with it. Then I'm totally wrong. Your way MinGW-w64 produces an executable without dependencies (apart from system libraries), so this should be preferred. I tried and it works for me. -- Dmitry Kozlyuk