[pylucene-dev] Mac OS X 10.5, with PyLucene-2.2.0-1 built with GCJ

Edward N. Zalta zalta at mally.stanford.edu
Mon Jun 9 14:38:13 PDT 2008

  My team at the Stanford Encyclopedia of Philosophy (http://plato.stanford.edu/ 
), which relies on Mac OS X, Python and Lucene for its indexing engine  
("indexer.py") has discovered that our script has broken in moving to  
10.5, though we have attempted to use both the  /Library/Python/2.5/ 
site-packages/lucene-2.2.0-py2.5-macosx-10.5-i386.egg and .../ 
lucene-2.4.0_649619-py2.5-macosx-10.5-i386.egg.  We realize that  
PyLucene built with GCJ is deprecated, and so one group in my team is  
working to bring our original python script into line with the new  
PyLucene compiled with JCC (e.g., replacing "PyLucene" with "lucene"  
and elminating the call to JavaJM, etc.).
   Meanwhile, I am attempting to determine whether we can get GCJ- 
based PyLucene compiled on our Mac OS X 10.5.2 box with Python 2.5,  
and with gcc-4.2.0/gcj and PyLucene-src-2.2.0-1, so that we might use  
our current python script, if need be. I have now *successfully*  
compiled Pylucene-src-2.2.0-1 along with gcc-4.2.0/gcj in various tmp  
directories on one of our Intel Macs running 10.5  (all of the  
gcc-4.2.0 was installed in ~root/bin/test/gcc-4.2.0, and PyLucene,  
though compiled in /tmp/ was then put into /Library/Python/2.5/site- 
packages. However, a "make test" yields the following error, which may  
be known:

501# make test
cd samples/LuceneInAction; /System/Library/Frameworks/Python.framework/ 
Versions/2.5/bin/python index.py
Traceback (most recent call last):
  File "index.py", line 7, in <module>
    from lia.common.TestDataDocumentHandler import  
  File "/private/tmp/PyLucene-src-2.2.0-1/samples/LuceneInAction/lia/ 
common/TestDataDocumentHandler.py", line 26, in <module>
    from PyLucene import \
  File "/Library/Python/2.5/site-packages/PyLucene.py", line 33, in  
    from _PyLucene import *
ImportError: dlopen(/Library/Python/2.5/site-packages/_PyLucene.so,  
2): Symbol not found: _environ
  Referenced from: /var/root/bin/test/gcc-4.2.0/lib/libgcj.8.dylib
  Expected in: flat namespace

make: *** [samples/LuceneInAction/index] Error 1

We also get this error if we ignore the above and try to run the  
python indexing script we built for the encyclopedia.

If this is a known error, could someone please tell me which files  
need to be modified so that we can make use of our current python  
script? I've seen on the web that the error has something to do with

#include <crt_externs.h>
#define environ *_NSGetEnviron();

but I don't know which file this is suppose to be in.

Thanks very much for any help you can give me.
Edward N. Zalta    http://mally.stanford.edu/zalta.html
Senior Research Scholar
CSLI/Cordura Hall              zalta at mally.stanford.edu
Stanford University                    ph. 650-723-0488
Stanford, CA 94305-4115                fx. 650-725-2166

More information about the pylucene-dev mailing list