[lupa-dev] Re: Problems building on OS X

  • From: Stefan Behnel <stefan_ml@xxxxxxxxx>
  • To: Nic Pottier <nicpottier@xxxxxxxxx>
  • Date: Tue, 21 Dec 2010 15:03:54 +0100

Nic Pottier, 21.12.2010 14:47:
> On Tue, Dec 21, 2010 at 3:25 PM, Nic Pottier wrote:
>> However, I'm having trouble getting it going on Snow Leopard (OS X).
>>
>> I can build the latest version of LuaJIT no problem, and
>>
>> % python setup.py build
>>   and
>> % python setup.py install
>>
>> don't output any errors, but when it comes to import lupa I get the 
>> following:
>>
>> ------------------------------------------------------
>>
>> lagom:lupa-0.18 root# python
>> Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
>> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import lupa
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in<module>
>>   File "lupa/__init__.py", line 25, in<module>
>>     from lupa._lupa import *
>> ImportError: No module named _lupa
>>
>> ------------------------------------------------------
>>
>> Any ideas?
>>
> Note that I get a different (perhaps more useful?) error when trying to
> do the import from a different directory than my build dir:
>
 > >>> import lupa
 > Traceback (most recent call last):
 >    File "<stdin>", line 1, in<module>
 >    File "/Library/Python/2.6/site-packages/lupa/__init__.py", line 25,
 > in<module>
 >      from lupa._lupa import *
 > ImportError: dlopen(/Library/Python/2.6/site-packages/lupa/_lupa.so,
 > 2): Symbol not found: _luaL_argerror
 >    Referenced from: /Library/Python/2.6/site-packages/lupa/_lupa.so
 >    Expected in: flat namespace
 >   in /Library/Python/2.6/site-packages/lupa/_lupa.so

Two comments: 1) make sure lupa is built statically against LuaJIT and 2) 
you may be needing the "-flat_namespace" compiler option in your CFLAGS.

Stefan

Other related posts: