Can't build because of problems with liblua

Bug #1189145 reported by Wieland Hoffmann
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Return To The Roots
Status tracked in S25client
S25client
Fix Committed
Low
FloSoft

Bug Description

Here's what I did:
» bzr branch lp:s25rttr
» cd s25rttr
» cd build
» ./cmake.sh
(output attached)
» LC_ALL=en_US.utf8 make
[... lots of output ...]
[ 94%] Building CXX object src/CMakeFiles/s25client.dir/nofCharburner.cpp.o
make[2]: *** No rule to make target `/usr/lib/liblua5.2.a', needed by `src/s25client'. Stop.
make[1]: *** [src/CMakeFiles/s25client.dir/all] Error 2
make: *** [all] Error 2

(full log attached if I can convince launchpad into letting me add a second attachment)

I'm using the lua package from Arch Linux, the file list is available at https://www.archlinux.org/packages/extra/x86_64/lua/

I tried this on revision 8764

Revision history for this message
Wieland Hoffmann (themineo) wrote :
Revision history for this message
Wieland Hoffmann (themineo) wrote :
Revision history for this message
Ash Hughes (ashes-iontach) wrote :

Is this because it wants lua 5.2? Would 5.1 do?

Revision history for this message
Ash Hughes (ashes-iontach) wrote :

You can download the correct lua libraries from http://luabinaries.sourceforge.net/download.html . Extracting these to the contrib/lua/lin64 and/or contrib/lua/lin32 as appropriate allows compilation to complete.

The static libraries should probably be available in the repo?

Revision history for this message
Wieland Hoffmann (themineo) wrote :

But that's just a workaround for the problem - cmake decided to use a lua library which doesn't exist in the filesystem which is just wrong and it should instead yell at me that it can't find a proper lua and ever abort the process or go on without lua support.

Revision history for this message
afri donschoe (afri-alex) wrote :

You might need add a "findLua" script to the CMakeLists like that:

include(${CMAKE_SOURCE_DIR}/FindLua.cmake)
find_package(Lua REQUIRED)

see:

http://code.google.com/p/cebmtpchat/source/browse/trunk/CMakeModules/FindLua.cmake?r=502

Revision history for this message
afri donschoe (afri-alex) wrote :

I solved it.

In ./CMakeLists.txt lines 472-476:

IF ( NOT EXISTS "${LUA_LIB}" )
 SET(LUA_LIB "/usr/lib/liblua5.2.a")
 ADD_FLAGS(CMAKE_C_FLAGS -I/usr/include/lua5.2)
 ADD_FLAGS(CMAKE_CXX_FLAGS -I/usr/include/lua5.2)
ENDIF ( NOT EXISTS "${LUA_LIB}" )

Add right after this block, another one:

IF ( NOT EXISTS "${LUA_LIB}" )
 SET(LUA_LIB "/usr/lib/liblua.so")
 ADD_FLAGS(CMAKE_C_FLAGS -I/usr/include/)
 ADD_FLAGS(CMAKE_CXX_FLAGS -I/usr/include/)
ENDIF ( NOT EXISTS "${LUA_LIB}" )

Cheers

Revision history for this message
FloSoft (flosoft) wrote :

wie can't use FindLua.cmake since it only searches for lua 5.1 not 5.2 which we need.
But I added the "quickfix" now to use the dynamic lua lib if the static one does not exist.

Changed in s25rttr:
assignee: nobody → FloSoft (flosoft)
milestone: none → nightly
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.