Ingredients
- CMake
- MinGW compiler (one of MinGW, TDM, MinGW-W64, …)
- Lua binaries
- LuaRocks setup binaries
- ZeroBrane Studio
Steps Involved
- Make sure the commands
cmake
andmingw32-gcc
are accessible from a general Command Prompt- Install CMake; straight-forward
- Install MinGW64; choose
i686-6.2.0-posix-dwarf-rt_v5-rev0
. Both archive and installer works. - mingw-w64 project’s MinGW only has
gcc.exe
while luarocks expectsmingw32-gcc.exe
; create a symbolic link (mklink
)
- Download
lua-5.3.3_Win32_bin.zip
from LuaForge Lua Binaries project- Make sure Lua and MinGW are of the same arch
- This contains the binaries (
.exe
s and.dll
) - Put them in the
/bin
directory e.g.F:\Apps\Lua\bin
- LuaBinaries is preferred over Joe DF’s Builds as it depends on
libgcc_s_dw2-1.dll
; distributed as a separate download
- Download
lua-5.3.3_Win32_dllw4_lib.zip
from LuaForge Lua Binaries project- This has the includes and libraries (except the
.dll
everything else is needed) - Put them in the right places:
F:\Apps\Lua\lib
andF:\Apps\Lua\include
– althoughinc
would be a better name, LuaRocks, by default, looks forinclude
- This has the includes and libraries (except the
- Put the
bin
directory in$PATH
; Lua 5.3 should work now from Command Prompt. - Extract
luarocks-2.3.0-win32.zip
somewhere (this can be removed post installation);cd
to it from an elevated prompt. - Run
install.bat /LV 5.3 /LUA F:\Apps\Lua /P F:\Apps\LuaRocks /MW
- This should successfully install LuaRocks. Save the logs for the information on
ENV
variables. - The LuaRocks installer directory that you extracted may be removed now.
- This should successfully install LuaRocks. Save the logs for the information on
- Go to the installed directory, search and install a rock.
luarocks install luafilesystem
l = require lfs
should now evaluate to something non-nil.- Configure ZeroBrane Studio to use this installation of Lua 5.3 interpreter by adding this line to the user configuration file
user.lua
:path.lua53 = 'F:/Apps/Lua/bin/lua.exe'
- After successful installation, adding the environment variables mandated by
install.bat
wasn’t needed when making ZBS use this Lua.- Earlier setting
PATH
,LUA_PATH
andLUA_CPATH
for LuaRocks and System rocktree were needed - If adding, do not change
/
into\
and keep the?
s
- Earlier setting