Ingredients
- CMake
- MinGW compiler (one of MinGW, TDM, MinGW-W64, …)
- Lua binaries
- LuaRocks setup binaries
- ZeroBrane Studio
Steps Involved
- Make sure the commands
cmakeandmingw32-gccare 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.exewhile luarocks expectsmingw32-gcc.exe; create a symbolic link (mklink)
- Download
lua-5.3.3_Win32_bin.zipfrom LuaForge Lua Binaries project- Make sure Lua and MinGW are of the same arch
- This contains the binaries (
.exes and.dll) - Put them in the
/bindirectory 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.zipfrom LuaForge Lua Binaries project- This has the includes and libraries (except the
.dlleverything else is needed) - Put them in the right places:
F:\Apps\Lua\libandF:\Apps\Lua\include– althoughincwould be a better name, LuaRocks, by default, looks forinclude
- This has the includes and libraries (except the
- Put the
bindirectory in$PATH; Lua 5.3 should work now from Command Prompt. - Extract
luarocks-2.3.0-win32.zipsomewhere (this can be removed post installation);cdto 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
ENVvariables. - 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 lfsshould 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.batwasn’t needed when making ZBS use this Lua.- Earlier setting
PATH,LUA_PATHandLUA_CPATHfor LuaRocks and System rocktree were needed - If adding, do not change
/into\and keep the?s
- Earlier setting