Cuberite Forum
Would you guys mind if I distribute MCServer + LuaJIT binaries? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Would you guys mind if I distribute MCServer + LuaJIT binaries? (/thread-1834.html)

Pages: 1 2 3


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - xoft - 03-17-2015

Still, I'd like to see a plugin that is too slow using the current Lua engine.


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - NiLSPACE - 03-17-2015

I'm especialy curious if Lua generators are faster using LuaJIT, because currently I get around 30-40 ch/s with my FloatingIslands generator. If I'd suddenly get 100 ch/s then that would allow much more complex and advanced to be written in Lua.


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - DiamondToaster - 03-17-2015

If there's alot of looping and number manipuation that goes on in the generator side, I wouldn't be surprised if you got double that. Smile

So basically, here's what I did:

First, I built the server normally to generate Bindings.cpp and Bindings.h as they refused to generate after the patch.

Then in CMakeLists.txt in the root source folder, I changed it to this:

# Include all the libraries:
add_subdirectory(lib/jsoncpp/)
add_subdirectory(lib/zlib/)
add_subdirectory(lib/tolua++/)
add_subdirectory(lib/sqlite/)
add_subdirectory(lib/SQLiteCpp/)
add_subdirectory(lib/expat/)
add_subdirectory(lib/luaexpat/)
add_subdirectory(lib/libevent/)

(The Lua entry was removed.)

Next I did deleted the lua folder in src/lib/ and lib/lua/

Then I downloaded LuaJIT libs from my Ubuntu repo.

Then, assuming that you ran cmake already, I went into src/src/CMakeFiles/MCServer.dir/link.txt.
There should be 2 flags under there that link to Lua libraries (-llua). I changed these to the file path of the static libs of LuaJIT installed earlier.

Now in src/lib/tolua++/CMakeFiles/tolua.dir/link.txt, do the same thing and replace "-llua" with the abolute filepath of the static LuaJIT lib.

Then go back and run make, it should compile relatively smoothly. Smile


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - DiamondToaster - 03-17-2015

And I just tried your FloatingIslands generator on my Odroid XU3. I got about 3.5ch/s vanilla and 9-12ch/s JIT. Big Grin


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - jan64 - 03-17-2015

That sounds nice.
Also: http://luajit.org/performance_x86.html


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - NiLSPACE - 03-17-2015

Nice that's around 2.5 times faster ;D Still that is pretty slow, so we might want to do some measurements on a different computerTongue


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - DiamondToaster - 03-17-2015

Tested it on an Intel Core i3-4000U, got 14ch/s vanilla, 22ch/sJIT. Big Grin

Also, It seems that when creating Bindings.cpp and Bindings.h, according to this FAQ, something needs to be adjusted:
"attempt to index global 'arg' (a nil value)"

http://luajit.org/faq.html


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - xoft - 03-17-2015

I'm a bit concerned that there is only an explicit list of supported platforms, it doesn't compile for others (http://luajit.org/faq.html , last-but-one item). This might be a problem, since we do support all the obscure platforms that have a C++11 compiler available.


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - jan64 - 03-17-2015

If this could be added as a compile-time switch, we wouldn't have that problem.
But, i'm don't know how doable is that.


RE: Would you guys mind if I distribute MCServer + LuaJIT binaries? - DiamondToaster - 03-18-2015

That would be nice. Add the option as a CMake flag or something? Big Grin