From patchwork Wed Nov 10 10:07:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pai G, Sunil" X-Patchwork-Id: 1553346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hq0sf3dvwz9sCD for ; Wed, 10 Nov 2021 21:08:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1890D80F7A; Wed, 10 Nov 2021 10:08:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ewLYkLGJwqUb; Wed, 10 Nov 2021 10:08:01 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4AE4580F64; Wed, 10 Nov 2021 10:08:00 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 08872C0019; Wed, 10 Nov 2021 10:08:00 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 88746C000E for ; Wed, 10 Nov 2021 10:07:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 781594011D for ; Wed, 10 Nov 2021 10:07:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2D5EWlX4Mp_q for ; Wed, 10 Nov 2021 10:07:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by smtp4.osuosl.org (Postfix) with ESMTPS id D24044010F for ; Wed, 10 Nov 2021 10:07:58 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="293472651" X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="293472651" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2021 02:07:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="669751815" Received: from silpixa00400896.ir.intel.com ([10.243.23.14]) by orsmga005.jf.intel.com with ESMTP; 10 Nov 2021 02:07:57 -0800 From: Sunil Pai G To: dev@openvswitch.org Date: Wed, 10 Nov 2021 10:07:44 +0000 Message-Id: <20211110100744.204072-1-sunil.pai.g@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH v1] acinclude: Provide error info when linking fails with DPDK. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Currently the configure script provides no infomation but to update the pkg-config path on failure to link with DPDK. Fix this to provide more information to the user on failure. Before: checking whether linking with dpdk works... no configure: error: Could not find DPDK library in default search path, update PKG_CONFIG_PATH for pkg-config to find the .pc file in non-standard location After: checking whether linking with dpdk works... no configure: error: configure:27158: gcc -o conftest -include rte_config.h ... -Wl,--whole-archive -l:librte_bus_pci.a -l:my_lib.a ... -lunwind >&5 /usr/bin/ld: cannot find -l:my_lib.a Signed-off-by: Sunil Pai G --- acinclude.m4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index dba365ea1..1af277447 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -475,7 +475,8 @@ AC_DEFUN([OVS_CHECK_DPDK], [ # DPDK uses dlopen to load plugins. OVS_FIND_DEPENDENCY([dlopen], [dl], [libdl]) - AC_MSG_CHECKING([whether linking with dpdk works]) + DPDK_STRING="whether linking with dpdk works" + AC_MSG_CHECKING([$DPDK_STRING]) LIBS="$DPDK_LIB $LIBS" AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include @@ -485,10 +486,10 @@ AC_DEFUN([OVS_CHECK_DPDK], [ [AC_MSG_RESULT([yes]) DPDKLIB_FOUND=true], [AC_MSG_RESULT([no]) + # Fetch the cause of failure from config.log + DPDK_LINK_ERROR=$(grep "$DPDK_STRING" -A2 config.log | tail -n2) AC_MSG_ERROR(m4_normalize([ - Could not find DPDK library in default search path, update - PKG_CONFIG_PATH for pkg-config to find the .pc file in - non-standard location])) + $DPDK_LINK_ERROR])) ]) CFLAGS="$ovs_save_CFLAGS"