Closed egordorichev closed 7 years ago
Can you access lfs from the CLI? Enter the interactive mode by opening Lua/LuaJIT and try:
local lfs = require "lfs"
print(lfs._VERSION)
If this doesn't work then the problem is with your luarocks setup... for some reason it compiled LFS against an erroneous Lua version.
luaL_setfuncs
is available in Lua 5.2 and Lua 5.3 but not in Lua 5.1, so LuaRocks may be configured with the old version of Lua you had installed and it's pointing LFS to the wrong header files.
You probably screwed your configuration by not unistalling the old Lua version properly (common mistake, since LuaRocks sucks at handling multiple Lua versions).
I recommend you uninstall ALL your Lua versions and LuaRocks versions, clear any leftover environment variable prefixed with LUA
and then install Lua 5.1, LuaRocks and love-release.
As an alternative I recommend you checkout Hererocks which is the BEST way to install Lua and LuaRocks (and even multiple versions of Lua)
EDIT: Sorry I hadn't read your question right, so I edited my answer to guide you in what the problem probably is and how you could fix it.
This is not a problem with love-release but a configuration problem on the user side. This issue should be closed and probably marked as invalid.
love-release will support other Lua versions in the future but that is a separate issue ( #46 )
Ah, i've just solved other issue with lua, by installing lua 5.3.. Any way:
Same error.
You probably are messing something up or missing something when uninstalling Lua. Probably you haven't erased all the header files, or there are still environment variables saying that you have Lua 5.3 installed.
I don't really know but it's most likely your fault. The issue doesn't belong to this repository so you should close it.
I don't know how to help you, you haven't posted any information on your setup, like what lua --version
prints and what luarocks help
prints in the VARIABLES
and CONFIGURATION
sections. You could also post LUA
related environment variables, and path to common files like headers
Also even if you fix the issue now, you will probably need to uninstall love-release, LFS and luarocks and install them again, since they were installed with a wrong configuration.
Again Hererocks could fix ALL this issues! It's way simpler and it's easy to use
Lua:
lua -v Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
LuaRocks:
CONFIGURATION Lua version: 5.1 Configuration files: System: /usr/local/etc/luarocks/config-5.1.lua (ok) User : /home/egor/.luarocks/config-5.1.lua (not found) VARIABLES Variables from the "variables" table of the configuration file can be overriden with VAR=VALUE assignments.
ENV:
printenv | grep LUA total: 0
Can you uninstall LFS and install it again? (and probably put here the command output)
Also try to search for the header files luaconf.h
lua.hpp
and lauxlib.h
and put the path to them over here. (Should be /usr/local/include
or at LUA_INC
)
Same for lua51.lib
which should be at /usr/local/lib/lua/5.1
or at LUA_LIBDIR
sudo luarocks install luafilesystem
Installing https://rocks.moonscript.org/luafilesystem-1.6.3-2.src.rock...
Using https://rocks.moonscript.org/luafilesystem-1.6.3-2.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include -c src/lfs.c -o src/lfs.o
gcc -shared -o lfs.so -L/usr/lib64 src/lfs.o
Updating manifest for /usr/lib64/lua/luarocks/lib/luarocks/rocks
luafilesystem 1.6.3-2 is now built and installed in /usr/lib64/lua/luarocks (license: MIT/X11)
Are the Lua header files in /usr/include
?
Does lauxlib.h
expose luaL_setfuncs
?
Does lua.h
have a LUA_VERSION
field set to Lua 5.1
?
Also I have no clue on why the gcc -shared -o
command has a flag -L/usr/lib64
is that the directory where lua51.lib
is? I'm pretty sure that the flag should be used like -L/usr/lib64/lua51.lib
Are the Lua header files in /usr/include?
ls -l /usr/include | grep lua
-rw-r--r-- 1 root root 1529 Jun 11 08:20 luaconf.h -rw-r--r-- 1 root root 11688 Jan 14 2012 lua.h -rw-r--r-- 1 root root 191 Dec 23 2004 lua.hpp drwxr-xr-x 2 root root 4096 Jun 11 16:40 luajit-2.0 -rw-r--r-- 1 root root 1026 Dec 27 2007 lualib.h drwxr-xr-x 2 root root 4096 Apr 12 15:15 texlua52 drwxr-xr-x 2 root root 4096 Apr 12 15:15 texluajit
> Does lauxlib.h expose luaL_setfuncs?
cat /usr/local/include/lauxlib.h | grep luaL_setfuncs
LUALIB_API void (luaL_setfuncs) (lua_State L, const luaL_Reg l, int nup); (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
> Does lua.h have a LUA_VERSION field set to Lua 5.1?
Oops. Will fix that.
You should replace all the header files with the Lua 5.1 provided ones, same with the lua51.lib
file in /usr/lib64
, replace it with the one you generate when compiling Lua.
I've isntalled it in VirtualBox onto a new machine. All works fine. That's my system problem. Thanks.
I've reinstalled love-release, with lua 5.1.5-r4 and luarocks-2.2.0:
Script is searching for lua file system? I've manualy installed it with:
Nothing changed.