From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by dpdk.org (Postfix) with ESMTP id 12D881B2B9 for ; Thu, 15 Feb 2018 03:35:02 +0100 (CET) Received: by mail-qk0-f196.google.com with SMTP id b130so12110694qkg.9 for ; Wed, 14 Feb 2018 18:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eIyL6Xk+DIH6rSdc0kCsV6FQT+b1wCF8LXlF91HFEVo=; b=FrX7b5Pw3xcg41GSdqeXQu0uM3ebDF6WTnelUvKrHdjfJ1kIEY78cH30ZiK4bsnFcz kKI9sZX/fnR2yRyUtMS1vqyFVAlkp8BNYNLKz+nyoLlIG0+O3MbwU7dx9zpz2I/EvjOy Fo/mNmp2gFtmba9x0TU/uViCu9KJcVCIRWKI35ZvNBtlDgtc0MILyITiChg18vMJ3IFy gdpHw/sunaEFGPEcOQF6J+w+NPZR5NhtaYL32FDxclOb8iOUqWXQpH2K3eALRkpxFivi MBW0Ep5FEZcZILw84FmUFQHH2RVooAh6fCy5csFqUHUBEh8dxR3Z7/5tC0wIyEiqic0g lJ2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eIyL6Xk+DIH6rSdc0kCsV6FQT+b1wCF8LXlF91HFEVo=; b=Fef9zTf0kSKXqvWAhWEi4fQ8TgQNasC1S0VOHuWRVcq5ukuLFTnAOV7WsbEtNCiB1I 3hwQv1OTyYC+5NtFIKM83CAaowDvK27uiVUAZFXwD4cnDgpNU587SnsambNVWXjp0JUO l/7ULwLbWzOe9bKBf69EEs/xNsXwHaok2z95G8AHpnvHZ3eu8k1UIKNU2ZS7VeRXZ4gj 7BI4JCgNEteaoR2KdSULmtcLxl9mAxSO1nFZc0gKUVI0Ywkz5o2DKDPryELFVXV94Y4X vU+2698R502+MKoUDYDM6LGA02z5UUT6eU+BG2KnTLAugRC6ylO7fgjTXjbusAtzzySw F4xA== X-Gm-Message-State: APf1xPARNvPZRGKfvaIhKAWEoOruNAOtSeOVgUyW2n2f+h1qiX9LsWks nai/s7YYqt+pdWGo8GWTdfnfaqg7QG8= X-Google-Smtp-Source: AH8x226BUTeI9fUy7pxYdOucp8VXTtZAPW6bm9LxUO99AcMtX9dmS+09f9qpqn5TXuzLJlv7pvpfDA== X-Received: by 10.233.235.198 with SMTP id b189mr1779129qkg.99.1518662101972; Wed, 14 Feb 2018 18:35:01 -0800 (PST) Received: from jeffreys-mbp.fios-router.home (pool-74-109-242-4.pitbpa.fios.verizon.net. [74.109.242.4]) by smtp.gmail.com with ESMTPSA id g9sm10870262qtg.90.2018.02.14.18.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 18:35:01 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) From: Jeffrey Helt In-Reply-To: <20180214170806.3e670b57@xeon-e3> Date: Wed, 14 Feb 2018 21:34:59 -0500 Cc: users@dpdk.org Content-Transfer-Encoding: quoted-printable Message-Id: <12034594-50E0-44EC-A8FD-A9EDA9F18CF9@andrew.cmu.edu> References: <20180214170806.3e670b57@xeon-e3> To: Stephen Hemminger X-Mailer: Apple Mail (2.3445.5.20) Subject: Re: [dpdk-users] Building a shared library that uses DPDK X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 02:35:03 -0000 > On Feb 14, 2018, at 8:08 PM, Stephen Hemminger = wrote: >=20 > On Wed, 14 Feb 2018 19:06:03 -0500 > Jeffrey Helt wrote: >=20 >> Hi, >>=20 >> I am attempting to build a shared library that uses DPDK, = specifically that wraps the Linux socket API and backs it by shared = memory DPDK shared memory regions. I built DPDK 17.11 with = =E2=80=9CCONFIG_RTE_BUILD_SHARED_LIB=3Dy=E2=80=9D. In my shared library = directory, I am using the following Makefile: >>=20 >> ifeq ($(RTE_SDK),) >> $(error "Please define RTE_SDK environment variable") >> endif >>=20 >> # Default target, can be overridden by command line or environment >> RTE_TARGET ?=3D x86_64-native-linuxapp-gcc >>=20 >> include $(RTE_SDK)/mk/rte.vars.mk >>=20 >> # binary name >> SHARED =3D libshim.so >>=20 >> # all source are stored in SRCS-y >> SRCS-y :=3D wrap_socket.c >>=20 >> CFLAGS +=3D -O3 >>=20 >> include $(RTE_SDK)/mk/rte.extshared.mk >>=20 >> However, whenever I try to use my library, such as with = "LD_PRELOAD=3D./build/lib/libshim.so ./test=E2=80=9D, I receive "symbol = lookup error: ./build/lib/libshim.so: undefined symbol: rte_eal_init=E2=80= =9D. What am I missing? >>=20 >> Thank you in advance for help! >>=20 >> Jeff > The DPDK builds lots of little shared libraries. > You need to have all of them in your LD_LIBRARY_PATH and then add your = socket wrapper. Using `export = LD_LIBRARY_PATH=3D"/users/jhelt/dpdk/x86_64-native-linuxapp-gcc/lib/librte= _eal.so=E2=80=9D` before building and/or running doesn=E2=80=99t seem to = change anything. Using ldd, I noticed that no dpdk shared objects are = required by my library (see below), which seems like a more fundamental = issue to me, although admittedly I am not that experienced in debugging = linking issues. $ ldd ./build/lib/libshim.so=20 linux-vdso.so.1 =3D> (0x00007fff907e2000) libc.so.6 =3D> /lib/x86_64-linux-gnu/libc.so.6 = (0x00007fe76b06a000) /lib64/ld-linux-x86-64.so.2 (0x00007fe76b636000)=20 Jeff