Luajit require not work in omnii!?



I write the first program in lua and I want it run in luajit. I need to use the modules from the library.
I wrote the command in the source file:
require (‘nixio.fs’).

Píšem prvý program v lua a chcem ho spúštať v luajit. Potrebujem použiť moduly z knižnice.
Napísal som príkaz do zdrojového súboru:
require (“nixio.fs”).

After running in lua is the command executed without errors but with luajit prints the following message:

Po spustený v lua je príkaz vykonaný bez chyby ale s luajit vypíše nasledovne správy:

luajit omnia-diskled-color.lua
luajit: omnia-diskled-color.lua:7: module ‘nixio.fs’ not found:
no field package.preload[‘nixio.fs’]
no file ‘./nixio/fs.lua’
no file ‘/usr/share/luajit-2.0.5/nixio/fs.lua’
no file ‘/usr/local/share/lua/5.1/nixio/fs.lua’
no file ‘/usr/local/share/lua/5.1/nixio/fs/init.lua’
no file ‘/usr/share/lua/5.1/nixio/fs.lua’
no file ‘/usr/share/lua/5.1/nixio/fs/init.lua’
no file ‘./nixio/’
no file ‘/usr/local/lib/lua/5.1/nixio/’
no file ‘/usr/lib/lua/5.1/nixio/’
no file ‘/usr/local/lib/lua/5.1/’
no file ‘./’
no file ‘/usr/local/lib/lua/5.1/’
no file ‘/usr/lib/lua/5.1/’
no file ‘/usr/local/lib/lua/5.1/’
stack traceback:
[C]: in function ‘require’
omnia-diskled-color.lua:7: in main chunk
[C]: at 0x00014a1c

Please how can I remedy the situation, so that it is possible to use luajit as well as lua?

Prosím ako môžem napraviť tento stav, tak aby bolo možné použivať luajit tak isto ako lua?


Well apparently the lua libs on Omnia are located directly in /usr/lib/lua/ (without 5.1). Still the *.so parts in there like are linked against and not, so I’d be a bit afraid to use those in luajit as-is.


luajit is faster than lua interpreter. Please, when will it be about repair done? Or write a guide on how to fix the problem.

luajit je rýchlejší interpreter ako lua. Prosím, kedy bude asi oprava vykonaná? Alebo napíšte návod ako problém odstrániť.


I don’t think it really needs a “repair”. It most likely needs separate re-packaging of lua libraries for luajit. Luajit itself does work well on Omnia – after all the default DNS resolver is unable to work without it. EDIT: anyway, I can’t promise any deadlines about that right now.


I’m trying to assign led “PCI1” activity bus mPCI1, the activity of the HDD. After versions of the TOS 3.9 it is no longer possible! So I try to write a replacement program in lua. It should be as faster (I have a NAS Kit with the mSATA controller).
Are not important the word, ‘repair’ or ‘re-packing’, but if they will put this feature use!

Snažím sa priradiť ledke PCI1 aktivitu zbernice mPCI1, ciže aktivite HDD. Po verzie TOS 3.9 už to nie je možné! Preto sa snažím napísať náhradný program
v lua. Mal by byť čo najrychleší (mám NAS Kit s mSATA radičom).
Nie sú dôležité slova “repair” alebo “re-packing”, ale keby sa bude dať táto črta použíť!


Yes, luajit should be faster, though significance of that will depend on what you do.


I know :-). What I am doing is inscribed above. Can you suggest a temporary solution?

Ja viem :-). Čo robím je napísane vyššie. Viete navrhnúť dočasne riešenie?


In the meantime I started to think that my fears about the incompatibility were unfounded. Therefore I suggest you try:

export LUA_PATH='/usr/lib/lua/?.lua'
export LUA_CPATH='/usr/lib/lua/?.so'


Correct! Now you can think about systemic solutions …
I’ve added the lines to the end of the file /etc/profile.

Správne! Teraz môžete premýšľať o systémovom riešení …
Pridal som riadky na koniec súboru /etc/profile.

Good work.
Thank you.


Systemic solution is easy; it’s mainly about those fears. Still, it should only have potential for breaking new use cases and not old ones, so I’m inclined to use that.


I agree!



Compatibility confirmed. Technical details elsewhere. I believe the solution will make it to official Turris OS soon.

Turris OS 3.11.3 in RC

Dokončil som písanie programov v lua. Sú to démoni, spúšťajú sa z rc.d!
Démon nebeží, ak sa spúšťa s luajit (nemá rád linky !?).
Našťastie je kompatibilný s lua. Tak som DOČASNE použil lua miesto luajit :-((!

I’ve finished writing programs in lua. They are demons, starting from the rc.d!
Demon is not running, start with luajit (does not like links!?).
Fortunately, is compatible with the lua. So I TEMPORALY used the lua instead of luajit:-((!