From patchwork Wed Mar 26 10:37:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 333835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A3E4114008C for ; Wed, 26 Mar 2014 23:07:20 +1100 (EST) Received: from localhost ([::1]:47021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSlsH-0003rQ-9d for incoming@patchwork.ozlabs.org; Wed, 26 Mar 2014 07:20:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSljI-0002BU-BO for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:10:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSljD-0003AW-SP for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:10:44 -0400 Received: from [59.151.112.132] (port=41077 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSljD-00039q-7J for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:10:39 -0400 X-IronPort-AV: E=Sophos;i="4.97,734,1389715200"; d="scan'208";a="28487334" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 Mar 2014 18:34:33 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s2QAapvL003095; Wed, 26 Mar 2014 18:36:55 +0800 Received: from G08CNEXMBPEKD03.g08.fujitsu.local ([10.167.33.86]) by G08CNEXCHPEKD03.g08.fujitsu.local ([10.167.33.85]) with mapi id 14.03.0146.002; Wed, 26 Mar 2014 18:37:02 +0800 From: "hutao@cn.fujitsu.com" To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v3 26/34] configure: add Linux libnuma detection Thread-Index: AQHPSN9V6uqHYJsy6UaOFDx+bxNvAQ== Date: Wed, 26 Mar 2014 10:37:01 +0000 Message-ID: <5bf1fb3c3d7426d55856859c87c65a55ed6cc211.1395825871.git.hutao@cn.fujitsu.com> References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.226.102] MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: Andre Przywara , "ehabkost@redhat.com" , "imammedo@redhat.com" , "mtosatti@redhat.com" , Paolo Bonzini , "a.motakis@virtualopensystems.com" , "gaowanlong@cn.fujitsu.com" Subject: [Qemu-devel] [PATCH v3 26/34] configure: add Linux libnuma detection X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Wanlong Gao Add detection of libnuma (mostly contained in the numactl package) to the configure script. Can be enabled or disabled on the command line, default is use if available. Signed-off-by: Andre Przywara Signed-off-by: Wanlong Gao Signed-off-by: Paolo Bonzini --- configure | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/configure b/configure index aae617e..67f5c68 100755 --- a/configure +++ b/configure @@ -322,6 +322,7 @@ tpm="no" libssh2="" vhdx="" quorum="no" +numa="" # parse CC options first for opt do @@ -1077,6 +1078,10 @@ for opt do ;; --enable-quorum) quorum="yes" ;; + --disable-numa) numa="no" + ;; + --enable-numa) numa="yes" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -1339,6 +1344,8 @@ Advanced options (experts only): --enable-vhdx enable support for the Microsoft VHDX image format --disable-quorum disable quorum block filter support --enable-quorum enable quorum block filter support + --disable-numa disable libnuma support + --enable-numa enable libnuma support NOTE: The object files are built at the place where configure is launched EOF @@ -3060,6 +3067,27 @@ if compile_prog "" "" ; then fi ########################################## +# libnuma probe + +if test "$numa" != "no" ; then + numa=no + cat > $TMPC << EOF +#include +int main(void) { return numa_available(); } +EOF + + if compile_prog "" "-lnuma" ; then + numa=yes + libs_softmmu="-lnuma $libs_softmmu" + else + if test "$numa" = "yes" ; then + feature_not_found "linux NUMA (install numactl?)" + fi + numa=no + fi +fi + +########################################## # signalfd probe signalfd="no" cat > $TMPC << EOF @@ -4133,6 +4161,7 @@ echo "vhdx $vhdx" echo "Quorum $quorum" echo "lzo support $lzo" echo "snappy support $snappy" +echo "NUMA host support $numa" if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -5085,6 +5114,10 @@ if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi +if test "$numa" = "yes"; then + echo "CONFIG_NUMA=y" >> $config_host_mak +fi + # build tree in object directory in case the source is not in the current directory DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" DIRS="$DIRS fsdev"