Skip to content

Commit

Permalink
acinclude: Remove default library for DPDK.
Browse files Browse the repository at this point in the history
The default DPDK library used before this patch in case pkg-config
fails to find libdpdk is only valid for make based DPDK builds.
Hence remove them.

As a consequence, now this error message [1] is thrown when pkg-config
cannot find libdpdk instead of proceeding to check for a faulty
pkg-config and reporting incorrect error message [2].

Also, update the documentation to export PKG_CONFIG_PATH since on some
systems, the default install path for DPDK libraries is not present in
the default search path of pkg-config.
Ex: for Fedora 32 default pkg-config search path:
  /usr/lib64/pkgconfig:/usr/share/pkgconfig

while by default Meson installs DPDK libraries at:
  /usr/local/lib64/pkgconfig

[1] Package libdpdk was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libdpdk.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libdpdk', required by 'virtual:world', not found

[2] checking for DPDK... no
    checking for faulty pkg-config version... yes
    configure: error: Please upgrade pkg-config

Also, update the build documentation for AVX512 optimization.

Fixes: 252e1e5 ("dpdk: Update to use DPDK v20.11.")
Reported-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
Sunil Pai G authored and igsilya committed Jan 29, 2021
1 parent e67f6ac commit 70a7f7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
19 changes: 15 additions & 4 deletions Documentation/intro/install/dpdk.rst
Expand Up @@ -88,6 +88,19 @@ Install DPDK
$ sudo ninja -C build install
$ sudo ldconfig

Check if libdpdk can be found by pkg-config::

$ pkg-config --modversion libdpdk

The above command should return the DPDK version installed. If not found,
export the path to the installed DPDK libraries::

$ export PKG_CONFIG_PATH=/path/to/installed/".pc" file/for/DPDK

For example, On Fedora 32::

$ export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

Detailed information can be found at `DPDK documentation`_.

#. (Optional) Configure and export the DPDK shared library location
Expand All @@ -97,11 +110,9 @@ Install DPDK

Exporting the path to library is not necessary if the DPDK libraries are
system installed. For libraries installed using a prefix, export the path
to this library and also update the $PKG_CONFIG_PATH for use
before building OVS::
to this library::

$ export LD_LIBRARY_PATH=/path/to/installed/DPDK/libraries
$ export PKG_CONFIG_PATH=/path/to/installed/".pc" file/for/DPDK

.. note::

Expand Down Expand Up @@ -152,7 +163,7 @@ has to be configured to build against the DPDK library (``--with-dpdk``).

An example that enables the AVX512 optimizations is::

$ ./configure --with-dpdk=$DPDK_BUILD CFLAGS="-Ofast -msse4.2 -mpopcnt"
$ ./configure --with-dpdk=static CFLAGS="-Ofast -msse4.2 -mpopcnt"

#. Build and install OVS, as described in :ref:`general-building`

Expand Down
8 changes: 2 additions & 6 deletions acinclude.m4
Expand Up @@ -350,16 +350,12 @@ AC_DEFUN([OVS_CHECK_DPDK], [
"shared")
PKG_CHECK_MODULES([DPDK], [libdpdk], [
DPDK_INCLUDE="$DPDK_CFLAGS"
DPDK_LIB="$DPDK_LIBS"], [
DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk"
DPDK_LIB="-ldpdk"])
DPDK_LIB="$DPDK_LIBS"])
;;
"static" | "yes")
PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], [
DPDK_INCLUDE="$DPDK_CFLAGS"
DPDK_LIB="$DPDK_LIBS"], [
DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk"
DPDK_LIB="-ldpdk"])
DPDK_LIB="$DPDK_LIBS"])
dnl Statically linked private DPDK objects of form
dnl -l:file.a must be positioned between
Expand Down

0 comments on commit 70a7f7f

Please sign in to comment.