Mailing List Archive

Indexing and Searching works!
This is all hardly tested at all, but as of my last few commits to
Subversion the GCJ backed code now has basic indexing and searching
working. Check out test/main.c [1] for an example of how to use the new
API.

For the curious, it turns out that a lot of my problems were being
caused by compiling Java code with a 1.5.0 JDK, which GCJ appears to nto
like. I ran into a few other problems with GCJ itself, both of which I
was able to solve by writing small amounts of Java code to make the
calls I was unable to convince GCC to let me do from C++.

Next on the todo list is trying to get the CLI and unit tests running
again, and making the build system a bit more sane.

-garrett

[1]
http://svn.apache.org/repos/asf/incubator/lucene4c/branches/gcj-backend/test/main.c
Re: Indexing and Searching works! [ In reply to ]
Garrett Rooney wrote:
> This is all hardly tested at all, but as of my last few commits to
> Subversion the GCJ backed code now has basic indexing and searching
> working. Check out test/main.c [1] for an example of how to use the new
> API.
>
> For the curious, it turns out that a lot of my problems were being
> caused by compiling Java code with a 1.5.0 JDK, which GCJ appears to nto
> like. I ran into a few other problems with GCJ itself, both of which I
> was able to solve by writing small amounts of Java code to make the
> calls I was unable to convince GCC to let me do from C++.
>
> Next on the todo list is trying to get the CLI and unit tests running
> again, and making the build system a bit more sane.
>
> -garrett
>
> [1]
> http://svn.apache.org/repos/asf/incubator/lucene4c/branches/gcj-backend/test/main.c
>
>

/home/chip/gcc4/bin/g++ -g -Wall -Iinclude
`/usr/local/apr/trunk/bin/apr-1-config --includes`
`/usr/local/apr/trunk/bin/apr-1-config --cppflags`
`/usr/local/apr/trunk/bin/apr-1-config --cflags` -c src/util/init.cxx -o
src/util/init.o
src/util/init.cxx:3:46: error: org/apache/lucene/document/Field.h: No
such file or directory
src/util/init.cxx: In function 'void lcn_init()':
src/util/init.cxx:15: error: '::org' has not been declared
src/util/init.cxx:15: error: 'class$' was not declared in this scope
make: *** [src/util/init.o] Error 1

Where do I get this Field.h... I didn't see any rules for it in the
Makefile... I assume its generated from the .jar file?

Thanks,

-Paul
Re: Indexing and Searching works! [ In reply to ]
Paul Querna wrote:

> /home/chip/gcc4/bin/g++ -g -Wall -Iinclude
> `/usr/local/apr/trunk/bin/apr-1-config --includes`
> `/usr/local/apr/trunk/bin/apr-1-config --cppflags`
> `/usr/local/apr/trunk/bin/apr-1-config --cflags` -c src/util/init.cxx -o
> src/util/init.o
> src/util/init.cxx:3:46: error: org/apache/lucene/document/Field.h: No
> such file or directory
> src/util/init.cxx: In function 'void lcn_init()':
> src/util/init.cxx:15: error: '::org' has not been declared
> src/util/init.cxx:15: error: 'class$' was not declared in this scope
> make: *** [src/util/init.o] Error 1
>
> Where do I get this Field.h... I didn't see any rules for it in the
> Makefile... I assume its generated from the .jar file?

Run 'make headers' to generate the CNI headers for the Lucene java
libraries. You'll see two errors, because there are two classes that
gcjh can't correctly parse, and it'll leave a bunch of crap sitting in a
temp directory that you'll probably want to delete, but it'll also dump
all the required headers in include/org/apache/lucene.

Another of the "things I need to clean up" ;-)

-garrett