How to enable LuaJIT in GeeXLab

LuaJIT logo

LuaJIT is a Just-In-Time compiler for Lua. It’s actually a special version of Lua that optimizes Lua bytecode and when possible, converts it to machine code (see DynASM). Thanks to LuaJIT, Lua code can be really fast!

LuaJIT support is available in GeeXLab for Windows since version and has been added to Linux in version I also tested LuaJIT on macOS but I didn’t manage to make it work. I will retry later.

I will add LuaJIT support to Raspberry Pi and Tinker Board as soon as possible.

GeeXLab comes with the latest version of Lua which is Lua 5.3.4. On the other hand, the current version of LuaJIT supports Lua 5.1 only. So as long as you use regular Lua code (read compatible with Lua 5.1), everything is perfect and LuaJIT works fine. But if you use some features like bitwise operators (added in Lua 5.3), LuaJIT will generates an compilation error (for that particular case, the Lua Bit Operations Module can help).

Now that you know the limitations of LuaJIT, let’s see how to enable it in GeeXLab. You have to rename two dynamic libraries:

– on Windows, the regular Lua 5.3.4 engine is embedded in the gxl_x{32|64}.dll while the LuaJIT 2.0.5 engine is linked with gxl_x{32|64}_luajit.dll. GeeXLab is linked with gxl_x{32|64}.dll. So take advantage of LuaJIT, just rename gxl_x{32|64}_luajit.dll in gxl_x{32|64}.dll. That’s all.

– same thing on Linux: you have two dynamic libraries in the dylibs/ folders: and Just rename in

Last thing: there is a function in the gh_utils lib that allows to know if the current Lua engine is LuaJIT:

local ret = gh_utils.is_luajit()

For any feedback or bug report, a discussion thread is available HERE.

Leave a Comment

Your email address will not be published. Required fields are marked *