Changeset 571e2f9


Ignore:
Timestamp:
11/24/16 23:52:33 (4 years ago)
Author:
Richard Sanger <rsanger@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
b148e3b
Parents:
f7f7015
Message:

Update DPDK detection

  • Add support for versions DPDK 2.1+ which renamed
  • Add support for recent distro packages dev-dpdk
    • Ubuntu yakkety (16.10) and newer
    • Likley Debian buster (10) currently unstable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    r32a3ec5 r571e2f9  
    387387# Check for DPDK
    388388AC_ARG_WITH(dpdk,
    389             AS_HELP_STRING(--with-dpdk,include DPDK live capture support (Must set RTE_SDK/_TARGET environment variable)),
     389            AS_HELP_STRING(--with-dpdk,include DPDK live capture support (From either the RTE_SDK/_TARGET environment variable or the dpdk-dev package)),
    390390[
    391391        if test "$withval" = no
     
    402402libtrace_dpdk=false
    403403if test "$want_dpdk" != no; then
    404     saved_ldflags="$LDFLAGS"
    405     # Add to our libpath location
    406     LDFLAGS="$LDFLAGS -L$RTE_SDK/$RTE_TARGET/lib/"
    407     # Test that the library exists, we cannot be sure of what extra library flags need to be added
    408     # this could change in the next version which would make the test fail
    409     #AC_CHECK_LIB(intel_dpdk, rte_eal_init, dpdk_found=1, dpdk_found=0, -lpthread -lm -lrt)
    410 
    411     # So instead simply check for existence
    412     AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libintel_dpdk.a", dpdk_found=1, dpdk_found=0)
    413     # Revert back
    414     LDFLAGS="$saved_ldflags"
    415     if test "$dpdk_found" = 1; then
    416         # Save these now so that they can be re-exported later
     404        # So instead simply check for existence
     405        if test "$RTE_SDK" != ""; then
     406                AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libintel_dpdk.a", dpdk_found="libintel_dpdk.a", dpdk_found=0)
     407        fi
     408        # DPDK 2.1.0+ renames this to libdpdk from libintel_dpdk
     409        if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then
     410                AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libdpdk.a", dpdk_found="libdpdk.a", dpdk_found=0)
     411        fi
     412        if test "$dpdk_found" != 0 -a "$RTE_SDK" != ""; then
     413                # Save these now so that they can be re-exported later
    417414                AC_SUBST([RTE_TARGET])
    418         AC_SUBST([RTE_SDK])
    419         # Force dpdk library to be statically linked to allow compiler optimisations
    420         LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,--whole-archive -Wl,-l:libintel_dpdk.a -Wl,--no-whole-archive -Wl,-lm"
     415                AC_SUBST([RTE_SDK])
     416                # Force dpdk library to be statically linked to allow compiler optimisations
     417                LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,--whole-archive -Wl,-l:$dpdk_found -Wl,--no-whole-archive -Wl,-lm"
    421418                AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support])
    422419                libtrace_dpdk=true
     420        fi
     421        if test "$RTE_SDK" = ""; then
     422                AC_MSG_NOTICE([No RTE_SDK given, checking for system dpdk-dev package])
     423                # Search the system, maybe it is installed? Ethdev is one of the main libraries
     424                AC_CHECK_LIB(ethdev, rte_eth_dev_configure, dpdk_found="system", dpdk_found=0)
     425                # We also need to check that rte.vars.mk is installed from dpdk-dev (as well as libdpdk-dev)
     426                if test "$dpdk_found" != 0 -a -e /usr/share/dpdk/mk/rte.vars.mk ; then
     427                        RTE_TARGET="x86_64-default-linuxapp-gcc"
     428                        RTE_SDK="/usr/share/dpdk/"
     429                        RTE_INCLUDE="/usr/include/dpdk"
     430                        AC_SUBST([RTE_TARGET])
     431                        AC_SUBST([RTE_SDK])
     432                        AC_SUBST([RTE_INCLUDE])
     433                        # include libethdev this is part of DPDK
     434                        LIBTRACE_LIBS="$LIBTRACE_LIBS -lethdev"
     435                        # Include all rte libs note we need to escape '[' and ']'
     436                        LIBTRACE_LIBS="$LIBTRACE_LIBS $(ldconfig -p | sed 's/.*lib\([[^.]]*\).*/-l\1/' | grep rte_ | tr '\n' ' ')"
     437                        AC_MSG_NOTICE([Building against system DPDK])
     438
     439                        AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support])
     440                        libtrace_dpdk=true
     441                fi
    423442        fi
    424443fi
     
    471490if test "$ac_cv_search_dlopen" != "none required"; then
    472491        LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_dlopen"
    473         if test "$dpdk_found" = 1; then
     492        if test "$dpdk_found" != 0; then
    474493                LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,$ac_cv_search_dlopen"
    475494        fi
Note: See TracChangeset for help on using the changeset viewer.