Problems with lua
Posted: 07.10.2006, 18:02
The configure script failed to run while trying to build Celestia cvs 10/07 on Suse 10 with lua 5.0.2 installed. I had to install lua 5.1.1. After that, no problems.
cartrite
cartrite
Real-time 3D visualization of space
https://celestiaproject.space/forum/
https://celestiaproject.space/forum/viewtopic.php?f=2&t=10230
linux:/home/cartrite/bin/celestia/backup/lua-5.0.2 # locate lua*.pc
linux:/home/cartrite/bin/celestia/backup/lua-5.0.2 # locate lua.pc
/home/cartrite/bin/celestia/backup/lua-5.1.1/etc/lua.pc
/home/cartrite/bin/celestia/backup/lua.pc
/root/.kde/share/apps/RecentDocuments/lua.pc.desktop
/usr/local/lib/pkgconfig/lua.pc
linux:/home/cartrite/bin/celestia/backup/lua-5.0.2
Code: Select all
# lua.pc -- pkg-config data for Lua
prefix= /usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: 5.0.2
Requires:
Libs: -L${libdir} -llua -llualib
Cflags: -I${includedir}
Code: Select all
# lua.pc -- pkg-config data for Lua
# vars from install Makefile
# grep '^V=' ../Makefile
V= 5.1
# grep '^R=' ../Makefile
R= 5.1.1
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local
INSTALL_BIN= ${prefix}/bin
INSTALL_INC= ${prefix}/include
INSTALL_LIB= ${prefix}/lib
INSTALL_MAN= ${prefix}/man/man1
INSTALL_LMOD= ${prefix}/share/lua/${V}
INSTALL_CMOD= ${prefix}/lib/lua/${V}
# canonical vars
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
Libs: -L${libdir} -llua -lm
Cflags: -I${includedir}
# (end of lua.pc)
Code: Select all
V= 5.0
R= 5.0.2
......
Version: ${R}
checking for lua5.1 >= 5.1.0... checking for lua >= 5.1.0... checking for lualib50 lua50 >= 5.0.0... checking for lualib lua >= 5.0.0... Package lualib was not found in the pkg-config search path. Perhaps you should add the directory containing `lualib.pc' to the PKG_CONFIG_PATH environment variable No package 'lualib' found
configure: error: Library requirements (lualib lua >= 5.0.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
That didn't work. Configure still failed.What looks like happened was I didn't have the versions info in the 5.0.2 lua.pc.
Code:
V= 5.0
R= 5.0.2
......
Version: ${R}
checking for lua5.1 >= 5.1.0... checking for lua >= 5.1.0... yes
checking LUA_CFLAGS... -I/usr/local/include
checking LUA_LIBS... -L/usr/local/lib -llua -lm
configure: creating ./config.status
Code: Select all
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include/
Name: lua50
Description: The Lua 5.0 programming language addon libraries
Version: 5.0.0
Requires: lua50
Libs: -L${libdir} -llualib50
Cflags: -I${includedir}/lua50
I did have a lua.pc file. It just wasn't called lualib.pc It worked before the changes. See here: http://www.celestiaproject.net/forum/viewtopic ... 7067#77067Ok, your problem is that you don't have a lualib.pc file.
Code: Select all
# lua.pc -- pkg-config data for Lua
prefix= /usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: 5.0.2
Requires:
Libs: -L${libdir} -llua -llualib
Cflags: -I${includedir}
cartrite wrote:But if scripts written with lua 5.1.1 don't work, then why is configure looking for version 5.1.1 in the first place.
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib50 lua50 = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lualib lua = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
) ]
) ]
)
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib lua >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lualib50 lua50 >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.0.2, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua >= 5.0.2, LUA_VER=0x050000) ]
) ]
) ]
)
For some reason it sees 5.0.2 but wants 5.1.1.checking for lualib lua >= 5.0.0... checking for lualib50 lua50 >= 5.0.0... checking for lua5.1 >= 5.1.0... checking for lua >= 5.1.0... Requested 'lua >= 5.1.0' but version of Lua is 5.0.2
configure: error: Library requirements (lua >= 5.1.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
checking for lualib lua >= 5.0.0... checking for lualib50 lua50 >= 5.0.0... checking for lua5.1 >= 5.0.2... checking for lua >= 5.0.2... yes
checking LUA_CFLAGS...
checking LUA_LIBS... -L/usr/local/lib -llua -llualib -lm
configure: creating ./config.status
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib50 lua50 = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lualib lua = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
) ]
) ]
)
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib50 lua50 >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
) ]
) ]
)
I now have 2 files in /usr/local/lib/pkgconfig. lua.pc and lualib.pc. EDIT Both files point to the same libs. /EDIT This works with version 5.0.2.Ok, your problem is that you don't have a lualib.pc file.
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib50 lua50 = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lualib lua = 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
) ]
) ]
)
Code: Select all
if (test "$enable_lua" != "no"); then
LUA_VER=0
PKG_CHECK_MODULES(LUA, lualib50 lua50 >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lualib lua >= 5.0.0, LUA_VER=0x050000,
[ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
) ]
) ]
)
Good timing AAA.See my post dated '09/10/2006 21:38', the problem is that you don't have lualib.pc, and this is required (at least) on Ubuntu systems.