2

I want to be able to run something like luarocks-jit install X and have the newly installed rock use luajit as it's interpreter. Ultimately, I'm trying to run my busted tests through luajit.

Here's what I've tried:

Current versions of luarocks have a "--lua-version" flag in the configure script, but it only accepts "5.1" or "5.2", so no dice there. I've thought about editing that script to accept "jit" as well, but I haven't done it yet.

I've tried to follow this wiki page, but it was written for a different OS and I'm suspicious it's out of date for a couple of reasons:

  • I can't find any documentation for a lot of the variables it references (LUA_BINDIR, etc)
  • The scripts at /usr/local/bin/luarocks5.1 on my machine look totally different than those on the page.
  • The config-X.lua files shown on the page also look rather different than what I have installed.

Actually though, I'm having to do this on an unfortunately old version of Ubuntu (7.10) so perhaps it's more likely that it is my system that's out of date. Either way, I couldn't get luarocks-jit working.

Thanks for your help.

2 Answers 2

4

Nevermind, after messing with the luarocks configure script I realized that luajit is lua5.1 in a lot of ways. ./configure --lua-suffix=jit --with-lua=/usr seems to work on my system.

Sign up to request clarification or add additional context in comments.

Comments

0

Update 2021 : lua-suffix is no longer necessary


Once you have your luajit (2.0.5 as of today) installed and luarocks (3.7.0) extracted, use the following command :

./configure --lua-version="5.1"

which outputs

Configuring LuaRocks version 3.7.0...

Lua interpreter found: /usr/bin/luajit
Checking if /usr/bin/luajit is Lua version 5.1... yes
lua.h found: /usr/include/luajit-2.0/lua.h
unzip found in PATH: /usr/bin

Done configuring.

LuaRocks will be installed at......: /usr/local
LuaRocks will install rocks at.....: /usr/local
LuaRocks configuration directory...: /usr/local/etc/luarocks
Using Lua from.....................: /usr

* Type make and make install:
  to install to /usr/local as usual.
* Type make bootstrap:
  to install LuaRocks into /usr/local as a rock.

1 Comment

It's old I know, but how do I know which luarocks version belongs to lua-5.1.5 ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.