DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tal Shnaiderman <talshn@nvidia.com>
To: "NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>, Slava Ovsiienko <viacheslavo@nvidia.com>
Subject: RE: [PATCH v3 1/3] common/mlx5: get Windows dependency from standard variables
Date: Wed, 8 Mar 2023 10:24:24 +0000	[thread overview]
Message-ID: <MW4PR12MB56683EF5F7D6CC959EF04F9AA4B49@MW4PR12MB5668.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230302132150.3330288-2-thomas@monjalon.net>

> Subject: [PATCH v3 1/3] common/mlx5: get Windows dependency from
> standard variables
> 
> External email: Use caution opening links or attachments
> 
> 
> The DevX library path had to be provided through the variables
> DEVX_INC_PATH and DEVX_LIB_PATH.
> It was non-standard and triggers some issues with recent Meson.
> 
> Using CFLAGS/LDFLAGS is standard and simpler.
> It is also possible to use the Meson options -Dc_args and -Dc_link_args.
> There are 2 options to provide:
>         -I<include_directory>
>         -L<library_directory>
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  doc/guides/platform/mlx5.rst            | 11 +++++-----
>  drivers/common/mlx5/windows/meson.build | 28 ++++++++++++------------
> -
>  2 files changed, 20 insertions(+), 19 deletions(-)
> 
> diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst
> index 2d6fbe7e44..5fc5d0cb8c 100644
> --- a/doc/guides/platform/mlx5.rst
> +++ b/doc/guides/platform/mlx5.rst
> @@ -259,13 +259,14 @@ configured by the ``ibverbs_link`` build option:
>  Compilation on Windows
>  ~~~~~~~~~~~~~~~~~~~~~~
> 
> -The DevX SDK location must be set through two environment variables:
> +The DevX SDK location must be set through CFLAGS/LDFLAGS,
> +either::
> 
> -``DEVX_LIB_PATH``
> -   path to the DevX lib file.
> +   meson.exe setup "-Dc_args=-I\"%DEVX_INC_PATH%\"" "-Dc_link_args=-
> L\"%DEVX_LIB_PATH%\"" ...
> 
> -``DEVX_INC_PATH``
> -   path to the DevX header files.
> +or::
> +
> +   set CFLAGS=-I"%DEVX_INC_PATH%" && set LDFLAGS=-
> L"%DEVX_LIB_PATH%" && meson.exe setup ...
> 
> 
>  .. _mlx5_common_env:
> diff --git a/drivers/common/mlx5/windows/meson.build
> b/drivers/common/mlx5/windows/meson.build
> index cc486014a8..f60daed840 100644
> --- a/drivers/common/mlx5/windows/meson.build
> +++ b/drivers/common/mlx5/windows/meson.build
> @@ -1,6 +1,20 @@
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright 2019 Mellanox
> Technologies, Ltd
> 
> +if not cc.has_header('mlx5devx.h')
> +    build = false
> +    reason = 'missing dependency, "mlx5devx.h"'
> +    subdir_done()
> +endif
> +
> +devxlib = cc.find_library('mlx5devx', required: true) if not
> +devxlib.found()
> +    build = false
> +    reason = 'missing dependency, "mlx5devx"'
> +    subdir_done()
> +endif
> +ext_deps += devxlib
> +
>  includes += include_directories('.')
> 
>  sources += files(
> @@ -8,20 +22,6 @@ sources += files(
>          'mlx5_common_os.c',
>  )
> 
> -res_lib = run_command(python3, '-c', 'import os;
> print(os.environ["DEVX_LIB_PATH"])', check: false) -res_inc =
> run_command(python3, '-c', 'import os;
> print(os.environ["DEVX_INC_PATH"])', check: false)
> -
> -if (res_lib.returncode() != 0 or res_inc.returncode() != 0)
> -    build = false
> -    reason = 'DevX environment variables are not set, DEVX_LIB_PATH and
> DEVX_INC_PATH vars must be exported'
> -    subdir_done()
> -endif
> -
> -devx_lib_dir = res_lib.stdout().strip() -devx_inc_dir =
> res_inc.stdout().strip()
> -
> -ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true) -
> includes += include_directories(devx_inc_dir)  cflags_options = [
>          '-std=c11',
>          '-Wno-strict-prototypes',
> --
> 2.39.1

Acked-by: Tal Shnaiderman <talshn@nvidia.com>

  parent reply	other threads:[~2023-03-08 10:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 16:10 [PATCH 0/3] fix mlx5 build with MinGW Thomas Monjalon
2023-01-05 16:10 ` [PATCH 1/3] eal/windows: fix pedantic build Thomas Monjalon
2023-01-05 16:40   ` Tyler Retzlaff
2023-01-05 16:10 ` [PATCH 2/3] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-01-05 16:10 ` [PATCH 3/3] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-01-12 20:37 ` [PATCH v2 0/4] fix Windows build with MinGW and mlx5 Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 1/4] eal/windows: fix pedantic build Thomas Monjalon
2023-03-01 16:33     ` Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 2/4] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 3/4] net/mlx5: remove weak stub functions Thomas Monjalon
2023-01-23 19:42     ` Dmitry Kozlyuk
2023-01-24 14:42       ` Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 4/4] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-03-02 13:21 ` [PATCH v3 0/3] mlx5: fix Windows build with Linux MinGW Thomas Monjalon
2023-03-02 13:21   ` [PATCH v3 1/3] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-03-02 17:17     ` Tyler Retzlaff
2023-03-03 14:12       ` Thomas Monjalon
2023-03-03 21:09         ` Tyler Retzlaff
2023-03-06  8:30           ` Thomas Monjalon
2023-03-06 20:55             ` Tyler Retzlaff
2023-03-08 10:24     ` Tal Shnaiderman [this message]
2023-03-02 13:21   ` [PATCH v3 2/3] net/mlx5: remove weak stub functions Thomas Monjalon
2023-03-02 17:19     ` Tyler Retzlaff
2023-03-08 10:26       ` Tal Shnaiderman
2023-03-02 13:21   ` [PATCH v3 3/3] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-03-02 17:28     ` Tyler Retzlaff
2023-03-08 10:27       ` Tal Shnaiderman
2023-03-12 15:44   ` [PATCH v3 0/3] mlx5: fix Windows build with Linux MinGW Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR12MB56683EF5F7D6CC959EF04F9AA4B49@MW4PR12MB5668.namprd12.prod.outlook.com \
    --to=talshn@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).