From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E9EAA0A0A; Fri, 22 Jan 2021 23:43:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B42D1411C8; Fri, 22 Jan 2021 23:43:41 +0100 (CET) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mails.dpdk.org (Postfix) with ESMTP id 7A2851411C5 for ; Fri, 22 Jan 2021 23:43:39 +0100 (CET) Received: by mail-lj1-f171.google.com with SMTP id x23so8331661lji.7 for ; Fri, 22 Jan 2021 14:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IQ2jEZ6da8l6h7Y2/fjKbYxUSgB3AmWjJ2m4ix05fCg=; b=mAWr/prq+PQTtzQ2B6SJgbqn92cvrQQ3rB5Xjz8ZrOynK4IEezJ8MaG7hLGTC38nKs QVI+SwrHxyAT83izJ6z0VI1TLd0mRslHwJr5opDwV04NWF7ySyeTxZwZE8qGNKRk3y8k pt26eDHCR9h+17LfUHSPP9h4+wWTDfE9ToV0Vdngzu7LezUZAqtcqXqkFJPYaaGaG1+w IQ84QSYlRKkvaRiNRC+jjjhXDiL6UdwzUbaOvIw4tlrvsstzsc0Z7FUZvSSw2RJhdlTy Xs1b+gMA68RCQ+oPBjx+kncZj6h93c2/9bEVZc1Cmh8MPocRpHYRwcc1MDUXO2DM5L66 +N8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IQ2jEZ6da8l6h7Y2/fjKbYxUSgB3AmWjJ2m4ix05fCg=; b=YcwOLi4LfQvAn2dvRgfMmxckvpQ3B45BPTjy5Ae69cNe8vwv424532SYV1jMaie0Ph hj+2VokfupsttfQllV8xbo3Ec/Tpsp2TrBxaCmm57qfI4XD7qOAJZxznCs42IzAUnMg1 VYH/WOEU1wMOUPguD2kemFEIPsNqW/NKbOULCkcvEd4H0E6/eG9OB30pLmIJ5vmg9do6 GyNAeiC4z3Fp8drQgwGeeYjmqn1Aoysk2YAB+QRD5SxsKulew7SPbto7rYDteKEnrTKl gpnszXcnaFSEzLvOHV054UvME8wf/ovVeCBQlXE+PmU6rne/uS7n+ghHvf63ky6sztQg yxQQ== X-Gm-Message-State: AOAM532va2V89/HYFRRU8hVXLwQM54kWT4cnbaRv8guZkyv6ebCYR8YZ dKjo3pQ+cgx9/pYfIyzW6hbTMyZKxL6XcA== X-Google-Smtp-Source: ABdhPJzY4akNFsyhLMDfzF2XyPOVaXxEd92/R209+0SMKl9NOKPIg2Wk7OE5dZBB5BtiPMXXHL9yeQ== X-Received: by 2002:a2e:a40b:: with SMTP id p11mr92573ljn.315.1611355418860; Fri, 22 Jan 2021 14:43:38 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id v11sm1119753ljg.128.2021.01.22.14.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 14:43:38 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Maxime Coquelin , Bruce Richardson , Thomas Monjalon , Dmitry Kozlyuk , Aaron Conole , Michael Santana Date: Sat, 23 Jan 2021 01:43:26 +0300 Message-Id: <20210122224327.5621-3-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210122224327.5621-1-dmitry.kozliuk@gmail.com> References: <20201020174404.28653-1-dmitry.kozliuk@gmail.com> <20210122224327.5621-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v9 2/3] build: use Python pmdinfogen 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 Sender: "dev" Use the same interpreter to run pmdinfogen as for other build scripts. Adjust wrapper script accordingly and also don't suppress stderr from ar and pmdinfogen. Add configure-time check for elftools Python module for Unix hosts. Add pyelftools to CI configuration and build requirements for Linux and FreeBSD. Currently neither Windows uses pmdinfogen, nor is COFF (PE) supported. Signed-off-by: Dmitry Kozlyuk --- .github/workflows/build.yml | 4 ++-- .travis.yml | 2 +- buildtools/gen-pmdinfo-cfile.sh | 6 +++--- buildtools/meson.build | 15 +++++++++++++++ doc/guides/freebsd_gsg/build_dpdk.rst | 3 ++- doc/guides/linux_gsg/sys_reqs.rst | 6 ++++++ drivers/meson.build | 2 +- meson.build | 1 - 8 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b72df0eb..a5b579add 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,8 +91,8 @@ jobs: run: sudo apt update - name: Install packages run: sudo apt install -y ccache libnuma-dev python3-setuptools - python3-wheel python3-pip ninja-build libbsd-dev libpcap-dev - libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev + python3-wheel python3-pip python3-pyelftools ninja-build libbsd-dev + libpcap-dev libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev - name: Install libabigail build dependencies if no cache is available if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true' run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev diff --git a/.travis.yml b/.travis.yml index 5aa7ad49f..4391af1d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ addons: apt: update: true packages: &required_packages - - [libnuma-dev, python3-setuptools, python3-wheel, python3-pip, ninja-build] + - [libnuma-dev, python3-setuptools, python3-wheel, python3-pip, python3-pyelftools, ninja-build] - [libbsd-dev, libpcap-dev, libibverbs-dev, libcrypto++-dev, libfdt-dev, libjansson-dev] _aarch64_packages: &aarch64_packages diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh index 43059cf36..109ee461e 100755 --- a/buildtools/gen-pmdinfo-cfile.sh +++ b/buildtools/gen-pmdinfo-cfile.sh @@ -4,11 +4,11 @@ arfile=$1 output=$2 -pmdinfogen=$3 +shift 2 +pmdinfogen=$* # The generated file must not be empty if compiled in pedantic mode echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output for ofile in `ar t $arfile` ; do - ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null + ar p $arfile $ofile | $pmdinfogen - - >> $output done -exit 0 diff --git a/buildtools/meson.build b/buildtools/meson.build index 04808dabc..dd4c0f640 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -17,3 +17,18 @@ else endif map_to_win_cmd = py3 + files('map_to_win.py') sphinx_wrapper = py3 + files('call-sphinx-build.py') +pmdinfogen = py3 + files('pmdinfogen.py') + +# TODO: starting from Meson 0.51.0 use +# python3 = import('python').find_installation('python', +# modules : python3_required_modules) +python3_required_modules = [] +if host_machine.system() != 'windows' + python3_required_modules = ['elftools'] +endif +foreach module : python3_required_modules + script = 'import importlib.util; import sys; exit(importlib.util.find_spec("@0@") is None)' + if run_command(py3, '-c', script.format(module)).returncode() != 0 + error('missing python module: @0@'.format(module)) + endif +endforeach diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst index e3005a7f3..bed353473 100644 --- a/doc/guides/freebsd_gsg/build_dpdk.rst +++ b/doc/guides/freebsd_gsg/build_dpdk.rst @@ -14,10 +14,11 @@ The following FreeBSD packages are required to build DPDK: * meson * ninja * pkgconf +* py37-pyelftools These can be installed using (as root):: - pkg install meson pkgconf + pkg install meson pkgconf py37-pyelftools To compile the required kernel modules for memory management and working with physical NIC devices, the kernel sources for FreeBSD also diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst index be714adf2..a05b5bd81 100644 --- a/doc/guides/linux_gsg/sys_reqs.rst +++ b/doc/guides/linux_gsg/sys_reqs.rst @@ -52,6 +52,12 @@ Compilation of the DPDK * If the packaged version is below the minimum version, the latest versions can be installed from Python's "pip" repository: ``pip3 install meson ninja`` +* ``pyelftools`` (version 0.22+) + + * For RHEL/Fedora systems it can be installed using ``dnf install python-pyelftools`` + + * For Ubuntu/Debian it can be installed using ``apt install python3-pyelftools`` + * Library for handling NUMA (Non Uniform Memory Access). * ``numactl-devel`` in RHEL/Fedora; diff --git a/drivers/meson.build b/drivers/meson.build index 77f65fa90..ff5cdb952 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -132,7 +132,7 @@ foreach subpath:subdirs command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen], output: out_filename, - depends: [pmdinfogen, tmp_lib]) + depends: [tmp_lib]) endif # now build the static driver diff --git a/meson.build b/meson.build index 45d974cd2..2b9c37eb4 100644 --- a/meson.build +++ b/meson.build @@ -45,7 +45,6 @@ subdir('buildtools') subdir('config') # build libs and drivers -subdir('buildtools/pmdinfogen') subdir('lib') subdir('drivers') -- 2.29.2