8 Replies Latest reply on Dec 21, 2014 2:15 PM by deium

    Installing and running LUA on my Edison - Beginner questions




      I have fairly limited Linux skills but in order to get a few more on the Edison I decided to have a go at compiling and running the scripting language Lua on it. I followed the installation instructions from Lua.org :-


      wget http://www.lua.org/ftp/lua-5.2.3.tar.gz

      tar zxf lua-5.2.3.tar.gz

      cd lua-5.2.3

      make linux test


      The compilation and make went cleanly and I ended up with the following in the src directory which seems to be correct.  :


      root@Tesla:/lua-5.2.3/src# ls

      Makefile    lcode.o     ldump.c     llex.h      lopcodes.h  lstrlib.o   luac

      hello.lua   lcorolib.c  ldump.o     llex.o      lopcodes.o  ltable.c    luac.c

      lapi.c      lcorolib.o  lfunc.c     llimits.h   loslib.c    ltable.h    luac.o

      lapi.h      lctype.c    lfunc.h     lmathlib.c  loslib.o    ltable.o    luaconf.h

      lapi.o      lctype.h    lfunc.o     lmathlib.o  lparser.c   ltablib.c   lualib.h

      lauxlib.c   lctype.o    lgc.c       lmem.c      lparser.h   ltablib.o   lundump.c

      lauxlib.h   ldblib.c    lgc.h       lmem.h      lparser.o   ltm.c       lundump.h

      lauxlib.o   ldblib.o    lgc.o       lmem.o      lstate.c    ltm.h       lundump.o

      lbaselib.c  ldebug.c    liblua.a    loadlib.c   lstate.h    ltm.o       lvm.c

      lbaselib.o  ldebug.h    linit.c     loadlib.o   lstate.o    lua         lvm.h

      lbitlib.c   ldebug.o    linit.o     lobject.c   lstring.c   lua.c       lvm.o

      lbitlib.o   ldo.c       liolib.c    lobject.h   lstring.h   lua.h       lzio.c

      lcode.c     ldo.h       liolib.o    lobject.o   lstring.o   lua.hpp     lzio.h

      lcode.h     ldo.o       llex.c      lopcodes.c  lstrlib.c   lua.o       lzio.o


      As you can see the executable file lua is present as is the text file for processing hello.lua.

      However when I try to execute it :-


      root@Tesla:/lua-5.2.3/src# lua hello.lua

      -sh: lua: not found


      looking at the file properties :-


      root@Tesla:/lua-5.2.3/src# ls -lar lua

      -rwxr-xr-x    1 root     root        217303 Dec 21 14:20 lua


      Which indicates to me that I should be able to run this as a program as I have root permissions and I am in the directory.


      As I said I am very much a beginner at Linux. Can someone point me in the right direction?