Program "lua" is not found in PATH

Discussion to talk about software related topics only.
Post Reply
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Program "lua" is not found in PATH

Post by sulliwk06 »

I am running NNDK 2.6.7, and I'm trying to start learning about lua. I set up a new project, pointed to the lua libraries, and imported the lua shell script example. During compilation I get the error "Program "lua" is not found in PATH". Am I supposed to install lua separately? The Lua Getting Started guide doesn't really mention anything about installing it separately, but I'm guessing I need to download the lua 5.1.4 source and build it from scratch?

I literally know nothing about lua at this point, so any advice you can give me would help.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Program "lua" is not found in PATH

Post by dciliske »

Ah... yea. I'll be happy to answer these questions. If something's not in the getting started guide let me know and I'll get things fixed for the next round of things.

As for your question, yes, you will need to install lua on your machine for complua to run. That should be updated in the doc. The notion for that is that if you're writing lua, it's expected that you'll be trying out short snippets in the RIPL on your PC.

Also, as for the language itself, I'd advice you to spend a day or so working through the reference manual and testing things out in the interpretter on your PC. That will give you a good feel for the language.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Program "lua" is not found in PATH

Post by sulliwk06 »

Does the installed version of lua need to match the 5.1.4 version that is mentioned in the getting started guide?

I tried building 5.1.4 from the source but ran into a few headaches, so I found the binaries for the 5.1.4 executable and the mingw4 library. I added them to my path and now when I compile my netburner project I run into this error:

The stand alone interpreter seems to be working fine

Code: Select all

lua: C:\nburn/pcbin/complua/complua.lua:11: module 'lfs' not found:
	no field package.preload['lfs']
	no file 'C:\nburn\pcbin\complua\lfs.lua'
	no file '.\lfs.lua'
	no file 'Z:\bin\lua\lfs.lua'
	no file 'Z:\bin\lua\lfs\init.lua'
	no file 'Z:\bin\lfs.lua'
	no file 'Z:\bin\lfs\init.lua'
	no file '.\lfs.dll'
	no file '.\lfs51.dll'
	no file 'Z:\bin\lfs.dll'
	no file 'Z:\bin\lfs51.dll'
	no file 'Z:\bin\clibs\lfs.dll'
	no file 'Z:\bin\clibs\lfs51.dll'
	no file 'Z:\bin\loadall.dll'
	no file 'Z:\bin\clibs\loadall.dll'
stack traceback:
	[C]: in function 'require'
	C:\nburn/pcbin/complua/complua.lua:11: in main chunk
	[C]: ?
Build error occurred, build is stopped
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: Program "lua" is not found in PATH

Post by sulliwk06 »

So I found a LuaForWindows installer and that seemed to install all of the modules I needed to get everything working. I've started playing around with loading scripts from the SD card and running them. Now I'm wondering how Lua is affected by the task based operating system. When I call a function with lua_pcall, does that run non-blocking in the task I'm in? And I'm guessing I shouldn't share Lua states between tasks?

Also, is the luaL_loadfile function set up to read files from the SD card or flash file system? Currently I'm just using lua_loadfile with my own lua_reader to grab the file as a chunk.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Program "lua" is not found in PATH

Post by dciliske »

Sorry, missed your earlier post. Glad you figured out your own issue. :/

As for lua states, you are semi-correct that you should not share between tasks. You just can't have multiple tasks accessing the same state at the same time.

Yes, luaL_loadfile is setup to read from the SD card. However, it does so in a bit of a strange way. It performs a path search depending on the drive numbers declared in the variable 'driveNumbers' in lauxlib.cpp. It will load the first file it finds matching the name given in it's search path. You can change the search order my changing the order of this array. By default, the EFFS file system is enabled in the library, but the STD filesystem is not, this is configured with the header file 'lua_predef.h'.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply