Skip to content

Commit

Permalink
doc: prefer installing using Meson rather than Ninja
Browse files Browse the repository at this point in the history
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 <bruce.richardson@intel.com>
  • Loading branch information
bruce-richardson authored and tmonjalo committed Jun 27, 2023
1 parent 9c4dd71 commit 9599c59
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .ci/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions devtools/test-meson-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ compile () # <builddir>
install_target () # <builddir> <installdir>
{
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 () # <directory> <target cc | cross file> <ABI check> [meson options]
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/contributing/coding_style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,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
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/cryptodevs/uadk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
2 changes: 1 addition & 1 deletion doc/guides/freebsd_gsg/build_dpdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/freebsd_gsg/build_sample_apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions doc/guides/linux_gsg/build_dpdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
4 changes: 2 additions & 2 deletions doc/guides/prog_guide/build-sdk-meson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 9599c59

Please sign in to comment.