Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuaJIT intergration with Sol2 #61

Closed
ghost opened this issue Apr 18, 2016 · 6 comments
Closed

LuaJIT intergration with Sol2 #61

ghost opened this issue Apr 18, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2016

Hi, i'm trying to use LuaJit intead of the standard lua,
I did compile the LuaJit and I used the lua51.lib generated from it on sol2.

But when I try to get: "jit.version" inside a script, doesn't work.
can anyone help-me?
I need a way to check if LuaJit is being used.

OBS: I did with the dll instead of static lib, but the same occurs.

@ThePhD
Copy link
Owner

ThePhD commented Apr 18, 2016

That module is built into LuaJIT. If it's not showing up, you're not linking the right library / including the right headers. It's supposed to be immediately available whenever you open a luaL_newstate with luajit, or so the documentation says:

"The functions in this built-in module..."

@ThePhD
Copy link
Owner

ThePhD commented Apr 18, 2016

Aww, crap.

So I went through the JIT sources just to make sure, and as it turns out you need to specificall luaopen_jit in order for this to be made available to you. I'm going to push this to the main branch to allow for it: it's a special function that comes with luajit and I didn't know it was even a thing.

@ghost
Copy link
Author

ghost commented Apr 18, 2016

Yes, it was that, after your first replay, i checked again and found this function.
Now it's working, thanks.

@ThePhD
Copy link
Owner

ThePhD commented Apr 18, 2016

Good, good. I'll push my changes to the repo and allow you to open it using the lua_openlibraries function, like so:

luajit

@ghost
Copy link
Author

ghost commented Apr 18, 2016

Nice, thanks and good job <3

@ThePhD
Copy link
Owner

ThePhD commented Apr 18, 2016

It's here now. Happy coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant