Hi everybody,
For those who plan to do some serious scripting in the future, it's always handy to have some libraries under your belt. Octane only provides it's own API, it doesn't have all the necessary functionality.
There's this nice ecosystem called LuaRocks (http://luarocks.org/). It provides a collection of lua libraries (called rocks) and handy tools to search, install and remove libraries. For those who code ruby or perl, it's similar to ruby gems or perl's cpan although not that extensive.
A few rocks that may prove very useful while scripting for Octane: luafilesystem, lcomplex, lmathx, lua-path and luanum.
happy hacking,
Thomas
Using LuaRocks
Cool, I like RubyGems and bundler so this will be very nice. I tried it out on my box running Fedora and it has path issues. I did a yum install luarocks to install it. I tried installing the rock "luafilesystem" as root (luarocks install luafilesystem) and my regular user (luarocks install luafilesystem --local) and Octane can't find either one via require. Root installs the rocks in /usr/lib/luarocks/rocks, the regular user installs to /home/{user}/.luarocks/lib/luarocks/rocks but neither paths are checked in Octane. Maybe the Fedora system luarocks is configured differently then other systems? Or is the problem that I'm running Lua 5.2 on my system?
P.S. The luarocks repository didn't have the "lfs" rock that you used in the objloader script, I'm was assuming that it is the same as "luafilesystem"?
P.S. The luarocks repository didn't have the "lfs" rock that you used in the objloader script, I'm was assuming that it is the same as "luafilesystem"?

Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
I'm using Ubuntu 12.04 and the filesystem lib (lfs.so) is installed in
This is the path that Octane searches for C modules:
Sorry for the hassle. Nobody of the devs had real Lua experience before so we're trying to figure out what works best while we go 
cheers,
Thomas
/usr/local/lib/lua/5.1/lfs.so
. You can edit ~/.luarocks/config.lua
to modify the install location of your "rocks" tree.This is the path that Octane searches for C modules:
Code: Select all
print(package.cpath) -> ./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so

cheers,
Thomas
I will try editing that file. I did find lfs.so but it's in /usr/lib/lua/5.2, my /usr/local/lib is empty.
Yep that path will not work for Fedora 20 and Lua 5.2, at least.
No problem on the hassle, I'm learning too, which is good.
Yep that path will not work for Fedora 20 and Lua 5.2, at least.

No problem on the hassle, I'm learning too, which is good.

Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Thanks for the awesome resource links.
Lanes might be a good add-on since it allows for multi-threading and could be interesting for multi script calling and linking.
One problem from the recent post is its instability.
Lanes might be a good add-on since it allows for multi-threading and could be interesting for multi script calling and linking.
One problem from the recent post is its instability.
Win 11 64GB | NVIDIA RTX3060 12GB
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
Yep, could be useful. But care has to be taken by the coder when using our Lua API because it's not thread-safe.Tugpsx wrote:Thanks for the awesome resource links.
Lanes might be a good add-on since it allows for multi-threading and could be interesting for multi script calling and linking.
One problem from the recent post is its instability.
cheers,
Thomas
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
Well Fedora is always bleeding edge so I'm not surprised you have Lua 5.2 installedgrimm wrote:I will try editing that file. I did find lfs.so but it's in /usr/lib/lua/5.2, my /usr/local/lib is empty.
Yep that path will not work for Fedora 20 and Lua 5.2, at least.
No problem on the hassle, I'm learning too, which is good.

cheers,
Thomas
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
I guess it's a long and cold winter in Alaska 
Of course, you don't have to use these rocks. Most of these things have there own project page from where you can download them directly...
cheers,
Thomas

Of course, you don't have to use these rocks. Most of these things have there own project page from where you can download them directly...
cheers,
Thomas