Luajit require not work in omnii!?

howto

#1

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/fs.so’
no file ‘/usr/local/lib/lua/5.1/nixio/fs.so’
no file ‘/usr/lib/lua/5.1/nixio/fs.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
no file ‘./nixio.so’
no file ‘/usr/local/lib/lua/5.1/nixio.so’
no file ‘/usr/lib/lua/5.1/nixio.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
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?


#2

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


#3

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ť.


#4

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.


#5

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žíť!


#6

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


#7

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?


#8

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'

#9

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.


#10

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.


#11

I agree!
Súhlasím!

Thanx!


#12

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


Turris OS 3.11.3 in RC
#13

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:-((!