DPDK patches and discussions
 help / color / mirror / Atom feed
* [v1 0/3] meson options related changes
@ 2024-08-06 13:42 Gagandeep Singh
  2024-08-06 13:42 ` [v1 1/3] meson: add a meson option to install examples Gagandeep Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-06 13:42 UTC (permalink / raw)
  To: dev

meson options related changes

Gagandeep Singh (3):
  meson: add a meson option to install examples
  meson: add a meson option to install examples source
  meson: skip symlinks to PMDs script on no sub directory

 config/meson.build   |  7 +++++--
 examples/meson.build | 13 ++++++++++++-
 meson.build          |  7 ++++---
 meson_options.txt    |  4 ++++
 4 files changed, 25 insertions(+), 6 deletions(-)

-- 
2.25.1


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

* [v1 1/3] meson: add a meson option to install examples
  2024-08-06 13:42 [v1 0/3] meson options related changes Gagandeep Singh
@ 2024-08-06 13:42 ` Gagandeep Singh
  2024-08-06 13:58   ` Bruce Richardson
  2024-08-06 13:42 ` [v1 2/3] meson: add a meson option to install examples source Gagandeep Singh
  2024-08-06 13:42 ` [v1 3/3] meson: skip symlinks to PMDs script on no sub directory Gagandeep Singh
  2 siblings, 1 reply; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-06 13:42 UTC (permalink / raw)
  To: dev, Bruce Richardson

Adding a meson option "enable_examples_bin_install"
to install the examples binaries in bin.

Default value is false.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 examples/meson.build | 13 ++++++++++++-
 meson_options.txt    |  2 ++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/examples/meson.build b/examples/meson.build
index 8e8968a1fa..0d0df4e36d 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -124,10 +124,21 @@ foreach example: examples
     if allow_experimental_apis
         cflags += '-DALLOW_EXPERIMENTAL_API'
     endif
-    executable('dpdk-' + name, sources,
+    if get_option('enable_examples_bin_install')
+      executable('dpdk-' + name, sources,
+            include_directories: includes,
+            link_whole: link_whole_libs,
+            link_args: ldflags,
+            c_args: cflags,
+            dependencies: dep_objs,
+	    install_rpath: join_paths(get_option('prefix'), driver_install_path),
+	    install: true)
+    else
+      executable('dpdk-' + name, sources,
             include_directories: includes,
             link_whole: link_whole_libs,
             link_args: ldflags,
             c_args: cflags,
             dependencies: dep_objs)
+    endif
 endforeach
diff --git a/meson_options.txt b/meson_options.txt
index e49b2fc089..e6f83f3f92 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,8 @@ option('enable_drivers', type: 'string', value: '', description:
        'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
+option('enable_examples_bin_install', type: 'boolean', value: false, description:
+       'Install examples binaries')
 option('enable_kmods', type: 'boolean', value: true, description:
        '[Deprecated - will be removed in future release] build kernel modules')
 option('enable_libs', type: 'string', value: '', description:
-- 
2.25.1


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

* [v1 2/3] meson: add a meson option to install examples source
  2024-08-06 13:42 [v1 0/3] meson options related changes Gagandeep Singh
  2024-08-06 13:42 ` [v1 1/3] meson: add a meson option to install examples Gagandeep Singh
@ 2024-08-06 13:42 ` Gagandeep Singh
  2024-08-06 14:01   ` Bruce Richardson
  2024-08-06 13:42 ` [v1 3/3] meson: skip symlinks to PMDs script on no sub directory Gagandeep Singh
  2 siblings, 1 reply; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-06 13:42 UTC (permalink / raw)
  To: dev, Bruce Richardson

Adding a meson option "enable_examples_source_install"
to enable or disable installation of examples source code.

Default value is true.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 meson.build       | 7 ++++---
 meson_options.txt | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index 8b248d4505..7cdd54f088 100644
--- a/meson.build
+++ b/meson.build
@@ -88,12 +88,13 @@ subdir('app')
 # build docs
 subdir('doc')
 
-# build any examples explicitly requested - useful for developers - and
-# install any example code into the appropriate install path
+# build any examples explicitly requested
 subdir('examples')
-install_subdir('examples',
+if get_option('enable_examples_source_install')
+  install_subdir('examples',
         install_dir: get_option('datadir') + '/dpdk',
         exclude_files: ex_file_excludes)
+endif
 
 # build kernel modules
 subdir('kernel')
diff --git a/meson_options.txt b/meson_options.txt
index e6f83f3f92..4f498093e6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description:
        'Install headers to build drivers.')
 option('enable_examples_bin_install', type: 'boolean', value: false, description:
        'Install examples binaries')
+option('enable_examples_source_install', type: 'boolean', value: true, description:
+       'Install examples source code')
 option('enable_kmods', type: 'boolean', value: true, description:
        '[Deprecated - will be removed in future release] build kernel modules')
 option('enable_libs', type: 'string', value: '', description:
-- 
2.25.1


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

* [v1 3/3] meson: skip symlinks to PMDs script on no sub directory
  2024-08-06 13:42 [v1 0/3] meson options related changes Gagandeep Singh
  2024-08-06 13:42 ` [v1 1/3] meson: add a meson option to install examples Gagandeep Singh
  2024-08-06 13:42 ` [v1 2/3] meson: add a meson option to install examples source Gagandeep Singh
@ 2024-08-06 13:42 ` Gagandeep Singh
  2024-08-06 13:57   ` Bruce Richardson
  2 siblings, 1 reply; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-06 13:42 UTC (permalink / raw)
  To: dev, Bruce Richardson

if user gives option -Ddrivers_install_subdir= or
-Ddrivers_install_subdir=. to install all the PMDs in
parent directory, The post installation script
"symlink-drivers-solibs.sh" can create invalid library file
named 'librte_*.so*' or meson installation errors:

ln: './librte_*' and './librte_*' are the same file
FAILED: install script '/bin/sh /home/nxa12342/upstream/dpdk/config/.
/buildtools/symlink-drivers-solibs.sh lib/x86_64-linux-gnu .' exit code 1,
stopped
FAILED: meson-install

This patch removes this post-install script execution to symlink
the PMDs libraries when no sub directory is given.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 config/meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 8c8b019c25..4c1c6848ad 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -95,8 +95,11 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 # e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
 # to be in the library path, so symlink the drivers from the main lib directory.
 if not is_windows
-    meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
-            get_option('libdir'), pmd_subdir_opt)
+    # skip symlink-drivers-solibs.sh execution on no sub directory
+    if pmd_subdir_opt != '' and pmd_subdir_opt != '.'
+	meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
+		get_option('libdir'), pmd_subdir_opt)
+    endif
 elif meson.version().version_compare('>=0.55.0')
     # 0.55.0 is required to use external program with add_install_script
     meson.add_install_script(py3,
-- 
2.25.1


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

* Re: [v1 3/3] meson: skip symlinks to PMDs script on no sub directory
  2024-08-06 13:42 ` [v1 3/3] meson: skip symlinks to PMDs script on no sub directory Gagandeep Singh
@ 2024-08-06 13:57   ` Bruce Richardson
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2024-08-06 13:57 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: dev

On Tue, Aug 06, 2024 at 07:12:18PM +0530, Gagandeep Singh wrote:
> if user gives option -Ddrivers_install_subdir= or
> -Ddrivers_install_subdir=. to install all the PMDs in
> parent directory, The post installation script
> "symlink-drivers-solibs.sh" can create invalid library file
> named 'librte_*.so*' or meson installation errors:
> 
> ln: './librte_*' and './librte_*' are the same file
> FAILED: install script '/bin/sh /home/nxa12342/upstream/dpdk/config/.
> /buildtools/symlink-drivers-solibs.sh lib/x86_64-linux-gnu .' exit code 1,
> stopped
> FAILED: meson-install
> 
> This patch removes this post-install script execution to symlink
> the PMDs libraries when no sub directory is given.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [v1 1/3] meson: add a meson option to install examples
  2024-08-06 13:42 ` [v1 1/3] meson: add a meson option to install examples Gagandeep Singh
@ 2024-08-06 13:58   ` Bruce Richardson
  2024-08-07  4:09     ` Gagandeep Singh
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2024-08-06 13:58 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: dev

On Tue, Aug 06, 2024 at 07:12:16PM +0530, Gagandeep Singh wrote:
> Adding a meson option "enable_examples_bin_install"
> to install the examples binaries in bin.
> 
> Default value is false.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  examples/meson.build | 13 ++++++++++++-
>  meson_options.txt    |  2 ++
>  2 files changed, 14 insertions(+), 1 deletion(-)
> 
Is there a particular reason we might want to do this? Installing sample
code binaries in bin seems rather strange to me.

/Bruce

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

* Re: [v1 2/3] meson: add a meson option to install examples source
  2024-08-06 13:42 ` [v1 2/3] meson: add a meson option to install examples source Gagandeep Singh
@ 2024-08-06 14:01   ` Bruce Richardson
  2024-08-07  4:08     ` Gagandeep Singh
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2024-08-06 14:01 UTC (permalink / raw)
  To: Gagandeep Singh; +Cc: dev

On Tue, Aug 06, 2024 at 07:12:17PM +0530, Gagandeep Singh wrote:
> Adding a meson option "enable_examples_source_install"
> to enable or disable installation of examples source code.
> 
> Default value is true.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
>  meson.build       | 7 ++++---
>  meson_options.txt | 2 ++
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
Is installing sample code for DPDK a problem that we need to disable it? I
was expecting that such filtering out of unwanted files could be done via
packaging rather than us having to add lots of DPDK build options to
control these things.

/Bruce

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

* RE: [v1 2/3] meson: add a meson option to install examples source
  2024-08-06 14:01   ` Bruce Richardson
@ 2024-08-07  4:08     ` Gagandeep Singh
  0 siblings, 0 replies; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-07  4:08 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

Hi,

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, August 6, 2024 7:32 PM
> To: Gagandeep Singh <G.Singh@nxp.com>
> Cc: dev@dpdk.org
> Subject: Re: [v1 2/3] meson: add a meson option to install examples source
> 
> On Tue, Aug 06, 2024 at 07:12:17PM +0530, Gagandeep Singh wrote:
> > Adding a meson option "enable_examples_source_install"
> > to enable or disable installation of examples source code.
> >
> > Default value is true.
> >
> > Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> > ---
> >  meson.build       | 7 ++++---
> >  meson_options.txt | 2 ++
> >  2 files changed, 6 insertions(+), 3 deletions(-)
> >
> Is installing sample code for DPDK a problem that we need to disable it? I
> was expecting that such filtering out of unwanted files could be done via
> packaging rather than us having to add lots of DPDK build options to control
> these things.
> 
I understand your point that packaging could handle filtering out unwanted files.
However, adding a build option to disable DPDK examples source code installation provides
more control and flexibility for users who may have specific requirements or constraints.

While packaging can filter out files, this option allows users to avoid
downloading and compiling the examples altogether, which can be beneficial for:

- Users with limited disk space or network bandwidth
- Users who only need the core DPDK libraries and binaries and don't want the examples source code.

By default, the option is set to true, so the behavior remains unchanged.
This option is only for those who need more control over their build process.
I believe this optional flag adds flexibility without imposing unnecessary files on users and is a minor
and useful extension to the build system.

> /Bruce

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

* RE: [v1 1/3] meson: add a meson option to install examples
  2024-08-06 13:58   ` Bruce Richardson
@ 2024-08-07  4:09     ` Gagandeep Singh
  0 siblings, 0 replies; 9+ messages in thread
From: Gagandeep Singh @ 2024-08-07  4:09 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

Hi,

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, August 6, 2024 7:28 PM
> To: Gagandeep Singh <G.Singh@nxp.com>
> Cc: dev@dpdk.org
> Subject: Re: [v1 1/3] meson: add a meson option to install examples
> 
> On Tue, Aug 06, 2024 at 07:12:16PM +0530, Gagandeep Singh wrote:
> > Adding a meson option "enable_examples_bin_install"
> > to install the examples binaries in bin.
> >
> > Default value is false.
> >
> > Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> > ---
> >  examples/meson.build | 13 ++++++++++++-
> >  meson_options.txt    |  2 ++
> >  2 files changed, 14 insertions(+), 1 deletion(-)
> >
> Is there a particular reason we might want to do this? Installing sample code
> binaries in bin seems rather strange to me.
> 
Currently, I can see only app binaries are getting installed in bin but not examples binaries. I am not able to
find the particular reason behind this.
The main reason to have the examples in installation directory is to provides a convenient
way for users to explore DPDK's examples without having to manually scan each example build directory and copy them in
their package.
The default behavior remains unchanged.

> /Bruce

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

end of thread, other threads:[~2024-08-07  4:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 13:42 [v1 0/3] meson options related changes Gagandeep Singh
2024-08-06 13:42 ` [v1 1/3] meson: add a meson option to install examples Gagandeep Singh
2024-08-06 13:58   ` Bruce Richardson
2024-08-07  4:09     ` Gagandeep Singh
2024-08-06 13:42 ` [v1 2/3] meson: add a meson option to install examples source Gagandeep Singh
2024-08-06 14:01   ` Bruce Richardson
2024-08-07  4:08     ` Gagandeep Singh
2024-08-06 13:42 ` [v1 3/3] meson: skip symlinks to PMDs script on no sub directory Gagandeep Singh
2024-08-06 13:57   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).