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 0493542D2F; Fri, 23 Jun 2023 13:43:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD27F42C4D; Fri, 23 Jun 2023 13:43:58 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 00753406B8 for ; Fri, 23 Jun 2023 13:43:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687520637; x=1719056637; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/8l5wOtmvRTERLT0mbBURUfka2o0B5+aCeCY7jrhDN8=; b=MBpuU+NB9NP3uQWGX0LNZc9Md5AHVcLvJ9Lnb/tJaVUhvRrBBrNKb1oA 4WukUNCfzJ6ZVl7SSpZDDUfzId9uoIjDzPWICjCdRrqpY8PN2NdO1TgAt IsjbjxpfZN/O8rGuw622Zuz/1m6gxLFP+c7JuBYtTctwyqfJTfXqdihEx yNlPR+vY40v3QdjwNI9V5gjh0odZNgD+tP7MYQJxEJtRThvgp0G0MaqRn 8/mQvIN19a2gyXxzIgI7EKbXiKCddO1sniN5aB2P8nEbcX5MgUivFn6vv 75TApKwz1FTqMXz7NTe58kUgriJbw9RAMpem/lRZOQX0B5j839Jxo2IRz A==; X-IronPort-AV: E=McAfee;i="6600,9927,10749"; a="447124623" X-IronPort-AV: E=Sophos;i="6.01,151,1684825200"; d="scan'208";a="447124623" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2023 04:43:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10749"; a="1045617387" X-IronPort-AV: E=Sophos;i="6.01,151,1684825200"; d="scan'208";a="1045617387" Received: from silpixa00401385.ir.intel.com ([10.237.214.14]) by fmsmga005.fm.intel.com with ESMTP; 23 Jun 2023 04:43:54 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, Bruce Richardson Subject: [PATCH v4] doc: prefer installing using meson rather than ninja Date: Fri, 23 Jun 2023 12:43:44 +0100 Message-Id: <20230623114344.895409-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230609105139.76239-1-bruce.richardson@intel.com> References: <20230609105139.76239-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 After doing a build, to install DPDK system-wide our documentation recommended using the "ninja install" command. However, for anyone building as a non-root user and only installing as root, the "meson install" command is a better alternative, as it provides for automatically dropping or elevating privileges as necessary in more recent meson releases [1]. [1] https://mesonbuild.com/Installing.html#installing-as-the-superuser Signed-off-by: Bruce Richardson --- V4: * replaced missed calls to ninja install in ci script and test-meson-builds script. V3: * correct order of arguments to meson in CI scripts. The "-C" option must follow the meson "install" command. [This is consistent with other uses e.g. meson compile -C ..., meson test -C ...] V2: * Fix one missed reference to "ninja install" in Linux GSG * Changed CI scripts to use "meson install" to ensure step is properly tested. --- .ci/linux-build.sh | 6 +++--- devtools/test-meson-builds.sh | 4 ++-- doc/guides/contributing/coding_style.rst | 2 +- doc/guides/cryptodevs/uadk.rst | 2 +- doc/guides/freebsd_gsg/build_dpdk.rst | 2 +- doc/guides/freebsd_gsg/build_sample_apps.rst | 2 +- doc/guides/linux_gsg/build_dpdk.rst | 4 ++-- doc/guides/prog_guide/build-sdk-meson.rst | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d0d9f89bae..45f2729996 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -151,14 +151,14 @@ if [ "$ABI_CHECKS" = "true" ]; then git clone --single-branch -b "$REF_GIT_TAG" $REF_GIT_REPO $refsrcdir meson setup $OPTS -Dexamples= $refsrcdir $refsrcdir/build ninja -C $refsrcdir/build - DESTDIR=$(pwd)/reference ninja -C $refsrcdir/build install + DESTDIR=$(pwd)/reference meson install -C $refsrcdir/build find reference/usr/local -name '*.a' -delete rm -rf reference/usr/local/bin rm -rf reference/usr/local/share echo $REF_GIT_TAG > reference/VERSION fi - DESTDIR=$(pwd)/install ninja -C build install + DESTDIR=$(pwd)/install meson install -C build devtools/check-abi.sh reference install ${ABI_CHECKS_WARN_ONLY:-} fi @@ -172,7 +172,7 @@ fi # Test examples compilation with an installed dpdk if [ "$BUILD_EXAMPLES" = "true" ]; then - [ -d install ] || DESTDIR=$(pwd)/install ninja -C build install + [ -d install ] || DESTDIR=$(pwd)/install meson install -C build export LD_LIBRARY_PATH=$(dirname $(find $(pwd)/install -name librte_eal.so)):$LD_LIBRARY_PATH export PKG_CONFIG_PATH=$(dirname $(find $(pwd)/install -name libdpdk.pc)):$PKG_CONFIG_PATH export PKGCONF="pkg-config --define-prefix" diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 1eb28a2490..84b907d2ea 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -158,8 +158,8 @@ compile () # install_target () # { rm -rf $2 - echo "DESTDIR=$2 $ninja_cmd -C $1 install" >&$verbose - DESTDIR=$2 $ninja_cmd -C $1 install >&$veryverbose + echo "DESTDIR=$2 $MESON install -C $1" >&$verbose + DESTDIR=$2 $MESON install -C $1 >&$veryverbose } build () # [meson options] diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst index 0861305dc6..13b2390d9e 100644 --- a/doc/guides/contributing/coding_style.rst +++ b/doc/guides/contributing/coding_style.rst @@ -975,7 +975,7 @@ ext_deps headers **Default Value = []**. Used to return the list of header files for the library that should be - installed to $PREFIX/include when ``ninja install`` is run. As with + installed to $PREFIX/include when ``meson install`` is run. As with source files, these should be specified using the meson ``files()`` function. When ``check_includes`` build option is set to ``true``, each header file diff --git a/doc/guides/cryptodevs/uadk.rst b/doc/guides/cryptodevs/uadk.rst index 9af6b88a5a..136ab4be6a 100644 --- a/doc/guides/cryptodevs/uadk.rst +++ b/doc/guides/cryptodevs/uadk.rst @@ -90,7 +90,7 @@ Test steps meson setup build (--reconfigure) cd build ninja - sudo ninja install + sudo meson install #. Prepare hugepages for DPDK (see also :doc:`../tools/hugepages`) diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst index 514d18c870..86e8e5a805 100644 --- a/doc/guides/freebsd_gsg/build_dpdk.rst +++ b/doc/guides/freebsd_gsg/build_dpdk.rst @@ -47,7 +47,7 @@ The final, install, step generally needs to be run as root:: meson setup build cd build ninja - ninja install + meson install This will install the DPDK libraries and drivers to `/usr/local/lib` with a pkg-config file `libdpdk.pc` installed to `/usr/local/lib/pkgconfig`. The diff --git a/doc/guides/freebsd_gsg/build_sample_apps.rst b/doc/guides/freebsd_gsg/build_sample_apps.rst index c87e982759..b1ab7545b1 100644 --- a/doc/guides/freebsd_gsg/build_sample_apps.rst +++ b/doc/guides/freebsd_gsg/build_sample_apps.rst @@ -22,7 +22,7 @@ the system when DPDK is installed, and so can be built using GNU make. on the FreeBSD system. The following shows how to compile the helloworld example app, following -the installation of DPDK using `ninja install` as described previously:: +the installation of DPDK using `meson install` as described previously:: $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig diff --git a/doc/guides/linux_gsg/build_dpdk.rst b/doc/guides/linux_gsg/build_dpdk.rst index bbd2efc9d8..9c0dd9daf6 100644 --- a/doc/guides/linux_gsg/build_dpdk.rst +++ b/doc/guides/linux_gsg/build_dpdk.rst @@ -68,11 +68,11 @@ Once configured, to build and then install DPDK system-wide use: cd build ninja - ninja install + meson install ldconfig The last two commands above generally need to be run as root, -with the `ninja install` step copying the built objects to their final system-wide locations, +with the `meson install` step copying the built objects to their final system-wide locations, and the last step causing the dynamic loader `ld.so` to update its cache to take account of the new objects. .. note:: diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst index 5deabbe54c..93aa1f80e3 100644 --- a/doc/guides/prog_guide/build-sdk-meson.rst +++ b/doc/guides/prog_guide/build-sdk-meson.rst @@ -12,7 +12,7 @@ following set of commands:: meson setup build cd build ninja - ninja install + meson install This will compile DPDK in the ``build`` subdirectory, and then install the resulting libraries, drivers and header files onto the system - generally @@ -165,7 +165,7 @@ printing each command on a new line as it runs. Installing the Compiled Files ------------------------------ -Use ``ninja install`` to install the required DPDK files onto the system. +Use ``meson install`` to install the required DPDK files onto the system. The install prefix defaults to ``/usr/local`` but can be used as with other options above. The environment variable ``DESTDIR`` can be used to adjust the root directory for the install, for example when packaging. -- 2.39.2