Comments (11)
Impossible to say why this fails. Most steps seem to have worked: it built correctly, it imported, it (apparently) loaded the shared LuaJIT library - and then fails trying to initialise the LuaJIT runtime. Lua(JIT) doesn't provide any information at this point why it failed, so there isn't much of a way to make Lupa provide debug information here.
Does LuaJIT itself run on your machine?
from lupa.
$ luajit
LuaJIT 2.0.1 -- Copyright (C) 2005-2013 Mike Pall. http://luajit.org/
JIT: ON CMOV SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
> = 1+1
2
from lupa.
That seems to be a newer version than I tried before. However, the problem is still the same.
$ sudo pip-2.7 install lupa
Downloading/unpacking lupa
Downloading lupa-0.20.tar.gz (119kB): 119kB downloaded
Running setup.py egg_info for package lupa
building with Cython 0.19.1
No local build of LuaJIT2 found in lupa directory, checking for installed library using pkg-config
pkg-config found LuaJIT version 2.0.1
Installing collected packages: lupa
Running setup.py install for lupa
building with Cython 0.19.1
No local build of LuaJIT2 found in lupa directory, checking for installed library using pkg-config
pkg-config found LuaJIT version 2.0.1
skipping 'lupa/_lupa.c' Cython extension (up-to-date)
building 'lupa._lupa' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -O2 -fwrapv -arch x86_64 -arch i386 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include/luajit-2.0 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lupa/_lupa.c -o build/temp.macosx-10.8-intel-2.7/lupa/_lupa.o
lupa/_lupa.c:9253:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
lupa/_lupa.c:9331:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
lupa/_lupa.c:9253:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
lupa/_lupa.c:9331:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -isysroot / -L/opt/local/lib -L/opt/local/lib/db46 -arch x86_64 -arch i386 build/temp.macosx-10.8-intel-2.7/lupa/_lupa.o -L/opt/local/lib -lluajit-5.1 -o build/lib.macosx-10.8-intel-2.7/lupa/_lupa.so
ld: warning: ignoring file /opt/local/lib/libluajit-5.1.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libluajit-5.1.dylib
Successfully installed lupa
Cleaning up...
$ python
Python 2.7.5 (default, May 24 2013, 16:30:10)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from lupa import LuaRuntime
>>> lua = LuaRuntime()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_lupa.pyx", line 116, in lupa._lupa.LuaRuntime.__cinit__ (lupa/_lupa.c:2237)
lupa._lupa.LuaError: Failed to initialise Lua runtime
>>>
from lupa.
This might give a hint:
ld: warning: ignoring file /opt/local/lib/libluajit-5.1.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/local/lib/libluajit-5.1.dylib
Can you try building only for 64 bits by setting ARCHFLAGS="-arch x86_64" ?
You're using a 64 bit Python, right?
from lupa.
$ ARCHFLAGS="-arch x86_64" pip-2.7 install lupa
Downloading/unpacking lupa
Downloading lupa-0.20.tar.gz (119kB): 119kB downloaded
Running setup.py egg_info for package lupa
building with Cython 0.19.1
No local build of LuaJIT2 found in lupa directory, checking for installed library using pkg-config
pkg-config found LuaJIT version 2.0.1
Installing collected packages: lupa
Running setup.py install for lupa
building with Cython 0.19.1
No local build of LuaJIT2 found in lupa directory, checking for installed library using pkg-config
pkg-config found LuaJIT version 2.0.1
skipping 'lupa/_lupa.c' Cython extension (up-to-date)
building 'lupa._lupa' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/opt/local/include/luajit-2.0 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lupa/_lupa.c -o build/temp.macosx-10.8-intel-2.7/lupa/_lupa.o
lupa/_lupa.c:9253:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
lupa/_lupa.c:9331:14: warning: explicitly assigning a variable of type 'PyObject *' (aka 'struct _object *') to itself [-Wself-assign]
__pyx_self = __pyx_self;
~~~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -isysroot / -L/opt/local/lib -L/opt/local/lib/db46 -arch x86_64 build/temp.macosx-10.8-intel-2.7/lupa/_lupa.o -L/opt/local/lib -lluajit-5.1 -o build/lib.macosx-10.8-intel-2.7/lupa/_lupa.so
Successfully installed lupa
Cleaning up...
$ python
Python 2.7.5 (default, May 24 2013, 16:30:10)
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.57))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from lupa import LuaRuntime
>>> lua = LuaRuntime()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_lupa.pyx", line 116, in lupa._lupa.LuaRuntime.__cinit__ (lupa/_lupa.c:2237)
lupa._lupa.LuaError: Failed to initialise Lua runtime
from lupa.
ISTM that in your last build attempt it didn't rebuild LuaJIT, just Lupa itself. Could you try a completely clean build with 64bit archflags?
from lupa.
You're running into this issue (documented http://luajit.org/install.html):
"If you're building a 64 bit application on OSX which links directly or indirectly against LuaJIT, you need to link your main executable with these flags:
-pagezero_size 10000 -image_base 100000000
Also, it's recommended to rebase all (self-compiled) shared libraries which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua). See: man rebase"
Save yourself a lot of headaches and build lupa against lua51 instead.
from lupa.
Rebase does not seem to make a difference.
( command rebase -low_address 10000 -high_address 100010000 _lupa.so
)
How do I instruct pip/setuptools to build lupa against lua51?
from lupa.
The executable itself (python) must be linked with those flags. That's why
it's a pain in the butt.
from lupa.
Oh, and lupa 0.21 now comes with a setup.py flag "--no-luajit" (if I
remember correctly). For 0.20, hacking setup.py also works.
from lupa.
Closing as this is an issue with the user local setup. When built properly, it shouldn't occur. I'd accept pull requests that make the build more robust, though.
from lupa.
Related Issues (20)
- Error loading C modules in 2.x HOT 6
- Expose Lua load arguments (mode and chunkname) HOT 9
- Identity of wrapped Lua objects
- Deadlock involving __dealloc__ HOT 3
- [Feature Request] Async Overhaul
- [Feature Request] Expose Guts for better fine control.
- Ship Lua 5.1 with default lupa installation HOT 3
- pip install lupa fails on Windows HOT 2
- Terra HOT 1
- question: using python functions on lua tables HOT 2
- error lupa.lua54.LuaSyntaxError:
- Can Chinese name function functions be supported?
- Can't install lupa using pip HOT 3
- lua51 missing HOT 1
- 2.1 `pip install --upgrade lupa` not enough, `--force-reinstall` was needed HOT 4
- Unable to Import 'lua-utf8' in LuaJIT HOT 1
- 2.1: pytest fails in `lupa/tests/test.py::TestOverflowMixin::test_no_overflow` unit HOT 8
- Cython error: Lua "undeclared name not builtin: long" HOT 2
- 'popen' not supported
- How to pass a python dictionary as an argument into a function defined in LUA code? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lupa.