All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
@ 2017-09-04 13:23 Van Haaren, Harry
  2017-09-04 13:42 ` Bruce Richardson
  2017-09-12 12:55 ` Bruce Richardson
  0 siblings, 2 replies; 6+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 13:23 UTC (permalink / raw)
  To: Richardson, Bruce, dev

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
> 
> Following on from the two previous RFCs [1] [2], here is a cleaned up
> patchset to serve as a start-point for getting all of DPDK building with
> meson and ninja.
> 
> What's covered:
> * Basic infrastructure for feature detection and DPDK compilation
> * Building of all DPDK libraries - as either static or shared
> * Compilation of igb_uio driver for Linux
> * Building a number of mempool, crypto and net drivers.
> * Installation of compiled libraries and headers
> * Installation of usertools scripts
> * Compilation of testpmd as dpdk-testpmd and install of same
> * Generation and installation of pkgconfig file for DPDK
> * Contributors guide document addition describing how to add build scripts
> 
> What's not implemented:
> * Just about everything else :-), including
> * Support for non-x86 architectures, including cross-compilation
> * Lots of PMDs
> * Support for building and running the unit tests
> 
> Some key differences from RFC2:
> * Removed duplication between the different driver meson files by moving
>   the build logic up one level to the driver/meson.build file.
> * Added a build option to allow versioning the libraries using the DPDK
>   version number, rather than individual .so versions.
> * Made EAL a default dependency for libs, to simplify meson.build files for
>   a number of them.
> * Made the build variables used for libraries and drivers more consistent.
> * Moved responsibility for determining if a given driver or library should
>   be built to the driver/library's own build file, giving a single place
>   where all details about that component are placed, and saving having lots
>   of environment detection logic in higher-level build files.
> * Begun adding in developer documentation to make it easier for driver
>   authors/maintainers to contribute.
> 
> Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
> Ninja is available in most distributions, and meson - if an updated version
> is not available on your distro of choice - can be easily got using
> 	"pip3 install meson"
> 
> To build and install then use:
> 
> 	meson build # use default compiler and shared libs
> 	cd build
> 	ninja
> 	sudo ninja install
> 
> Thereafter to use DPDK in other build systems one can use:
> 
> 	pkg-config --cflags DPDK
> 	pkt-config --libs DPDK
> 
> to query the needed DPDK build parameters.
> 
> Once reviewed and tested a bit, I hope to apply this set - or a new
> revision of it - to the build-next tree, to serve as a baseline for others
> to use and to add the missing functionality to.

<snip> git / file stats

A good start - applied cleanly and compiled fine on dpdk-next-build tree.

Some notes from experience of testing on an Ubuntu 16.04 system:
- libpcap wasn't detected successfully - on researching the transitional package "libpcap-dev" was installed, but that didn't actually install any of the required files. Installing "libpcap0.8-dev" enabled pcap to be detected successfully. No fault of Meson or these patches,  just an inconsistency in transitional-packages it seems.

- Binaries after a compile are in a different location (compared to mk build system). eg: testpmd now resides in app/test-pmd/dpdk-testpmd. No issue, just a note that the path to the binaries changes. With the very-easy "ninja install" and "ninja uninstall", dpdk applications can just be run directly from the installed location (assuming binaries placed on PATH).

- Ninja install is required with shared-object builds, to enable the dpdk binary (eg: testpmd) to find the .so objects. Doing a local compile (without install) and running ./app/test-pmd/dpdk-testpmd  will print "MBUF: error setting mempool handler" and rte_panic(). This is obviously not an issue for static builds - the functionality is linked into the application in that case. 
 
- Some compilers don't correctly expose their capabilities in warning flags causing Meson to believe that it should turn of these warnings. In the current Meson build code, these two warnings are nullified globally: -Wno-format-truncation and -Wno-address-of-packed-member. GCC 5.4.0 and 4.8.5 suffer from both incorrectly exposed. Gcc 7 does not have an issue with -Wno-format-truncation, but the other remains. Clang 3.8.0 does not have any issues. Just something to be aware of - no issues here either.

- Build options are set using  mesonconf  tool, run it to see current configuration, or use it to eg enable static libraries:   mesonconf -Ddefault_library=static

Summary so far;
- Only very minor issues found - resolved easily
- Configure and Build speeds still a breath of fresh air to me :)

On to reviewing the patches themselves, -Harry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-04 13:23 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Van Haaren, Harry
@ 2017-09-04 13:42 ` Bruce Richardson
  2017-09-04 15:49   ` Van Haaren, Harry
  2017-09-12 12:55 ` Bruce Richardson
  1 sibling, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2017-09-04 13:42 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Sep 04, 2017 at 02:23:13PM +0100, Van Haaren, Harry wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Friday, September 1, 2017 11:04 AM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > Subject: [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
> > 
> > Following on from the two previous RFCs [1] [2], here is a cleaned up
> > patchset to serve as a start-point for getting all of DPDK building with
> > meson and ninja.
> > 
> > What's covered:
> > * Basic infrastructure for feature detection and DPDK compilation
> > * Building of all DPDK libraries - as either static or shared
> > * Compilation of igb_uio driver for Linux
> > * Building a number of mempool, crypto and net drivers.
> > * Installation of compiled libraries and headers
> > * Installation of usertools scripts
> > * Compilation of testpmd as dpdk-testpmd and install of same
> > * Generation and installation of pkgconfig file for DPDK
> > * Contributors guide document addition describing how to add build scripts
> > 
> > What's not implemented:
> > * Just about everything else :-), including
> > * Support for non-x86 architectures, including cross-compilation
> > * Lots of PMDs
> > * Support for building and running the unit tests
> > 
> > Some key differences from RFC2:
> > * Removed duplication between the different driver meson files by moving
> >   the build logic up one level to the driver/meson.build file.
> > * Added a build option to allow versioning the libraries using the DPDK
> >   version number, rather than individual .so versions.
> > * Made EAL a default dependency for libs, to simplify meson.build files for
> >   a number of them.
> > * Made the build variables used for libraries and drivers more consistent.
> > * Moved responsibility for determining if a given driver or library should
> >   be built to the driver/library's own build file, giving a single place
> >   where all details about that component are placed, and saving having lots
> >   of environment detection logic in higher-level build files.
> > * Begun adding in developer documentation to make it easier for driver
> >   authors/maintainers to contribute.
> > 
> > Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
> > Ninja is available in most distributions, and meson - if an updated version
> > is not available on your distro of choice - can be easily got using
> > 	"pip3 install meson"
> > 
> > To build and install then use:
> > 
> > 	meson build # use default compiler and shared libs
> > 	cd build
> > 	ninja
> > 	sudo ninja install
> > 
> > Thereafter to use DPDK in other build systems one can use:
> > 
> > 	pkg-config --cflags DPDK
> > 	pkt-config --libs DPDK
> > 
> > to query the needed DPDK build parameters.
> > 
> > Once reviewed and tested a bit, I hope to apply this set - or a new
> > revision of it - to the build-next tree, to serve as a baseline for others
> > to use and to add the missing functionality to.
> 
> <snip> git / file stats
> 
> A good start - applied cleanly and compiled fine on dpdk-next-build tree.
> 
> Some notes from experience of testing on an Ubuntu 16.04 system:
> - libpcap wasn't detected successfully - on researching the transitional package "libpcap-dev" was installed, but that didn't actually install any of the required files. Installing "libpcap0.8-dev" enabled pcap to be detected successfully. No fault of Meson or these patches,  just an inconsistency in transitional-packages it seems.

The great thing about all this is that it didn't break your build - it
just didn't compile the pcap driver for you. :-)
> 
> - Binaries after a compile are in a different location (compared to mk build system). eg: testpmd now resides in app/test-pmd/dpdk-testpmd. No issue, just a note that the path to the binaries changes. With the very-easy "ninja install" and "ninja uninstall", dpdk applications can just be run directly from the installed location (assuming binaries placed on PATH).
> 
> - Ninja install is required with shared-object builds, to enable the dpdk binary (eg: testpmd) to find the .so objects. Doing a local compile (without install) and running ./app/test-pmd/dpdk-testpmd  will print "MBUF: error setting mempool handler" and rte_panic(). This is obviously not an issue for static builds - the functionality is linked into the application in that case. 

Yep, this is an issue, but I'm not sure of a good way round it just now.
I made this set very much with the idea in mind that people would use
"ninja install" a lot to expose their binaries when running DPDK.
If this is not the case and we need a better solution, I'm open to
ideas.

>  
> - Some compilers don't correctly expose their capabilities in warning flags causing Meson to believe that it should turn of these warnings. In the current Meson build code, these two warnings are nullified globally: -Wno-format-truncation and -Wno-address-of-packed-member. GCC 5.4.0 and 4.8.5 suffer from both incorrectly exposed. Gcc 7 does not have an issue with -Wno-format-truncation, but the other remains. Clang 3.8.0 does not have any issues. Just something to be aware of - no issues here either.
> 
A little unclear what the problem is here? We record the flags that may
be needed to compile up the code, and then apply those to the compilers
that support them. It may be that some versions of a compiler don't need
the flag when compiling the code, while others do, but this is hopefully
rare enough that the simplicity gained from just using the flag when
supported well out-weighs the downsides, of unnecessarily disabling a
few warnings. The alternative of tracking different warnings for
different compiler versions seems rather scary to me :-)

> - Build options are set using  mesonconf  tool, run it to see current configuration, or use it to eg enable static libraries:   mesonconf -Ddefault_library=static

Actually, to build static libs, you don't need mesonconf at all. You
can use --default-library=static as a flag directly to meson.
Similarly, you can pass the DPDK=specific flags using -Dx=y syntax to
meson.

> 
> Summary so far;
> - Only very minor issues found - resolved easily
> - Configure and Build speeds still a breath of fresh air to me :)
> 
> On to reviewing the patches themselves, -Harry

Great, thanks for the review.

/Bruce

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-04 13:42 ` Bruce Richardson
@ 2017-09-04 15:49   ` Van Haaren, Harry
  0 siblings, 0 replies; 6+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 15:49 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev

> From: Richardson, Bruce
> Sent: Monday, September 4, 2017 2:43 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
> 
> On Mon, Sep 04, 2017 at 02:23:13PM +0100, Van Haaren, Harry wrote:
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > > Sent: Friday, September 1, 2017 11:04 AM
> > > To: dev@dpdk.org
> > > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > > Subject: [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
> > >
> > > Following on from the two previous RFCs [1] [2], here is a cleaned up
> > > patchset to serve as a start-point for getting all of DPDK building with
> > > meson and ninja.
> > >
> > > What's covered:
> > > * Basic infrastructure for feature detection and DPDK compilation
> > > * Building of all DPDK libraries - as either static or shared
> > > * Compilation of igb_uio driver for Linux
> > > * Building a number of mempool, crypto and net drivers.
> > > * Installation of compiled libraries and headers
> > > * Installation of usertools scripts
> > > * Compilation of testpmd as dpdk-testpmd and install of same
> > > * Generation and installation of pkgconfig file for DPDK
> > > * Contributors guide document addition describing how to add build scripts
> > >
> > > What's not implemented:
> > > * Just about everything else :-), including
> > > * Support for non-x86 architectures, including cross-compilation
> > > * Lots of PMDs
> > > * Support for building and running the unit tests
> > >
> > > Some key differences from RFC2:
> > > * Removed duplication between the different driver meson files by moving
> > >   the build logic up one level to the driver/meson.build file.
> > > * Added a build option to allow versioning the libraries using the DPDK
> > >   version number, rather than individual .so versions.
> > > * Made EAL a default dependency for libs, to simplify meson.build files for
> > >   a number of them.
> > > * Made the build variables used for libraries and drivers more consistent.
> > > * Moved responsibility for determining if a given driver or library should
> > >   be built to the driver/library's own build file, giving a single place
> > >   where all details about that component are placed, and saving having lots
> > >   of environment detection logic in higher-level build files.
> > > * Begun adding in developer documentation to make it easier for driver
> > >   authors/maintainers to contribute.
> > >
> > > Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
> > > Ninja is available in most distributions, and meson - if an updated version
> > > is not available on your distro of choice - can be easily got using
> > > 	"pip3 install meson"
> > >
> > > To build and install then use:
> > >
> > > 	meson build # use default compiler and shared libs
> > > 	cd build
> > > 	ninja
> > > 	sudo ninja install
> > >
> > > Thereafter to use DPDK in other build systems one can use:
> > >
> > > 	pkg-config --cflags DPDK
> > > 	pkt-config --libs DPDK
> > >
> > > to query the needed DPDK build parameters.
> > >
> > > Once reviewed and tested a bit, I hope to apply this set - or a new
> > > revision of it - to the build-next tree, to serve as a baseline for others
> > > to use and to add the missing functionality to.
> >
> > <snip> git / file stats
> >
> > A good start - applied cleanly and compiled fine on dpdk-next-build tree.
> >
> > Some notes from experience of testing on an Ubuntu 16.04 system:
> > - libpcap wasn't detected successfully - on researching the transitional package "libpcap-
> dev" was installed, but that didn't actually install any of the required files. Installing
> "libpcap0.8-dev" enabled pcap to be detected successfully. No fault of Meson or these patches,
> just an inconsistency in transitional-packages it seems.
> 
> The great thing about all this is that it didn't break your build - it
> just didn't compile the pcap driver for you. :-)
> >
> > - Binaries after a compile are in a different location (compared to mk build system). eg:
> testpmd now resides in app/test-pmd/dpdk-testpmd. No issue, just a note that the path to the
> binaries changes. With the very-easy "ninja install" and "ninja uninstall", dpdk applications
> can just be run directly from the installed location (assuming binaries placed on PATH).
> >
> > - Ninja install is required with shared-object builds, to enable the dpdk binary (eg:
> testpmd) to find the .so objects. Doing a local compile (without install) and running
> ./app/test-pmd/dpdk-testpmd  will print "MBUF: error setting mempool handler" and rte_panic().
> This is obviously not an issue for static builds - the functionality is linked into the
> application in that case.
> 
> Yep, this is an issue, but I'm not sure of a good way round it just now.
> I made this set very much with the idea in mind that people would use
> "ninja install" a lot to expose their binaries when running DPDK.
> If this is not the case and we need a better solution, I'm open to
> ideas.
> 
> >
> > - Some compilers don't correctly expose their capabilities in warning flags causing Meson to
> believe that it should turn of these warnings. In the current Meson build code, these two
> warnings are nullified globally: -Wno-format-truncation and -Wno-address-of-packed-member. GCC
> 5.4.0 and 4.8.5 suffer from both incorrectly exposed. Gcc 7 does not have an issue with -Wno-
> format-truncation, but the other remains. Clang 3.8.0 does not have any issues. Just something
> to be aware of - no issues here either.
> >
> A little unclear what the problem is here? We record the flags that may
> be needed to compile up the code, and then apply those to the compilers
> that support them. It may be that some versions of a compiler don't need
> the flag when compiling the code, while others do, but this is hopefully
> rare enough that the simplicity gained from just using the flag when
> supported well out-weighs the downsides, of unnecessarily disabling a
> few warnings. The alternative of tracking different warnings for
> different compiler versions seems rather scary to me :-)
> 
> > - Build options are set using  mesonconf  tool, run it to see current configuration, or use
> it to eg enable static libraries:   mesonconf -Ddefault_library=static
> 
> Actually, to build static libs, you don't need mesonconf at all. You
> can use --default-library=static as a flag directly to meson.
> Similarly, you can pass the DPDK=specific flags using -Dx=y syntax to
> meson.
> 
> >
> > Summary so far;
> > - Only very minor issues found - resolved easily
> > - Configure and Build speeds still a breath of fresh air to me :)
> >
> > On to reviewing the patches themselves, -Harry
> 
> Great, thanks for the review.
> 
> /Bruce

Post-review notes;
- Series compiles DPDK perfectly here
- Code is in a readable and well layed out structure
- Some minor nitpick improvements identified, but I'd prefer send a patch to fix than have to request multiple V+1 respins.

A V2 addressing the few inline comments from this review would be great,
but then next steps is to commit the V2 patches to the dpdk-next-build tree, enabling easy testing and patching of the meson files.

Series-Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-04 13:23 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Van Haaren, Harry
  2017-09-04 13:42 ` Bruce Richardson
@ 2017-09-12 12:55 ` Bruce Richardson
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2017-09-12 12:55 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Sep 04, 2017 at 02:23:13PM +0100, Van Haaren, Harry wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce
> > Richardson Sent: Friday, September 1, 2017 11:04 AM To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com> Subject:
> > [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with
> > meson/ninja
> > 
> > Following on from the two previous RFCs [1] [2], here is a cleaned
> > up patchset to serve as a start-point for getting all of DPDK
> > building with meson and ninja.
> > 
> > What's covered: * Basic infrastructure for feature detection and
> > DPDK compilation * Building of all DPDK libraries - as either static
> > or shared * Compilation of igb_uio driver for Linux * Building a
> > number of mempool, crypto and net drivers.  * Installation of
> > compiled libraries and headers * Installation of usertools scripts *
> > Compilation of testpmd as dpdk-testpmd and install of same *
> > Generation and installation of pkgconfig file for DPDK *
> > Contributors guide document addition describing how to add build
> > scripts
> > 
> > What's not implemented: * Just about everything else :-), including
> > * Support for non-x86 architectures, including cross-compilation *
> > Lots of PMDs * Support for building and running the unit tests
> > 
> > Some key differences from RFC2: * Removed duplication between the
> > different driver meson files by moving the build logic up one level
> > to the driver/meson.build file.  * Added a build option to allow
> > versioning the libraries using the DPDK version number, rather than
> > individual .so versions.  * Made EAL a default dependency for libs,
> > to simplify meson.build files for a number of them.  * Made the
> > build variables used for libraries and drivers more consistent.  *
> > Moved responsibility for determining if a given driver or library
> > should be built to the driver/library's own build file, giving a
> > single place where all details about that component are placed, and
> > saving having lots of environment detection logic in higher-level
> > build files.  * Begun adding in developer documentation to make it
> > easier for driver authors/maintainers to contribute.
> > 
> > Meson 0.41 and ninja are needed, and ideally meson 0.42 is
> > recommended.  Ninja is available in most distributions, and meson -
> > if an updated version is not available on your distro of choice -
> > can be easily got using "pip3 install meson"
> > 
> > To build and install then use:
> > 
> > 	meson build # use default compiler and shared libs cd build
> > 	ninja sudo ninja install
> > 
> > Thereafter to use DPDK in other build systems one can use:
> > 
> > 	pkg-config --cflags DPDK pkt-config --libs DPDK
> > 
> > to query the needed DPDK build parameters.
> > 
> > Once reviewed and tested a bit, I hope to apply this set - or a new
> > revision of it - to the build-next tree, to serve as a baseline for
> > others to use and to add the missing functionality to.
> 
> <snip> git / file stats
> 
> A good start - applied cleanly and compiled fine on dpdk-next-build
> tree.
> 
> Some notes from experience of testing on an Ubuntu 16.04 system: -
> libpcap wasn't detected successfully - on researching the transitional
> package "libpcap-dev" was installed, but that didn't actually install
> any of the required files. Installing "libpcap0.8-dev" enabled pcap to
> be detected successfully. No fault of Meson or these patches,  just an
> inconsistency in transitional-packages it seems.
> 
> - Binaries after a compile are in a different location (compared to mk
> build system). eg: testpmd now resides in app/test-pmd/dpdk-testpmd.
> No issue, just a note that the path to the binaries changes. With the
> very-easy "ninja install" and "ninja uninstall", dpdk applications can
> just be run directly from the installed location (assuming binaries
> placed on PATH).
> 
> - Ninja install is required with shared-object builds, to enable the
> dpdk binary (eg: testpmd) to find the .so objects. Doing a local
> compile (without install) and running ./app/test-pmd/dpdk-testpmd
> will print "MBUF: error setting mempool handler" and rte_panic(). This
> is obviously not an issue for static builds - the functionality is
> linked into the application in that case. 
>
Actually, some further clarification on this last item.

It's not the .so's that are regular libraries that are the problem, just
the drivers.  As part of the build, meson configures the binaries'
rpaths so that they record the paths to their library dependencies,
which means that the binaries are indeed runable in the build directory.
(These build rpaths are replaced on install). This is why you get a DPDK
error, not a loader error. 

In our case, we don't link the driver libraries against the binaries,
but expect them to be loaded via "-d" flag to eal, so the required rpath
values for those drivers are not configured, and the drivers are not
placed in $DPDK_DRIVER_PATH until the install step.

So this means that the binaries *are* in fact runable from the build
directory, just not as easily as after install, as you have to manually
pass in a -d flag to force the loading of all drivers required -
mempool, NIC, etc.

Regards,
/Bruce

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-01 10:03 Bruce Richardson
@ 2017-09-01 10:38 ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:38 UTC (permalink / raw)
  To: dev

On Fri, Sep 01, 2017 at 11:03:59AM +0100, Bruce Richardson wrote:
> Following on from the two previous RFCs [1] [2], here is a cleaned up
> patchset to serve as a start-point for getting all of DPDK building with
> meson and ninja.
> 

Just for reference, I've test-compiled this on, Fedora 26 with clang and
gcc for both static and shared builds, and similarly on FreeBSD 10 for
clang and gcc with static and shared builds. Some basic compile testing
also done on BSD 11.

/Bruce

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
@ 2017-09-01 10:03 Bruce Richardson
  2017-09-01 10:38 ` Bruce Richardson
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:03 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Following on from the two previous RFCs [1] [2], here is a cleaned up
patchset to serve as a start-point for getting all of DPDK building with
meson and ninja.

What's covered:
* Basic infrastructure for feature detection and DPDK compilation
* Building of all DPDK libraries - as either static or shared
* Compilation of igb_uio driver for Linux
* Building a number of mempool, crypto and net drivers.
* Installation of compiled libraries and headers
* Installation of usertools scripts
* Compilation of testpmd as dpdk-testpmd and install of same
* Generation and installation of pkgconfig file for DPDK
* Contributors guide document addition describing how to add build scripts

What's not implemented:
* Just about everything else :-), including
* Support for non-x86 architectures, including cross-compilation
* Lots of PMDs
* Support for building and running the unit tests

Some key differences from RFC2:
* Removed duplication between the different driver meson files by moving
  the build logic up one level to the driver/meson.build file.
* Added a build option to allow versioning the libraries using the DPDK
  version number, rather than individual .so versions.
* Made EAL a default dependency for libs, to simplify meson.build files for
  a number of them.
* Made the build variables used for libraries and drivers more consistent.
* Moved responsibility for determining if a given driver or library should
  be built to the driver/library's own build file, giving a single place
  where all details about that component are placed, and saving having lots
  of environment detection logic in higher-level build files.
* Begun adding in developer documentation to make it easier for driver
  authors/maintainers to contribute.

Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
Ninja is available in most distributions, and meson - if an updated version
is not available on your distro of choice - can be easily got using 
	"pip3 install meson"

To build and install then use:

	meson build # use default compiler and shared libs
	cd build
	ninja
	sudo ninja install

Thereafter to use DPDK in other build systems one can use:

	pkg-config --cflags DPDK
	pkt-config --libs DPDK

to query the needed DPDK build parameters.

Once reviewed and tested a bit, I hope to apply this set - or a new
revision of it - to the build-next tree, to serve as a baseline for others
to use and to add the missing functionality to.

Regards,
/Bruce

[1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
[2] http://dpdk.org/ml/archives/dev/2017-August/072818.html

Bruce Richardson (17):
  build: add initial infrastructure for meson & ninja builds
  eal: add eal library to meson build
  igb_uio: add igb_uio kmod to meson build
  build: add DPDK libraries to build
  build: add buildtools to meson build
  build: add infrastructure for building PMDs
  drivers/mempool: add SW mempool drivers to meson build
  drivers/crypto: add crypto drv class and null PMD to meson
  crypto/openssl: add driver to meson build
  crypto/qat: add driver to meson build
  drivers/net: add net driver support to meson build
  drivers/net: add set of vdev PMDs to build
  drivers/net: add drivers for Intel NICs to meson build
  app/test-pmd: add test-pmd to meson build
  usertools: add usertools installation to meson build
  build: add option to version libs using DPDK version
  doc: add documentation on how to add new components to DPDK

 app/meson.build                                    |  32 +++
 app/test-pmd/meson.build                           |  73 +++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++
 buildtools/meson.build                             |  34 ++++
 buildtools/pmdinfogen/meson.build                  |  43 +++++
 config/meson.build                                 |  69 +++++++
 config/rte_config.h                                | 121 ++++++++++++
 config/x86/meson.build                             |  70 +++++++
 doc/guides/contributing/coding_style.rst           | 214 +++++++++++++++++++++
 drivers/crypto/meson.build                         |  35 ++++
 drivers/crypto/null/meson.build                    |  33 ++++
 drivers/crypto/openssl/meson.build                 |  38 ++++
 drivers/crypto/qat/meson.build                     |  41 ++++
 drivers/mempool/meson.build                        |  35 ++++
 drivers/mempool/ring/meson.build                   |  32 +++
 drivers/mempool/stack/meson.build                  |  32 +++
 drivers/meson.build                                | 128 ++++++++++++
 drivers/net/af_packet/meson.build                  |  35 ++++
 drivers/net/e1000/base/meson.build                 |  65 +++++++
 drivers/net/e1000/meson.build                      |  44 +++++
 drivers/net/fm10k/base/meson.build                 |  55 ++++++
 drivers/net/fm10k/meson.build                      |  44 +++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++
 drivers/net/i40e/meson.build                       |  60 ++++++
 drivers/net/ixgbe/base/meson.build                 |  60 ++++++
 drivers/net/ixgbe/meson.build                      |  58 ++++++
 drivers/net/meson.build                            |  36 ++++
 drivers/net/null/meson.build                       |  32 +++
 drivers/net/pcap/meson.build                       |  41 ++++
 drivers/net/ring/meson.build                       |  33 ++++
 lib/librte_acl/meson.build                         |  59 ++++++
 lib/librte_bitratestats/meson.build                |  34 ++++
 lib/librte_cfgfile/meson.build                     |  34 ++++
 lib/librte_cmdline/meson.build                     |  55 ++++++
 lib/librte_compat/meson.build                      |  36 ++++
 lib/librte_cryptodev/meson.build                   |  40 ++++
 lib/librte_distributor/meson.build                 |  39 ++++
 lib/librte_eal/bsdapp/eal/meson.build              |  67 +++++++
 lib/librte_eal/bsdapp/meson.build                  |  32 +++
 lib/librte_eal/common/arch/meson.build             |  33 ++++
 lib/librte_eal/common/arch/x86/meson.build         |  32 +++
 lib/librte_eal/common/include/arch/meson.build     |  33 ++++
 lib/librte_eal/common/include/arch/x86/meson.build |  48 +++++
 lib/librte_eal/common/include/meson.build          |  71 +++++++
 lib/librte_eal/common/meson.build                  |  71 +++++++
 lib/librte_eal/linuxapp/eal/meson.build            |  72 +++++++
 lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++
 lib/librte_eal/linuxapp/meson.build                |  42 ++++
 lib/librte_eal/meson.build                         |  44 +++++
 lib/librte_efd/meson.build                         |  34 ++++
 lib/librte_ether/meson.build                       |  45 +++++
 lib/librte_eventdev/meson.build                    |  36 ++++
 lib/librte_gro/meson.build                         |  34 ++++
 lib/librte_hash/meson.build                        |  45 +++++
 lib/librte_ip_frag/meson.build                     |  39 ++++
 lib/librte_jobstats/meson.build                    |  33 ++++
 lib/librte_kni/meson.build                         |  38 ++++
 lib/librte_kvargs/meson.build                      |  34 ++++
 lib/librte_latencystats/meson.build                |  34 ++++
 lib/librte_lpm/meson.build                         |  35 ++++
 lib/librte_mbuf/meson.build                        |  36 ++++
 lib/librte_mempool/meson.build                     |  35 ++++
 lib/librte_meter/meson.build                       |  33 ++++
 lib/librte_metrics/meson.build                     |  33 ++++
 lib/librte_net/meson.build                         |  45 +++++
 lib/librte_pdump/meson.build                       |  34 ++++
 lib/librte_pipeline/meson.build                    |  35 ++++
 lib/librte_port/meson.build                        |  58 ++++++
 lib/librte_power/meson.build                       |  37 ++++
 lib/librte_reorder/meson.build                     |  34 ++++
 lib/librte_ring/meson.build                        |  33 ++++
 lib/librte_sched/meson.build                       |  36 ++++
 lib/librte_table/meson.build                       |  52 +++++
 lib/librte_timer/meson.build                       |  33 ++++
 lib/librte_vhost/meson.build                       |  39 ++++
 lib/meson.build                                    | 105 ++++++++++
 meson.build                                        |  88 +++++++++
 meson_options.txt                                  |   9 +
 usertools/meson.build                              |  32 +++
 80 files changed, 3794 insertions(+)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build
 create mode 100644 drivers/net/meson.build
 create mode 100644 drivers/net/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/meson.build
 create mode 100644 lib/librte_acl/meson.build
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
 create mode 100644 lib/librte_eal/bsdapp/meson.build
 create mode 100644 lib/librte_eal/common/arch/meson.build
 create mode 100644 lib/librte_eal/common/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/meson.build
 create mode 100644 lib/librte_eal/common/meson.build
 create mode 100644 lib/librte_eal/linuxapp/eal/meson.build
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
 create mode 100644 lib/librte_eal/linuxapp/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_gro/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_metrics/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_ring/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_table/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 usertools/meson.build

-- 
2.13.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-12 12:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04 13:23 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Van Haaren, Harry
2017-09-04 13:42 ` Bruce Richardson
2017-09-04 15:49   ` Van Haaren, Harry
2017-09-12 12:55 ` Bruce Richardson
  -- strict thread matches above, loose matches on Subject: below --
2017-09-01 10:03 Bruce Richardson
2017-09-01 10:38 ` Bruce Richardson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.