User:Aslantis/Luajit on PPC64

From Gentoo Wiki
Jump to:navigation Jump to:search

Simple guide for getting luajit running on PPC64.

DISCLAIMER

While the required fork of luajit runs, it does not actually have the JIT functionality, so it will still be slow. It also has not been updated for 6 years as of writing this. That said, upstream luajit does support PPC32 big endian, complete with JIT functionality: so if you're running big endian ppc64, you might get the best performance running the 32 bit build of upstream luajit. I plan to write a PPC64 multilib guide soon(ish).

Debian, RHEL, and Suse package this fork of luajit on PPC64. All of the tests that pass on upstream ppc32 pass on this fork (or should).

How to install

First off, there's no live ebuild of luajit in ::gentoo. But, there is one in mva's overlay. So lets merge that now:

root #eselect repository enable mva
root #emerge --sync mva

Then, we need to specify the fork we want to build:

FILE /etc/portage/env/luajit-live
EGIT_OVERRIDE_REPO_LUAJIT_2_0="https://github.com/PPC64/LuaJIT"
EGIT_OVERRIDE_BRANCH_LUAJIT_2_0="ppc64-port"
FILE /etc/portage/package.env
*/luajit luajit-live
FILE /etc/portage/package.accept_keywords
dev-lang/luajit **

Now, we should be able to just compile luajit:

root #emerge -va luajit
root #luajit --version

Set systemwide

Warning
As you can guess this could potentially be (and probably is) a bad idea. So I guess I'm supposed to be discouraging this. :)
FILE /etc/portage/profile/package.use.mask/ppc
*/* -lua_single_target_luajit
FILE /etc/portage/make.conf
LUA_SINGLE_TARGET="luajit"
root #emerge -va --deep --changed-use @world