Skip to content

liblua 5.1 vs 5.2 #1179

@przemas75

Description

@przemas75

Having both versions of liblua installed on debian jessie, during osrm-backend with devel branch build cmake detects only version 5.1.
In fact i have luabind https://github.com/Oberon00/luabind correctly built with liblua5.2 in standard /usr/local location.
This is because find_package(Lua52) is disabled in CMakeLists.txt

So, building devel branch, using Oberon00's luabind build with lua5.2 and lua5.1 within osrm devel causes some problems:
Linking CXX executable osrm-extract
/usr/local/lib/libluabind09.a(class.cpp.o): In function luabind::detail::class_registration::register_(lua_State*) const': class.cpp:(.text+0x2fc): undefined reference tolua_rawgetp'
class.cpp:(.text+0x488): undefined reference to lua_rawgetp' class.cpp:(.text+0x4cf): undefined reference tolua_rawgetp'
/usr/local/lib/libluabind09.a(class_registry.cpp.o): In function luabind::detail::(anonymous namespace)::create_cpp_class_metatable(lua_State*)': class_registry.cpp:(.text+0x47): undefined reference tolua_rawsetp'
/usr/local/lib/libluabind09.a(class_registry.cpp.o): In function luabind::detail::class_registry::get_registry(lua_State*)': class_registry.cpp:(.text+0x2ce): undefined reference tolua_rawgetp'
/usr/local/lib/libluabind09.a(class_rep.cpp.o): In function luabind::detail::class_rep::shared_init(lua_State*)': class_rep.cpp:(.text+0x318): undefined reference tolua_rawgetp'
class_rep.cpp:(.text+0x360): undefined reference to lua_rawgetp' /usr/local/lib/libluabind09.a(class_rep.cpp.o): In functionluabind::detail::class_rep::constructor_dispatcher(lua_State_)':
class_rep.cpp:(.text+0x6f6): undefined reference to lua_setglobal' class_rep.cpp:(.text+0x7aa): undefined reference tolua_callk'
class_rep.cpp:(.text+0x7d4): undefined reference to lua_setglobal' /usr/local/lib/libluabind09.a(class_rep.cpp.o): In functionluabind::detail::class_rep::super_callback(lua_State_)':
class_rep.cpp:(.text+0x973): undefined reference to lua_setglobal' class_rep.cpp:(.text+0x9c7): undefined reference tolua_setglobal'
class_rep.cpp:(.text+0xa6d): undefined reference to lua_callk' class_rep.cpp:(.text+0xa8c): undefined reference tolua_setglobal'
/usr/local/lib/libluabind09.a(class_rep.cpp.o): In function luabind::detail::class_rep::static_class_gettable(lua_State*)': class_rep.cpp:(.text+0xc76): undefined reference tolua_rawlen'
/usr/local/lib/libluabind09.a(class_rep.cpp.o): In function `luabind::detail::is_class_rep(lua_State*, int)':

I know from #662 (comment) i can manually change it to 52. It buils fine. But the osrm-extract dumps core (with problem at liblua51)

Is there any reason Find is disabled for lua52?
There has beed said here many times, dont mix lua versions, but this way we are stucked with 5.1
Once one has 5.2 (liblua and luabind) it is kind of hard to find the reason why it doesnt work.

Enabling in CMakeList.txt

find_package(Lua52)
if(NOT LUA52_FOUND)
find_package(Lua51 REQUIRED)
if(NOT APPLE)
find_package(LuaJIT 5.1)
endif()

else()

if(NOT APPLE)

find_package(LuaJIT 5.2)

endif()

endif()

make whole app builds ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions