-->
Page 1 of 1

Compiling of lua programs in PC-Windows.

PostPosted: Sun Sep 24, 2017 4:54 am
by jankop
My lua program is too long and can not be translated by node.compile () for lack of memory. I needed to compile it in PC-Windows. I admit that I did not understand the recommended procedure https://nodemcu.readthedocs.io/en/master/en/upload/#compiling-lua-on-your-pc-for-uploading
I'm looking all day, but I can not find solution. Can anyone please describe me the procedure in detail? Thanx

Re: Compiling of lua programs in PC-Windows.

PostPosted: Mon Sep 25, 2017 2:35 am
by jim121049
You can compile your Lua script on a PC to check syntax but according to the docs: "compiled output cannot run on the ESP8266" so that's not going to help with your problem. If it were me, I'd investigate dividing the program up into smaller modules, which are individually compiled, and then called using "dofile()".

Re: Compiling of lua programs in PC-Windows.

PostPosted: Mon Sep 25, 2017 8:08 am
by jankop
Yes, but it is not all:
Simply change directory to the firmware root directoy and run the command:
lua tools/cross-lua.lua
This will generate a luac.cross executable in your root directory which can be used to compile and to syntax-check Lua source on the Development machine for execution under NodeMCU Lua on the ESP8266.