LuaLanes / lanes

Lanes is a lightweight, native, lazy evaluating multithreading library for Lua 5.1 to 5.4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to make lanes lanes 3.15.1 work with luajit 2.0.4 ?

poznir opened this issue · comments

Linux x-dm 4.14.225-169.362.amzn2.x86_64 #1 SMP Mon Mar 22 20:14:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
LuaJIT 2.0.4 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
lanes 3.15.1-0

first i tried to install lanes with luarocks but failed on require:

luajit: bad light userdata pointer stack traceback: [C]: at 0x7f1b84a9caa0 [C]: in function 'require' /usr/local/share/lua/5.1/lanes.lua:38: in main chunk [C]: in function 'require' test_lanes.lua:2: in main chunk [C]: at 0x00404e90

after i tried to compile manually:

$ sudo make install LUAROCKS=1 LUA=luajit LUA_FLAGS=$(pkg-config --cflags luajit) LUA_LIBS=$(pkg-config --libs luajit) CFLAGS="-O2 -fPIC" CC="gcc" cd src && make LUA=luajit make[1]: Entering directory /tmp/lanes/src'
gcc -O2 -fPIC -c -o lanes.o lanes.c
gcc -O2 -fPIC -c -o cancel.o cancel.c
gcc -O2 -fPIC -c -o compat.o compat.c
gcc -O2 -fPIC -c -o threading.o threading.c
gcc -O2 -fPIC -c -o tools.o tools.c
gcc -O2 -fPIC -c -o state.o state.c
gcc -O2 -fPIC -c -o linda.o linda.c
gcc -O2 -fPIC -c -o deep.o deep.c
gcc -O2 -fPIC -c -o keeper.o keeper.c
gcc -O2 -fPIC -c -o universe.o universe.c
mkdir -p lanes
gcc -shared lanes.o cancel.o compat.o threading.o tools.o state.o linda.o deep.o keeper.o universe.o -lpthread -lluajit-5.1 -o lanes/core.so
make[1]: Leaving directory /tmp/lanes/src' mkdir -p /usr/local/lib/lua/5.1 /usr/local/lib/lua/5.1/lanes /usr/local/share/lua/5.1 install -m 644 src/lanes/core.so /usr/local/lib/lua/5.1/lanes cp -p src/lanes.lua /usr/local/share/lua/5.1

but when trying to require & and configure() it fails:

require"luarocks.require" local lanes = require "lanes" lanes.configure({})

resulted:

Must use luaL_newstate() for 64 bit target luajit: /usr/local/share/lua/5.1/lanes.lua:140: luaG_newstate() failed while creating state; out of memory stack traceback: [C]: in function 'configure' /usr/local/share/lua/5.1/lanes.lua:140: in function 'configure' test_lanes.lua:3: in main chunk [C]: at 0x00404e90


what can i do in order to make it work properly?
is it issue with luajit or lanes? is it something lanes going to fix?

Should be taken care of by c2f8835.