From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by dpdk.org (Postfix) with ESMTP id 7100710BD for ; Wed, 19 Dec 2018 15:52:55 +0100 (CET) Received: by mail-ed1-f46.google.com with SMTP id g22so11156082edr.7 for ; Wed, 19 Dec 2018 06:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9Eeh/cik9pf9xQrJ1Mp1RH3rR6DLV6KD9/XOYnqwl1U=; b=RrXc4xEmMtCYOv+FexBj/G/VqUAvcr0SCe1PKftqvspJ5gRP/RgAwPkztHZOXptoCh +++jeFv1TP2cXag0f++Fn/soOrbOsruYv0VG2gbdjs6YBXj0nkm74M4vJ7OWvQTdCf71 702dR+shLiPzkrZkSz8yki8Gl1kT5bHZsfjS5lWvbeHhoFKowRykAaZd9SSYAnjKWKOr d8g/+EX8+5MZAQk2TY/Qqf6xj2YRSRoQA+W8RWqpaWvsHIpMhswuUi1qNNuDXpavgyRx ghtTiH+Cclvkut04W9aNJeG3sUUt9mxSAhlckjP4nY4TBV+du+MbbGHMpxFcJYh6E7hd 5wCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9Eeh/cik9pf9xQrJ1Mp1RH3rR6DLV6KD9/XOYnqwl1U=; b=WG9Psxtd09UAfe/pkkmOwIN7GVCjC66DMGnsZKsw5Fw2wC3eqV48mrqrwgLw6kuOns Vlm7m8VHwecX5puuWw1rQmIAL1H9kATSL33hQjXvNZg3tv8fPWQ8IT9ok90lTOh1tL6E 9kWAY6Cx/fEXoDVrNtpZwjZwgQ1QeHBvg59t7Ui+2vWBwFGW2R/bLpEB/ZKS6HFhWsU9 SG+GK/IOLJuEm+Y4KoTi1cXiwe0lcwskW14EyenpDV0I+M+vJ6wIbNzZqCOII3oLwnP7 Pi0SE/pYfnHOqw+V9+VGFRbuhjQ6AqHLB5H8xHrTC+/8+rPQstBXXUpSiZg09lOICjV7 p+wg== X-Gm-Message-State: AA+aEWZRBQdmXquqYyhjR1gCn9hhLEvJHMypM88IGvNxAsGPYc02Wudb B/HjUyeX/9fv8ewTbVGa8gGJDE4cTsNYGxuyC4Wevg== X-Google-Smtp-Source: AFSGD/UaBrfMO0vJSCpgbM3FAEIqXGZLGdAC0HYmLd+GGRkzjjBpx0xjXkTOQjSjBr3RmIMWZWjdRwoLtQWXMIiLYi0= X-Received: by 2002:a17:906:1c5b:: with SMTP id l27-v6mr16706216ejg.118.1545231175395; Wed, 19 Dec 2018 06:52:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Hossein Golestani Date: Wed, 19 Dec 2018 09:52:29 -0500 Message-ID: To: keith.wiles@intel.com Cc: dev@dpdk.org X-Mailman-Approved-At: Thu, 20 Dec 2018 09:52:31 +0100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] Pktgen having problem with Lua on RHEL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 14:52:56 -0000 Hi Keith, Thanks for your reply. I solved the problem just now. There was no misspelling. Apparently, for static linking (i.e., linking **.a* files), there's no need to use *-L*. So, for example, instead of *MYLIBS +=3D -lpktgen_lua -L:/home/me/lua/liblua.a*, I should have simply used *MYLIBS +=3D -lpktgen_lua -/home/me/lua/liblua.a* Thanks, Hossein On Wed, Dec 19, 2018 at 9:08 AM Wiles, Keith wrote: > > > > On Dec 18, 2018, at 7:53 PM, Hossein Golestani > wrote: > > > > Hi, > > > > I'm having a hard time compiling Pktgen on a Red Hat machine. The sourc= e > of > > the problem is the Lua library. > > > > I'm using Pktgen 3.5.9, and it requires Lua 5.3. Standard installation = of > > Lua on RHEL ends up having Lua 5.1. So for having the latest release, I > > need to compile Lua from its source. My eventual problem is that I cann= ot > > appropriately link the compiled Lua library to Pktgen. > > > > Here's a detailed explanation of what I did: > > > > Based on the official website of Lua (link > > ), for embedding Lua in C/C+= + > > programs, the following files are required: > > *lua.h luaconf.h lualib.h lauxlib.h lua.hpp* > > *liblua.a* (which is created after compiling Lua) > > > > I put these files in the following directory: > > /home/me/lua/ > > =E2=94=9C=E2=94=80=E2=94=80 include > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 lauxlib.h > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 luaconf.h > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 lua.h > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 lua.hpp > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 lualib.h > > =E2=94=94=E2=94=80=E2=94=80 liblua.a > > > > I made the following changes in Pktgen's Makefiles to include the Lua's > > header files and static library shown above: > > In *app/Makefile*: > > > > Replacing > > > > *MYLIBS +=3D -lpktgen_lua $(shell pkg-config --libs-only-l lua5.3)* > > > > with > > > > *MYLIBS +=3D -lpktgen_lua -L:/home/me/lua/liblua.a* > > I assume that =E2=80=98me=E2=80=99 here is really =E2=80=98hossening=E2= =80=99 so the real change to is > /home/hossening/lua/liblua.a right? > > I worry that you have mis-spelled on of the lines. The code linked > compiled so it found the include, but not the lib. > > Check and make sure you did not mis-spell something here. > > > > > > Replacing > > > > *MYLIB_PATH +=3D -L$(LUA_LIB) $(shell pkg-config --libs-only-L lua5.3)* > > > > with > > > > *MYLIB_PATH +=3D -L$(LUA_LIB) **-L:/home/me/lua/liblua.a* > > > > > > Replacing > > > > *CFLAGS +=3D -I/usr/include/lua5.3* > > > > with > > > > *CFLAGS +=3D -I/home/me/lua/include* > > > > > > In *lib/lua/Makefile*: > > > > Replacing > > > > *CFLAGS +=3D $(shell pkg-config --cflags lua5.3)* > > > > with > > > > *CFLAGS +=3D -I/home/me/lua/include* > > > > > > Replacing > > > > LDLIBS +=3D -L$(SRCDIR)/../lua/$(RTE_TARGET)/lib -llua > > > > with > > > > LDLIBS +=3D -L$(SRCDIR)/../lua/$(RTE_TARGET)/lib > > -L:/home/hosseing/lua/liblua.a > > > > > > > > Then, when I make Pktgen, I receive thousands of errors, like this: > > > */home/me/pktgen-3.5.9/app/../lib/lua/x86_64-native-linuxapp-gcc/lib/libp= ktgen_lua.a(rte_lua.o): > > In function `msghandler':* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:244: undefined reference to > > `lua_tolstring'* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:257: undefined reference to > > `luaL_traceback'* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:247: undefined reference to > > `luaL_callmeta'* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:248: undefined reference to > > `lua_type'* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:252: undefined reference to > > `lua_type'* > > */home/me/pktgen-3.5.9/lib/lua/rte_lua.c:252: undefined reference to > > `lua_typename'* > > *...* > > > > The included Lua header files seem to be OK. The problem seems to be > > because of how I link the liblua.a file. I'd really appreciate it if > > someone could help me on this. > > > > Thanks, > > Hossein > > Regards, > Keith > >