From patchwork Thu Jan 12 20:37:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 121978 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F20C0423BA; Thu, 12 Jan 2023 21:37:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ADCAF42DBE; Thu, 12 Jan 2023 21:37:36 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mails.dpdk.org (Postfix) with ESMTP id E255642D27 for ; Thu, 12 Jan 2023 21:37:34 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C913A3200805; Thu, 12 Jan 2023 15:37:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 12 Jan 2023 15:37:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1673555852; x=1673642252; bh=fQ HsfNoXz8rd7ZgG47qf4c3I1s+uQ8t7Fd+8FRhup3M=; b=LmWEI/+HGVnHIjGlGL nWRqa2GZTAHKPKRRMilz2SXEYwYLCgaBsc4CR6Zb8bO3sAGTDrPKiA9VXI/d30pF wL51/KPwjqDsdl1mJyJgu3BVvcWqJC5H/iGWqUF6QWBokPWZZ4mNOfQOrvKPJ5Qq JoZhG/86UdhU1/FYWlym1UiJzhlb26djTzVxNxqVYnBltoND7VcXaz6BiNjw9r7C BH3Xpxmu0dRGZAIqNW6TQ8Mh+Pbk3hXWyNjWR606tvLXOg+Qi9++eKNB1OM0tMIT nNXwr/Hu6SN5Gi2mk7uiAgdp9JzsLfaAY6evI28MNJsy0TN135hjfQBuTtbONyzX G4ZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1673555852; x=1673642252; bh=fQHsfNoXz8rd7 ZgG47qf4c3I1s+uQ8t7Fd+8FRhup3M=; b=W1NpiojB26PBY/FOzh6y6kS4aA1kc 89pWbAtM35U0LPiuUO29AtbcwpmqEZe7+67klYFzTWzDQ+SkoHHIjXu08MT0ibGa Q54J4mKK347aL88oexRHNvnQunYIn4YefzeUa/XbFoeKkKkpGHWMLUuNvM6mVg2o HKVxoIudwUQPxy39zCwJutOewbm+Jrd4AMFqeUAxMyE3+4nFLDvRD76e7ameBU1u OueP/G+d6bDYbMFDaXiY7o0TqNUbAE2R4IpvVjBfKSrEIhZJtntsJvi1Y4OV6kfr 0CDgyEYAgcWKFab57fwpaEJ+ak/QylJ4xUz4d6r/p53mZ75sPp31bJ3kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeigddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 15:37:31 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Tal Shnaiderman , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v2 2/4] common/mlx5: get Windows dependency from standard variables Date: Thu, 12 Jan 2023 21:37:16 +0100 Message-Id: <20230112203719.1528619-3-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112203719.1528619-1-thomas@monjalon.net> References: <20230105161020.247780-1-thomas@monjalon.net> <20230112203719.1528619-1-thomas@monjalon.net> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org It was requested to provide path to DevX library through 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 -L Signed-off-by: Thomas Monjalon --- 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 5784b9a87b..f68ccf127d 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',