DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Pktgen having problem with Lua on RHEL
@ 2018-12-19  1:53 Hossein Golestani
  2018-12-19 14:08 ` Wiles, Keith
  0 siblings, 1 reply; 3+ messages in thread
From: Hossein Golestani @ 2018-12-19  1:53 UTC (permalink / raw)
  To: dev

Hi,

I'm having a hard time compiling Pktgen on a Red Hat machine. The source 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 cannot
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
<http://www.lua.org/manual/5.3/readme.html>), 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/
├── include
│   ├── lauxlib.h
│   ├── luaconf.h
│   ├── lua.h
│   ├── lua.hpp
│   └── lualib.h
└── 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     += -lpktgen_lua $(shell pkg-config --libs-only-l lua5.3)*

with

*MYLIBS     += -lpktgen_lua -L:/home/me/lua/liblua.a*


Replacing

*MYLIB_PATH += -L$(LUA_LIB) $(shell pkg-config --libs-only-L lua5.3)*

with

*MYLIB_PATH += -L$(LUA_LIB) **-L:/home/me/lua/liblua.a*


Replacing

*CFLAGS     += -I/usr/include/lua5.3*

with

*CFLAGS     += -I/home/me/lua/include*


In *lib/lua/Makefile*:

Replacing

*CFLAGS += $(shell pkg-config --cflags lua5.3)*

with

*CFLAGS += -I/home/me/lua/include*


Replacing

LDLIBS += -L$(SRCDIR)/../lua/$(RTE_TARGET)/lib -llua

with

LDLIBS += -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/libpktgen_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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Pktgen having problem with Lua on RHEL
  2018-12-19  1:53 [dpdk-dev] Pktgen having problem with Lua on RHEL Hossein Golestani
@ 2018-12-19 14:08 ` Wiles, Keith
  2018-12-19 14:52   ` Hossein Golestani
  0 siblings, 1 reply; 3+ messages in thread
From: Wiles, Keith @ 2018-12-19 14:08 UTC (permalink / raw)
  To: Hossein Golestani; +Cc: dev



> On Dec 18, 2018, at 7:53 PM, Hossein Golestani <hosseing@umich.edu> wrote:
> 
> Hi,
> 
> I'm having a hard time compiling Pktgen on a Red Hat machine. The source 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 cannot
> 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
> <http://www.lua.org/manual/5.3/readme.html>), 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/
> ├── include
> │   ├── lauxlib.h
> │   ├── luaconf.h
> │   ├── lua.h
> │   ├── lua.hpp
> │   └── lualib.h
> └── 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     += -lpktgen_lua $(shell pkg-config --libs-only-l lua5.3)*
> 
> with
> 
> *MYLIBS     += -lpktgen_lua -L:/home/me/lua/liblua.a*

I assume that ‘me’ here is really ‘hossening’ 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 += -L$(LUA_LIB) $(shell pkg-config --libs-only-L lua5.3)*
> 
> with
> 
> *MYLIB_PATH += -L$(LUA_LIB) **-L:/home/me/lua/liblua.a*
> 
> 
> Replacing
> 
> *CFLAGS     += -I/usr/include/lua5.3*
> 
> with
> 
> *CFLAGS     += -I/home/me/lua/include*
> 
> 
> In *lib/lua/Makefile*:
> 
> Replacing
> 
> *CFLAGS += $(shell pkg-config --cflags lua5.3)*
> 
> with
> 
> *CFLAGS += -I/home/me/lua/include*
> 
> 
> Replacing
> 
> LDLIBS += -L$(SRCDIR)/../lua/$(RTE_TARGET)/lib -llua
> 
> with
> 
> LDLIBS += -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/libpktgen_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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Pktgen having problem with Lua on RHEL
  2018-12-19 14:08 ` Wiles, Keith
@ 2018-12-19 14:52   ` Hossein Golestani
  0 siblings, 0 replies; 3+ messages in thread
From: Hossein Golestani @ 2018-12-19 14:52 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev

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     +=
-lpktgen_lua -L:/home/me/lua/liblua.a*, I should have simply used *MYLIBS
   += -lpktgen_lua -/home/me/lua/liblua.a*

Thanks,
Hossein



On Wed, Dec 19, 2018 at 9:08 AM Wiles, Keith <keith.wiles@intel.com> wrote:

>
>
> > On Dec 18, 2018, at 7:53 PM, Hossein Golestani <hosseing@umich.edu>
> wrote:
> >
> > Hi,
> >
> > I'm having a hard time compiling Pktgen on a Red Hat machine. The source
> 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 cannot
> > 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
> > <http://www.lua.org/manual/5.3/readme.html>), 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/
> > ├── include
> > │   ├── lauxlib.h
> > │   ├── luaconf.h
> > │   ├── lua.h
> > │   ├── lua.hpp
> > │   └── lualib.h
> > └── 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     += -lpktgen_lua $(shell pkg-config --libs-only-l lua5.3)*
> >
> > with
> >
> > *MYLIBS     += -lpktgen_lua -L:/home/me/lua/liblua.a*
>
> I assume that ‘me’ here is really ‘hossening’ 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 += -L$(LUA_LIB) $(shell pkg-config --libs-only-L lua5.3)*
> >
> > with
> >
> > *MYLIB_PATH += -L$(LUA_LIB) **-L:/home/me/lua/liblua.a*
> >
> >
> > Replacing
> >
> > *CFLAGS     += -I/usr/include/lua5.3*
> >
> > with
> >
> > *CFLAGS     += -I/home/me/lua/include*
> >
> >
> > In *lib/lua/Makefile*:
> >
> > Replacing
> >
> > *CFLAGS += $(shell pkg-config --cflags lua5.3)*
> >
> > with
> >
> > *CFLAGS += -I/home/me/lua/include*
> >
> >
> > Replacing
> >
> > LDLIBS += -L$(SRCDIR)/../lua/$(RTE_TARGET)/lib -llua
> >
> > with
> >
> > LDLIBS += -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/libpktgen_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
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-19 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19  1:53 [dpdk-dev] Pktgen having problem with Lua on RHEL Hossein Golestani
2018-12-19 14:08 ` Wiles, Keith
2018-12-19 14:52   ` Hossein Golestani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).