On Fri, 12 Dec 2003, Claes Holmerson wrote:

> Hi!
> I saw on the lucene-dev mailing list that you had compiled lucene with
> gcj. Would you mind sharing your makefile or build process with me
> and/or the mailing list? I am not subscribed but found your post in the
> archive.
> I recently tried to native compile a small program using lucene with gcj
> myself, but it didn't work so well. I had never used gcj before so I
> would be very interested to see how you did it. It core dumped
> complaining about GermanAnalyzer or something... (I was using gcj from
> Suse 8.2)
> Thanks,
> Claes

Compiling lucene is simple:

  - cd lucene-1.3-rc3/src/java
  - find . -name '*.java' -print > files.txt
  - gcj -c -g -O2 --encoding=ISO-8859-1 @files.txt
  - cd ../demo
  - find . -name '*.java' -print > demo.txt
  - gcj -c -g -O2 --encoding=ISO-8859-1 --classpath=../src @demo.txt
  - gcj -O2 --main=org.apache.lucene.demo.IndexHTML -o IndexHTML demo.o ../java/files.o
  - cd ../..
  - mkdir index
  - src/demo/IndexHTML -create $JAVA_HOME/docs/api

Depending on your OS, your mileage may vary. The version of gcc shipped by
Apple, gcc 3.3, doesn't come with gcj.
I had best luck with gcc 3.4 experimental, the 12/03 snapshot.
See http://gcc.gnu.org for more details.
I built gcc 3.4 on Mac OS X 10.3.1, Redhat 9 and the latest cygwin.

In particular, threading support is iffy. The gcc/gcj 3.4 built lucene doesn't
run on cygwin for instance. An earlier version (3.1) crashesd with a 'too many
threads error'. The IndexHTML demo creates a thread for each file it
processes instead of recycling them.
The IndexFiles demo doesn't use threads and ran everywhere I tried it compiled
with any of gcc/gcj 3.4, 3.3 and 3.1

On Mac OS X 10.3.1 and Redhat 9, using gcc/gcj 3.4 12/03/2003, the IndexHTML
demo works great.


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to