[Xapian-devel] Building Xapian on Mac OSX 10.6.x

Ira Ray Jenkins irarayjenkins at gmail.com
Sat Mar 26 15:43:30 GMT 2011


James,
    Thanks for the quick response. I am unfamiliar with the unix build environment, so tha is for your patience. I have successfully - no errors printed - built core and bindings with the following commands. 

#core
./configure CXX="g++ -m32"; make; sudo make install;

#bindings
./configure CXX="g++ -m32" XAPIAN_CONFIG=./../xcore/xapian-config PYTHON=/python/path/bin/python-32; make; sudo make install;

When I try to import I get the following error:

>>> import xapian
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/python/site-packages/xapian/__init__.py", line 28, in <module>
       _xapian = swig_import_helper()
    File. "/python/site-packages/xapian/__init__.py", line 27, in swig_import_helper
       return _mod
UnboundLocalError: local variable '_mod' referenced before assignment



I believe, from various googling, that the error is a failed import of xapian. So, do you have any ideas or solutions I can try? Thanks,

-- Ray

On Mar 26, 2011, at 9:20 AM, James Aylett <james-xapian at tartarus.org> wrote:

> On 26 Mar 2011, at 05:36, Ira Ray Jenkins wrote:
> 
>> I have a project that requires Xapian for a 32 bit arch, but Mac
>> defaults to 64 bit. How can I configure Xapian core and Xapian python
>> bindings to build 32 bit?
> 
> 
> You can select a particular architecture by setting a variable on your configure line:
> 
> $ ./configure CXX="g++ -m32"
> 
> will build 32 bit. You can check the architecture created by running file(1) on the resultant library (although this is tucked away due to our use of libtool), or of course on the installed library once completed.
> 
> This has now been documented in xapian-core's INSTALL file. Note that if building bindings as well, you'll need to do the same thing there; the architectures must match.
> 
> J
> 
> -- 
> James Aylett
> talktorex.co.uk - xapian.org - devfort.com - spacelog.org
> 
> 
> 




More information about the Xapian-devel mailing list