[PATCH v2] doc: update parameters to use for mlx5 on Windows

Dariusz Sosnowski dsosnowski at nvidia.com
Fri Jul 18 13:25:19 CEST 2025


On Tue, Jul 15, 2025 at 07:14:49AM -0700, Andre Muezerie wrote:
> The linker parameters to use with MSVC and Clang differ.
> Showing explicitly what to use with each in the documentation.
> 
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
> ---
>  doc/guides/platform/mlx5.rst | 27 +++++++++++++++++++++++----
>  1 file changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst
> index ab3107209a..94ed59b170 100644
> --- a/doc/guides/platform/mlx5.rst
> +++ b/doc/guides/platform/mlx5.rst
> @@ -268,14 +268,33 @@ configured by the ``ibverbs_link`` build option:
>  Compilation on Windows
>  ~~~~~~~~~~~~~~~~~~~~~~
>  
> -The DevX SDK location must be set through CFLAGS/LDFLAGS,
> -either::
> +The DevX SDK location must be set through CFLAGS/LDFLAGS.
> +When compiling with MSVC, use either::
>  
> -   meson.exe setup "-Dc_args=-I\"%DEVX_INC_PATH%\"" "-Dc_link_args=-L\"%DEVX_LIB_PATH%\"" ...
> +   meson.exe setup ^
> +       "-Dc_args=-I\"%DEVX_INC_PATH%\"" ^
> +       "-Dc_link_args=-LIBPATH:\"%DEVX_LIB_PATH%\"" ^
> +       -Denable_stdatomic=true ^
> +       ...
>  
>  or::
>  
> -   set CFLAGS=-I"%DEVX_INC_PATH%" && set LDFLAGS=-L"%DEVX_LIB_PATH%" && meson.exe setup ...

I checked the old version of setting LDFLAGS to "-L..." and:

- as you mentioned on previous patch, does not work
  (-LIBPATH is required) - this is with meson 1.5.2
- but works with meson 0.57.2 (used in our local builds)

In both cases, MS linker is detected.
Older meson fixes up the flags before passing them linker.
I'm not sure which meson version changed that behavior.

Regardless of that, "-LIBPATH:..." works on both versions I checked
and seems the truly correct way. Let's add this in the docs.

Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>

> +   set CFLAGS=-I"%DEVX_INC_PATH%"
> +   set LDFLAGS=-LIBPATH:"%DEVX_LIB_PATH%"
> +   meson.exe setup -Denable_stdatomic=true ...
> +
> +When compiling with Clang, use either::
> +
> +   meson.exe setup ^
> +       "-Dc_args=-I\"%DEVX_INC_PATH%\"" ^
> +       "-Dc_link_args=-Wl,-LIBPATH:\"%DEVX_LIB_PATH%\"" ^
> +       ...
> +
> +or::
> +
> +   set CFLAGS=-I"%DEVX_INC_PATH%"
> +   set LDFLAGS=-Wl,-LIBPATH:"%DEVX_LIB_PATH%"
> +   meson.exe setup ...
>  
>  
>  .. _mlx5_common_env:
> -- 
> 2.50.1.vfs.0.0
> 


More information about the dev mailing list