Problems Installing Lua/LuaRocks

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
DaxtonD
Starting out
Posts: 11
Joined: Sun Apr 19, 2015 9:53 pm

Problems Installing Lua/LuaRocks

Post by DaxtonD »

Hello everyone,
I'd been running QTS 4.2 for quite awhile.
I spent a lot of time learning linux command line since I've had this NAS. I managed to get Prosody running thanks to IPKG and members of this forum.
This weekend I decided to upgrade to QTS 4.2.3 and soon discovered that IPKG/Optware was no longer included and Prosody no longer worked.
After some research, I learned that Entware-ng is a more modern and secure package manager and I began to try installing Lua/Luarocks with Entware. I'm having a great deal of difficulty with my limited Linux knowledge and was hoping someone could chime in and assist.

First, I installed Lua via opkg:
opkg install lua
Installing lua (5.1.5-1) to root...
Downloading http://pkg.entware.net/binaries/x86-64/ ... x86-64.ipk
Configuring lua.

It appears to have installed.
Luarocks isn't available on Entware (not that I could find) so I followed the install instructions for Luarocks from source.

wget https://luarocks.org/releases/luarocks-2.4.1.tar.gz
tar zxpf luarocks-2.4.1.tar.gz
cd luarocks-2.4.1
./configure

I get the following error:
Lua interpreter found: /opt/bin/lua...
Lua version detected: 5.1
lua found in $PATH: /opt/bin
Checking Lua includes... lua.h not found (looked in /opt/include, /opt/include/lua/5.1, /opt/include/lua5.1)
configure failed.

I did some reading and someone suggested installing lua manually, so I removed Lua with opkg, and then tried the following.

curl -R -O http://www.lua.org/ftp/lua-5.1.tar.gz
tar zxf lua-5.1.tar.gz
cd lua-5.1
make linux test

and I get the following error:
cd src && make linux
make[1]: Entering directory '/share/CACHEDEV1_DATA/homes/admin/lua-5.1/src'
make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
make[2]: Entering directory '/share/CACHEDEV1_DATA/homes/admin/lua-5.1/src'
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lua.o lua.c
In file included from lua.h:16:0,
from lua.c:15:
luaconf.h:263:31: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^
compilation terminated.
make[2]: *** [<builtin>: lua.o] Error 1
make[2]: Leaving directory '/share/CACHEDEV1_DATA/homes/admin/lua-5.1/src'
make[1]: *** [Makefile:95: linux] Error 2
make[1]: Leaving directory '/share/CACHEDEV1_DATA/homes/admin/lua-5.1/src'
make: *** [Makefile:54: linux] Error 2

I did some further reading and someone suggested installing libreadline-dev to solve the issue. However, I can't find how to install it on QNAP.
I'm at a loss and kindly ask for assistance getting Lua and Luarocks installed.

lastly, on my previous firmware, I could use Putty to SSH in, and I was able to type,
su - Daxton
to change the user from admin. Prosody didn't like being run as admin.
However, i've noticed this command doesn't exist on the new firmware.
Does anyone know how to change users?

Thanks,
Dax
skr25
First post
Posts: 1
Joined: Thu Dec 17, 2015 9:35 am

Re: Problems Installing Lua/LuaRocks

Post by skr25 »

Hi did you find solution to this problem? I am facing similar issue.
Thanks
User avatar
adnovea
Easy as a breeze
Posts: 490
Joined: Sat Jan 26, 2008 2:47 am

Re: Problems Installing Lua/LuaRocks

Post by adnovea »

+1
See my other projects at Sourceforge & Instructables
Post Reply

Return to “Miscellaneous”