On Mon, Nov 14, 2011 at 11:20 AM, Andi Vajda <va...@apache.org> wrote: > > On Mon, 14 Nov 2011, Jiang Fung Wong wrote: > >> Thanks for the reply. >> >>> What version of Lucene are you using ? >> >> I checked out from pylucene svn trunk, it's 4.0 > > That's a bit bleeding edge due to the rapidly changing nature of Lucene's > trunk 4.0. You should really use PyLucene's 3.x branch or 3.4 release. > > There is quite a bit of work involved in getting PyLucene to work with > Lucene 4.0, mostly in porting all the samples and unit tests again since the > API has changed a lot. I'm waiting for things to settle down a bit before > embarking on this. > > FYI, a Lucene 3.5 release seems to be planned for the near future. >
Hi I have successfully installed on Debian. I encountered linker error on Arch that I couldn't solve. I wrote a guide. Below are the versions of various tools used when the pyLucene for this guide was compiled. Debian 6.0 Lucene 3.4 openjdk6 6b18 ant 1.8.0 gcc: 4.4.5 (!) python: 2.6.6 jcc 2.11 The Steps: 1. Upgrade the memory of the system to at least 1.25GB RAM. 2. update the index of package manager. apt-get update 3. install necessary packages using package manager apt-get install build-essential ant subversion python-dev openjdk-6-jdk python-setuptools 4. svn checkout http://svn.apache.org/repos/asf/lucene/pylucene/tags/pylucene_3_4_0 pylucene 5. cd pylucene/jcc 6. vi setup.py, review according to http://lucene.apache.org/pylucene/jcc/documentation/install.html (usually no change). 7. patch setuptools, you can skip this to trigger an error, and get the command hint: su -c 'patch -d /usr/lib/python2.6/dist-packages -Nup0 < /home/kakarukeys/pylucene/jcc/jcc/patches/<RELEVANT PATCH>' (might have errors) 8. python setup.py build 9. su -c 'python setup.py install' 10. cd .. 11. vi Makefile, configure prefixes, choose optional contrib modules # Debian Linux PREFIX_PYTHON=/usr ANT=ant PYTHON=$(PREFIX_PYTHON)/bin/python JCC=$(PYTHON) -m jcc.__main__ --shared NUM_FILES=3 ...... # comment/uncomment the desired/undesired optional contrib modules below JARS+=$(ANALYZERS_JAR) # many language analyzers JARS+=$(MEMORY_JAR) # single-document memory index JARS+=$(HIGHLIGHTER_JAR) # needs memory contrib JARS+=$(EXTENSIONS_JAR) # needs highlighter contrib JARS+=$(QUERIES_JAR) # regex and other contrib queries JARS+=$(SMARTCN_JAR) # smart chinese analyzer JARS+=$(SPATIAL_JAR) # spatial lucene JARS+=$(GROUPING_JAR) # grouping module JARS+=$(JOIN_JAR) # join module 12. make 13. su -c 'make install' 14. su -c 'make test' 15. run this in python console to test: import lucene lucene.initVM() 16. reinstall setuptools to reverse the patching: apt-get --reinstall install python-setuptools >> Other info: >> latest ArchLinux 3.1.0-4-ARCH >> openjdk6 6.b22_1.10.4-1 >> gcc: 4.6.2 >> python: 2.6.7 >> jcc 2.11 >> ant 1.8.2-2 >> NO_SHARED >> >> Shall I use lucene 3.x ? > > Yes. That's the so-called stable trunk :-) > > Andi.. > > >>> Yes, add mutable to the reserved word list by adding --reserved mutable >>> to the jcc command line. >> >> Tried. It didn't help. I think the point is we need to make 'mutable' >> *not* a reserved word, so that the compiler does not complain. >> >> On Mon, Nov 14, 2011 at 2:20 AM, Andi Vajda <va...@apache.org> wrote: >>> >>> On Nov 13, 2011, at 2:10, Jiang Fung Wong <jiangfung.w...@jamiq.com> >>> wrote: >>> >>>> I tried to compile pylucene on ArchLinux. JCC compilation was fine. >>>> When I tried to make. I got this error: >>>> >>>> In file included from >>>> build/_lucene/org/apace/lucene/util/mutable/MutableValueFloat.h:4:0, >>>> from build/_lucene/__wrap01__.cpp:17795: >>>> build/_lucene/org/apace/lucene/util/mutable/MutableValue.h:19:27: >>>> error: expected identifier before []mutable[] >>>> build/_lucene/org/apace/lucene/util/mutable/MutableValue.h:19:35: >>>> error: expected unqualified-id before []([] token >>>> >>>> It seems that a reserved keyword 'mutable' has been used in the code. >>> >>> What version of Lucene are you using ? >>> I haven't seen this error yet with 3.x. >>> >>>> Any idea how to solve it? >>> >>> Yes, add mutable to the reserved word list by adding --reserved mutable >>> to the jcc command line. >>> >>>> Which distro, ant version, python version, gcc version do you >>>> recommend, for compilation of the latest pyLucene? >>> >>> distro: nothing in particular >>> ant: whatever works for Lucene >>> python: 2.x, x >= 4 >>> gcc: whatever's current on your system >>> >>> Andi.. >>> >>>> >>>> Regards, >>>> WJF >>> >> >