Skip to contentSkip to conversation

Compiler for Windows

DISCUSSION Thomas Monjalon 9 participants 23 messages Jan 2, 2019 – Feb 13, 2019

lore
Share & tools
lore
#0 lore raw

Hi,

We need to gather inputs about the pros/cons of the C compilers available for Windows.
Interesting criterias could be:
- ease of use
- availability
- standards compliance
- performance

When the comparison will be complete, we should publish it in the doc/ directory, while porting DPDK to Windows.

I start with few data:

* gcc|clang on cygwin
- not native

* gcc/mingw

* gcc/mingw-w64

* clang/mingw-w64

* clang --target=x86_64-windows-msvc

* icc
- not freely available

* msvc
- native
- specific command line
- not C99

#1 lore raw

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 2, 2019 2:45 PM
To: Jason Messer <[email protected]>; Harini Ramakrishnan <[email protected]>; Omar Cardona <[email protected]>; Ranjit Menon <[email protected]>
Cc: Mattias Rönnblom <[email protected]>; Jeff Shaw <[email protected]>; [email protected]; [email protected]
Subject: Compiler for Windows

Hi,

We need to gather inputs about the pros/cons of the C compilers available for Windows.
Interesting criterias could be:
- ease of use
- availability
- standards compliance
- performance

When the comparison will be complete, we should publish it in the doc/ directory, while porting DPDK to Windows.

I start with few data:

* gcc|clang on cygwin
- not native

* gcc/mingw

* gcc/mingw-w64

* clang/mingw-w64

* clang --target=x86_64-windows-msvc

* icc
- not freely available

* msvc
- native
- specific command line
- not C99

#2 lore raw

+Jeffrey, Manasi

We will get the most traction from the Windows developer community if we use msvc. The only thing preventing that last time was GNU extensions used in DPDK source which were not ISO C standards compliant. We were also experimenting with Clang/LLVM running natively on Windows host but ran into a bunch of issues (maybe others made further progress?). GCC using Windows Subsystem for Linux (WSL) would be an interesting option and could be a secondary option for MSVC for Windows developers.

Jason

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, January 2, 2019 10:33 PM
To: 'Thomas Monjalon' <[email protected]>; Jason Messer <[email protected]>; Harini Ramakrishnan <[email protected]>; Omar Cardona <[email protected]>; 'Ranjit Menon' <[email protected]>
Cc: 'Mattias Rönnblom' <[email protected]>; 'Jeff Shaw' <[email protected]>; [email protected]
Subject: RE: Compiler for Windows

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 2, 2019 2:45 PM
To: Jason Messer <[email protected]>; Harini Ramakrishnan <[email protected]>; Omar Cardona <[email protected]>; Ranjit Menon <[email protected]>
Cc: Mattias Rönnblom <[email protected]>; Jeff Shaw <[email protected]>; [email protected]; [email protected]
Subject: Compiler for Windows

Hi,

We need to gather inputs about the pros/cons of the C compilers available for Windows. Interesting criterias could be:
- ease of use
- availability
- standards compliance
- performance

When the comparison will be complete, we should publish it in the doc/ directory, while porting DPDK to Windows.

I start with few data:

* gcc|clang on cygwin
- not native

* gcc/mingw

* gcc/mingw-w64

* clang/mingw-w64

* clang --target=x86_64-windows-msvc

* icc
- not freely available

* msvc
- native
- specific command line
- not C99

#3 lore raw

Hi Jason,

We need to get facts in order to do a good decision. Please, let's give detailed feedback for each option.

03/01/2019 18:10, Jason Messer:

Quoted 6 lines

+Jeffrey, Manasi

We will get the most traction from the Windows developer community if we use msvc. The only thing preventing that last time was GNU extensions used in DPDK source which were not ISO C standards compliant.

I think the main issue is that MSVC is not C99 compliant.

Quoted 2 lines

We were also experimenting with Clang/LLVM running natively on Windows host but ran into a bunch of issues (maybe others made further progress?).

Chromium is built with clang on Windows, so I wonder what prevents us to use it?

Quoted 2 lines

GCC using Windows Subsystem for Linux (WSL) would be an interesting option and could be a secondary option for MSVC for Windows developers.

I thought GCC on WSL would build a Linux binary?
Can we build a Windows native binary with it?

What about mingw-w64? Is there any drawback?

Quoted 42 lines

From: Stephen Hemminger <[email protected]>

Quoted 41 lines

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

From: Thomas Monjalon <[email protected]>

Quoted 37 lines

Hi,

We need to gather inputs about the pros/cons of the C compilers available for Windows.

Interesting criterias could be:
- ease of use
- availability
- standards compliance
- performance

When the comparison will be complete, we should publish it in the doc/ directory, while porting DPDK to Windows.

I start with few data:

* gcc|clang on cygwin

- not native

* gcc/mingw

* gcc/mingw-w64

* clang/mingw-w64

* clang --target=x86_64-windows-msvc

* icc

- not freely available

* msvc

- native
- specific command line
- not C99

#4 lore raw
In reply to Jason Messer
Quoted 8 lines · Jason Messer

+Jeffrey, Manasi

We will get the most traction from the Windows developer community if we use msvc. The only thing preventing that last time was GNU extensions used in DPDK source which were not ISO C standards compliant. We were also experimenting with Clang/LLVM running natively on Windows host but ran into a bunch of issues (maybe others made further progress?). GCC using Windows Subsystem for Linux (WSL) would be an interesting option and could be a secondary option for MSVC for Windows developers.

I thought the constructor/deconstructor support is also not in MSVC. We use constructors a lot in DPDK and creating a method to remove them from DPDK is going to be a fair amount of work. Adding function calls to an init routine is not a good option.

Quoted 44 lines

Jason

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, January 2, 2019 10:33 PM
To: 'Thomas Monjalon' <[email protected]>; Jason Messer <[email protected]>; Harini Ramakrishnan <[email protected]>; Omar Cardona <[email protected]>; 'Ranjit Menon' <[email protected]>
Cc: 'Mattias Rönnblom' <[email protected]>; 'Jeff Shaw' <[email protected]>; [email protected]
Subject: RE: Compiler for Windows

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 2, 2019 2:45 PM
To: Jason Messer <[email protected]>; Harini Ramakrishnan <[email protected]>; Omar Cardona <[email protected]>; Ranjit Menon <[email protected]>
Cc: Mattias Rönnblom <[email protected]>; Jeff Shaw <[email protected]>; [email protected]; [email protected]
Subject: Compiler for Windows

Hi,

We need to gather inputs about the pros/cons of the C compilers available for Windows. Interesting criterias could be:
- ease of use
- availability
- standards compliance
- performance

When the comparison will be complete, we should publish it in the doc/ directory, while porting DPDK to Windows.

I start with few data:

* gcc|clang on cygwin
- not native

* gcc/mingw

* gcc/mingw-w64

* clang/mingw-w64

* clang --target=x86_64-windows-msvc

Quoted 11 lines

* icc
- not freely available

* msvc
- native
- specific command line
- not C99

Regards,
Keith

#5 lore raw
In reply to Stephen Hemminger
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

Signature · 2 lines
Thanks,
Anatoly
#6 lore raw
Quoted 9 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

#7 lore raw
Quoted 8 lines · Stephen Hemminger
Quoted 5 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

Quoted 7 lines
Quoted 4 lines

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

But is running that going to produce windows binaries rather than linux ones?

#8 lore raw
Quoted 9 lines · Bruce Richardson
Quoted 8 lines · Stephen Hemminger
Quoted 5 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

Yes, but it takes a while for "newest versions" to trickle down on our dev machines :)

Quoted 4 lines

But is running that going to produce windows binaries rather than linux ones?

I believe it's producing Linux binaries, not Windows ones. So probably a non-starter.

Signature · 2 lines
Thanks,
Anatoly
#9 lore raw
Quoted 22 lines · Anatoly
Quoted 9 lines · Bruce Richardson
Quoted 8 lines · Stephen Hemminger
Quoted 5 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

Yes, but it takes a while for "newest versions" to trickle down on our dev machines :)

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

But is running that going to produce windows binaries rather than linux ones?

I believe it's producing Linux binaries, not Windows ones. So probably a non-starter.

It would produce Linux binaries. It should be possible to convince it to do Windows binaries some how. Just hoping there was a way to build DPDK with standard tools and not having to use cygwin.

#10 lore raw

07/01/2019 17:51, Stephen Hemminger:

Quoted 29 lines
Quoted 26 lines · Anatoly
Quoted 9 lines · Bruce Richardson
Quoted 8 lines · Stephen Hemminger
Quoted 5 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

Yes, but it takes a while for "newest versions" to trickle down on our dev machines :)

Quoted 4 lines

But is running that going to produce windows binaries rather than linux ones?

Quoted 7 lines
Quoted 3 lines

I believe it's producing Linux binaries, not Windows ones. So probably a non-starter.

It would produce Linux binaries. It should be possible to convince it to do Windows binaries some how. Just hoping there was a way to build DPDK with standard tools and not having to use cygwin.

I believe the right way is to compile from a Windows machine.
In this thread, I would like to discuss how to compile on Windows. "Cross" compilation from Linux is also interesting but probably more tricky.

#11 lore raw
In reply to Stephen Hemminger
Quoted 29 lines · Stephen Hemminger
Quoted 26 lines · Anatoly
Quoted 9 lines · Bruce Richardson
Quoted 8 lines · Stephen Hemminger
Quoted 5 lines · Anatoly
Quoted 3 lines · Stephen Hemminger

What about Gcc under the WSL thing (ie Linux emulation in Windows). Much better than Cygwin type stuff.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

WSL is dog-slow with any kind of disk I/O, at least currently, so while i do use WSL to fool my IDE into thinking it's running on Linux, the actual compilation user experience is horrible.

The newest version uses Hyper-V to run Linux kernel in VM and is better. Probably all still has issues with translation to NTFS.

Yes, but it takes a while for "newest versions" to trickle down on our dev machines :)

Quoted 4 lines

But is running that going to produce windows binaries rather than linux ones?

Quoted 7 lines
Quoted 3 lines

I believe it's producing Linux binaries, not Windows ones. So probably a non-starter.

It would produce Linux binaries. It should be possible to convince it to do Windows binaries some how. Just hoping there was a way to build DPDK with standard tools and not having to use cygwin.

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

/Bruce

#12 lore raw

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Unfortunately we lost my original attempt of getting some facts.

#13 lore raw
Quoted 11 lines · Thomas Monjalon

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

Signature · 2 lines
Thanks,
Anatoly
#14 lore raw

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice
http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project
https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list.
We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs. The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#15 lore raw

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

ranjit m.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice
http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project
https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#16 lore raw

Sorry I have to top post. I had surgery on my shoulder so I’m doing this from my phone.

Why does the windows Eal directory have to be a stub?

Normally the port must use a separate directory for different architecture. In this case it is the windows architecture which should have all of the changes required for windows and not modify Linux or BSD.

Sent from my iPhone

Quoted 72 lines · Ranjit

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

ranjit m.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines
Quoted 10 lines · Thomas Monjalon

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice

     http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project

     https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#17 lore raw

31/01/2019 18:12, Wiles, Keith:

Quoted 3 lines

Sorry I have to top post. I had surgery on my shoulder so I’m doing this from my phone.

Why does the windows Eal directory have to be a stub?

It is just a first step to validate the compilation of existing code in Windows environment without the new Windows code.

Quoted 1 line

Normally the port must use a separate directory for different architecture. In this case it is the windows architecture which should have all of the changes required for windows and not modify Linux or BSD.

Yes I agree. This is the step 5 below:
5/ EAL for Windows can be completed with real code

Quoted 73 lines
Quoted 72 lines · Ranjit

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

ranjit m.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines
Quoted 10 lines · Thomas Monjalon

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice

     http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project

     https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#18 lore raw

OK just seems like an unnecessary step to me.

Sent from my iPhone

Quoted 94 lines · Thomas Monjalon

31/01/2019 18:12, Wiles, Keith:

Quoted 3 lines

Sorry I have to top post. I had surgery on my shoulder so I’m doing this from my phone.

Why does the windows Eal directory have to be a stub?

It is just a first step to validate the compilation of existing code in Windows environment without the new Windows code.

Quoted 1 line

Normally the port must use a separate directory for different architecture. In this case it is the windows architecture which should have all of the changes required for windows and not modify Linux or BSD.

Yes I agree. This is the step 5 below:
5/ EAL for Windows can be completed with real code

Quoted 73 lines
Quoted 72 lines · Ranjit

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

ranjit m.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines
Quoted 10 lines
Quoted 5 lines · Thomas Monjalon

07/01/2019 18:00, Bruce Richardson:
I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice

    http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project

    https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#19 lore raw
In reply to Menon, Ranjit

Any update about the progress, please?
Do you have started a new branch?

30/01/2019 17:32, Menon, Ranjit:

Quoted 68 lines

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS compiler first, since from my understanding it's probably the default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice
http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project
https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.49.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#20 lore raw

Thomas...
We now have the "helloworld" application with a minimal EAL building on Windows using clang. We have also managed to generate the build files using meson. There are some issues we still need to work through, but we are close to submitting patches to a branch on the draft repo. We hope to get them out soon.

ranjit m.

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, February 13, 2019 8:11 AM
To: Menon, Ranjit <[email protected]>; 'Jason Messer' <[email protected]>
Cc: [email protected]; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>
Subject: Re: [dpdk-dev] Compiler for Windows

Any update about the progress, please?
Do you have started a new branch?

30/01/2019 17:32, Menon, Ranjit:

Quoted 76 lines

Thank you for the direction, Thomas and Tech Board members.

If clang-win64 has support for GCC extensions (__attribute(constructor/align/etc...)), then the changes to common DPDK code should be minimal. Also, Jeff got meson to output VS project files to compile with MSVC - we'll just need to make sure that they can compile with clang-win64. Thanks, Bruce for helping us out here.

From: Thomas Monjalon <[email protected]>
Sent: Wednesday, January 30, 2019 6:21 AM
To: 'Jason Messer' <[email protected]>; 'Harini Ramakrishnan' <[email protected]>; 'Omar Cardona' <[email protected]>; Menon, Ranjit <[email protected]>
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Richardson, Bruce <[email protected]>; Stephen Hemminger <[email protected]>; 'Mattias Rönnblom' <[email protected]>; Shaw, Jeffrey B <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] Compiler for Windows

08/01/2019 11:24, Burakov, Anatoly:

Quoted 10 lines · Thomas Monjalon
Quoted 9 lines

07/01/2019 18:00, Bruce Richardson:

Quoted 3 lines

I think for windows we probably want to start with the MS
compiler first, since from my understanding it's probably the
default go-to compiler for developers on windows, and look at alternatives from there.

Not sure. I feel clang is a better option.
This is the purpose of this thread: which compiler can work with the DPDK code base? Which modifications of code are acceptable?

Quoted 6 lines
Quoted 1 line

Unfortunately we lost my original attempt of getting some facts.

i'm developing on a Windows machine, and use clang as code analyzer. so while the compiling and linking may take some effort, the bulk of it appears to be working without too much complaints from clang. it's easy to install as well - just install LLVM and you're good to go.

This discussion continued in a private thread (for no good reason). Let's conclude here publicly.

About the compiler,
- cygwin is not native -> no go
- mingw-w64 (latest) brings a specific DLL -> one more unknown piece
- icc is not free -> no go
- msvc supports not all C99 and GNU extensions -> difficult to support
- clang is now native on Windows -> best choice
http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe

About the build system,
- DPDK makefiles are not Windows-friendly and will be removed
- meson is supported on Windows and can generate VS project

https://github.com/mesonbuild/meson/releases/download/0.49.1/meson-0.4
9.1-64.msi

About the Linux/BSD code,
- we can use some #ifdef
- most of the specific code should be in EAL
- it must be tried to share a maximum of common code

About the steps,
1/ meson files must be prepared for Windows target 2/ EAL for Windows must be an empty stub first 3/ The core libraries must compile with meson+clang 4/ Documentation for Windows must be started 5/ EAL for Windows can be completed with real code 6/ PMDs can be tested on Windows
7/ Examples should compile on Windows

Please restart from a fresh 19.02 branch in the draft repository and submit the steps one by one on the mailing list. We need to validate the steps and approve the choices.
If some choices are done, they must be explained in the commit logs.
The commits must be small enough to be reviewed.
If some issues are encountered, we'll fix them as a community.

Thanks for facilitating community adoption of Windows port.

#21 lore raw
In reply to Bruce Richardson
Quoted 8 lines

From: dev [mailto:[email protected]] On Behalf Of Bruce Richardson I think for windows we probably want to start with the MS compiler first,
since from my understanding it's probably the default go-to compiler for
developers on windows, and look at alternatives from there.

/Bruce

Having developed quite a bit in Windows myself (about a decade ago), I tend to agree with Bruce here. However, I would add that it depends on who we are targeting:

If we are targeting typical Windows developers (of all levels of experience), it's my impression that Microsoft's compiler IDE, Visual Studio (or Visual Studio Code), is their tool of choice, and anything else would introduce a learning curve. (This is probably more true for junior developers than senior developers, who often have worked in a range of different development environments.)

If we are targeting developers who want to make their applications compatible across multiple operating systems, any compiler would probably work just fine - and in this case, the real question is about making the "make" environment as cross-platform compatible as possible.

Maybe you can get inspiration by looking at other cross-platform projects... Google Chrome, Mozilla Firefox, Wireshark, etc.

Med venlig hilsen / kind regards
- Morten Brørup

#22 lore raw
Quoted 7 lines · Morten Brørup
Quoted 7 lines

From: dev [mailto:[email protected]] On Behalf Of Bruce Richardson I think for windows we probably want to start with the MS compiler first,
since from my understanding it's probably the default go-to compiler for
developers on windows, and look at alternatives from there.

Quoted 6 lines
Quoted 1 line

/Bruce

Having developed quite a bit in Windows myself (about a decade ago), I tend to agree with Bruce here. However, I would add that it depends on who we are targeting:

If we are targeting typical Windows developers (of all levels of experience), it's my impression that Microsoft's compiler IDE, Visual Studio (or Visual Studio Code), is their tool of choice, and anything else would introduce a learning curve. (This is probably more true for junior developers than senior developers, who often have worked in a range of different development environments.)

Visual Studio supports clang, and regardless, maximizing the *convenience* for a few Windows developers shouldn't really be a priority. Let's be real; Windows is very likely to remain a minor player in the domain of operating systems for network processing.

Just to be clear, I'm not saying we should sabotage a Windows port. What I am voting against, is to allow a Windows port to sabotage the DPDK source code, and prevent the use of useful compiler features, messing up the code in the process.

As for junior developers, if they are going to program in DPDK, installing a compiler is such a minor part of the learning curve ahead, they won't notice the tiny bit of extra climb.

Quoted 2 lines

If we are targeting developers who want to make their applications compatible across multiple operating systems, any compiler would probably work just fine - and in this case, the real question is about making the "make" environment as cross-platform compatible as possible.

The discussion has been about compilers, not any build system or tools.

Quoted 2 lines

Maybe you can get inspiration by looking at other cross-platform projects... Google Chrome, Mozilla Firefox, Wireshark, etc.

As mentioned in this thread already, Chromium relies on clang.