• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Compiling Liblua5.2.so on CentOS 7?

Kungenn

Veteran OT User
Joined
Jun 10, 2007
Messages
1,625
Reaction score
283
Location
USA California
Is here anyone that has any idea on how to get liblua5.2 on CentOS 7? make[2]: *** No rule to make target /usr/lib/x86_64-linux-gnu/liblua5.2.so', needed bytfs'. Stop.

I've tried my best to find it but it seems hopeless :(

Anyone that has better experience with CentOS perhaps?
 
I don't really have much CentOS experience (I work with Debian), but shouldn't it be available via yum? Otherwise you should check on lua homepage (The Programming Language Lua) if there are binaries for CentOS available. Otherwise you will need to get the source and compile it yourself.
 
Last edited:
I have downloaded and compiled it as linux but it still doesnt work


Isn't there some packages to download with yum to make TFS compilable at Centos?
 
I did compile 5.2 but I dont really know if I did it right, it did compile but it still generated errors. It just seems hopeless
Try this from a clean dir
Assuming you want 5.2 version, and you already installed a compiler
wget http://www.lua.org/ftp/lua-5.2.4.tar.gz
tar zxf lua-5.2.4.tar.gz
cd lua-5.2.4/
make linux test
if you did good so far you should see this output
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
then you can install lua
make linux install
you might need super user access to install for all users.
you can get other lua versions from ftp here
Lua: download area
 
make[1]: Entering directory `/home/lua/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
make[2]: Entering directory `/home/lua/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/lua/src'
make[1]: Leaving directory `/home/lua/src'
src/lua -v
Lua 5.2.0 Copyright (C) 1994-2011 Lua.org, PUC-Rio


install lua
install: missing destination file operand after ‘lua’
Try 'install --help' for more information.


What operand would it be? :P
 
make linux install
cd src && make linux
make[1]: Entering directory `/home/lua/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
make[2]: Entering directory `/home/lua/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/lua/src'
make[1]: Leaving directory `/home/lua/src'
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/m an/man1 /usr/local/share/lua/5.2 /usr/local/lib/lua/5.2
cd src && install -p -m 0755 lua luac /usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp /usr/loc al/include
cd src && install -p -m 0644 liblua.a /usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1



make
make[2]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/liblua5.2.so', ne eded by `tfs'. Stop.
make[1]: *** [CMakeFiles/tfs.dir/all] Error 2
make: *** [all] Error 2


Still get the same liblua error though
 
Still get the same liblua error though
why you still getting this error is because for some reason lua make rules doesn't compile a shared library, only static.
here is how you can solve this:
navigate to lua source root folder, then uninstall what you've done before
Code:
cd lua/source/dir
sudo make uninstall # you need root access
make clean
now we need to create a rule to build a shared library, if you're lazy i've uploaded both Makefiles(note: lua version 5.2.4) rules you need, just copy and paste contents to Makefile and src/Makefile and skip to the end.
Makefile · GitHub
if you want to do by hand continue following these steps
open make rules inside src/ folder
Code:
vi src/Makefile
note that vi is edtior i'm used to, open with yours, if not used to any, i suggest you open with nano src/Makefile
add -fPIC option to compiler, at the end of CFLAGS var.
CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS) -fPIC
create a new var to hold yoru file output name
LUA_SHARED_OBJECT= liblua5.2.so
add to end of ALL_T var our shared object
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SHARED_OBJECT)
create a new target for our shared object, so make call compiler to handle it
$(LUA_SHARED_OBJECT): $(CORE_O) $(LIB_O)
$(CC) -o $@ -shared $?
save the file and you're good to go.
if you want to make install your .so file to your system shared library folder then open Makefile that lives in lua root folder
vi Makefile
in TO_LIB add our .so file
TO_LIB= liblua.a liblua5.2.so
save the file and:

Code:
make linux test
if test success (you see lua version output), notice you need root access now.
Code:
sudo make linux install
again, these makefiles are from lua 5.2.4, so be careful if you're with other version, good lucky =)
 
Back
Top