You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Bill Janssen <ja...@parc.com> on 2010/07/01 01:25:23 UTC

JArray issue with PyLucene 2.9.2 on Fedora

I'm trying to build Lucene 2.9.2 on Fedora with gcc 4.3 and Python 2.5.1
and OpenJDK 6, but hit this issue with JArray:

[...]
building 'lucene._lucene' extension
creating build/temp.linux-i686-2.5
creating build/temp.linux-i686-2.5/build
creating build/temp.linux-i686-2.5/build/_lucene
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON=1 -D_jcc_shared=1 -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Ibuild/_lucene -I/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources -I/usr/include/python2.5 -c build/_lucene/JArray.cpp -o build/temp.linux-i686-2.5/build/_lucene/JArray.o -fno-strict-aliasing -Wno-write-strings
In file included from build/_lucene/JArray.cpp:21:
/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources/JArray.h:483: error: redefinition of ‘class JArray<signed char>’
/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources/JArray.h:337: error: previous definition of ‘class JArray<signed char>’
build/_lucene/JArray.cpp:961: error: redefinition of ‘PyObject* JArray<signed char>::wrap()’
build/_lucene/JArray.cpp:945: error: ‘PyObject* JArray<signed char>::wrap()’ previously defined here
error: command 'gcc' failed with exit status 1
make: *** [compile] Error 1
%

Should I fall back to 2.9.1, or try building from SVN?

Bill

Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> 
> On Thu, 1 Jul 2010, Bill Janssen wrote:
> 
> > Andi Vajda <va...@apache.org> wrote:
> >
> >>> I'm trying to build Lucene 2.9.2 on Fedora with gcc 4.3 and Python 2.5.1
> >>> and OpenJDK 6, but hit this issue with JArray:
> >>>
> >>> [...]
> >>> building 'lucene._lucene' extension
> >>> creating build/temp.linux-i686-2.5
> >>> creating build/temp.linux-i686-2.5/build
> >>> creating build/temp.linux-i686-2.5/build/_lucene
> >>> gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON=1 -D_jcc_shared=1 -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Ibuild/_lucene -I/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources -I/usr/include/python2.5 -c build/_lucene/JArray.cpp -o build/temp.linux-i686-2.5/build/_lucene/JArray.o -fno-strict-aliasing -Wno-write-strings
> >
> >> This error indicates that the C++ compiler thinks that jboolean and
> >> jbyte are the same types.
> >
> > Actually, the problem is the same old one that we've discussed before.
> > There is no "/usr/lib/jvm/java-6-openjdk" directory.  When I built JCC,
> > I had the environment variable JCC_JDK set to point to
> > /usr/lib/jvm/java-1.6.0-openjdk, which is where openjdk decided to
> > install itself.  But, at least in 2.9.2, JCC doesn't remember that and
> > re-use that knowledge.  Instead, in the above, it generates a completely
> > bogus and non-existent path to pull the include file headers from.  And
> > gcc, confused, falls back to the gcj headers.
> 
> If you're talking about jcc's forgetting this between 'build' and
> 'install' when run separately, that's been fixed in jcc 2.6, the
> version currently awaiting votes for release.

I think what I meant was, forgetting where it was told Java was on that
machine.  That is, between the build and install of JCC, and the build
of PyLucene.  Defaulting to that info, instead of a completely
non-existent path, might still be a win :-).  If that's what 2.6 does,
great.

Bill





Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Andi Vajda <va...@apache.org>.
On Thu, 1 Jul 2010, Bill Janssen wrote:

> Andi Vajda <va...@apache.org> wrote:
>
>>> I'm trying to build Lucene 2.9.2 on Fedora with gcc 4.3 and Python 2.5.1
>>> and OpenJDK 6, but hit this issue with JArray:
>>>
>>> [...]
>>> building 'lucene._lucene' extension
>>> creating build/temp.linux-i686-2.5
>>> creating build/temp.linux-i686-2.5/build
>>> creating build/temp.linux-i686-2.5/build/_lucene
>>> gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON=1 -D_jcc_shared=1 -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Ibuild/_lucene -I/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources -I/usr/include/python2.5 -c build/_lucene/JArray.cpp -o build/temp.linux-i686-2.5/build/_lucene/JArray.o -fno-strict-aliasing -Wno-write-strings
>
>> This error indicates that the C++ compiler thinks that jboolean and
>> jbyte are the same types.
>
> Actually, the problem is the same old one that we've discussed before.
> There is no "/usr/lib/jvm/java-6-openjdk" directory.  When I built JCC,
> I had the environment variable JCC_JDK set to point to
> /usr/lib/jvm/java-1.6.0-openjdk, which is where openjdk decided to
> install itself.  But, at least in 2.9.2, JCC doesn't remember that and
> re-use that knowledge.  Instead, in the above, it generates a completely
> bogus and non-existent path to pull the include file headers from.  And
> gcc, confused, falls back to the gcj headers.

If you're talking about jcc's forgetting this between 'build' and 'install' 
when run separately, that's been fixed in jcc 2.6, the version currently 
awaiting votes for release.

In 2.6, the config.py file is not written unless it needs to be.
See code in helpers/build.py for more details.

Starting with the upcoming pylucene 2.9.3 / 3.0.2 releases, all pylucene 
versions use the same version of jcc, currently 2.6.

Andi..

Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> > I'm trying to build Lucene 2.9.2 on Fedora with gcc 4.3 and Python 2.5.1
> > and OpenJDK 6, but hit this issue with JArray:
> >
> > [...]
> > building 'lucene._lucene' extension
> > creating build/temp.linux-i686-2.5
> > creating build/temp.linux-i686-2.5/build
> > creating build/temp.linux-i686-2.5/build/_lucene
> > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON=1 -D_jcc_shared=1 -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Ibuild/_lucene -I/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources -I/usr/include/python2.5 -c build/_lucene/JArray.cpp -o build/temp.linux-i686-2.5/build/_lucene/JArray.o -fno-strict-aliasing -Wno-write-strings

> This error indicates that the C++ compiler thinks that jboolean and
> jbyte are the same types.

Actually, the problem is the same old one that we've discussed before.
There is no "/usr/lib/jvm/java-6-openjdk" directory.  When I built JCC,
I had the environment variable JCC_JDK set to point to
/usr/lib/jvm/java-1.6.0-openjdk, which is where openjdk decided to
install itself.  But, at least in 2.9.2, JCC doesn't remember that and
re-use that knowledge.  Instead, in the above, it generates a completely
bogus and non-existent path to pull the include file headers from.  And
gcc, confused, falls back to the gcj headers.

Bill

Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> 
> On Jul 1, 2010, at 18:43, Bill Janssen <ja...@parc.com> wrote:
> 
> > Andi Vajda <va...@apache.org> wrote:
> >
> >> This error indicates that the C++ compiler thinks that jboolean and
> >> jbyte are the same types. Could it be that you're picking up gcj
> >> header files instead of the correct JDK ones as this tends to happen
> >> on redhat ?
> >> What is the first jni.h file in your header include path (including
> >> the implicit locations like /usr/include, etc...) ?
> >
> > Looks like it's /usr/lib/gcc/i386-redhat-linux/4.3.0/include/jni.h,
> > which as you say would be the gcj file.  So what's the fix for RedHat?
> 
> Uninstall the gcj packages ?

Actually, I tried that:  sudo yum remove gcc-java.  It got removed, but the
header files remained.

> Ask redhat ?

:-).

Bill

Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Andi Vajda <va...@apache.org>.
On Jul 1, 2010, at 18:43, Bill Janssen <ja...@parc.com> wrote:

> Andi Vajda <va...@apache.org> wrote:
>
>> This error indicates that the C++ compiler thinks that jboolean and
>> jbyte are the same types. Could it be that you're picking up gcj
>> header files instead of the correct JDK ones as this tends to happen
>> on redhat ?
>> What is the first jni.h file in your header include path (including
>> the implicit locations like /usr/include, etc...) ?
>
> Looks like it's /usr/lib/gcc/i386-redhat-linux/4.3.0/include/jni.h,
> which as you say would be the gcj file.  So what's the fix for RedHat?

Uninstall the gcj packages ?
Ask redhat ?

Andi..

> I don't see anything obvious in the Makefile.
>
> Bill

Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Bill Janssen <ja...@parc.com>.
Andi Vajda <va...@apache.org> wrote:

> This error indicates that the C++ compiler thinks that jboolean and
> jbyte are the same types. Could it be that you're picking up gcj
> header files instead of the correct JDK ones as this tends to happen
> on redhat ?
> What is the first jni.h file in your header include path (including
> the implicit locations like /usr/include, etc...) ?

Looks like it's /usr/lib/gcc/i386-redhat-linux/4.3.0/include/jni.h,
which as you say would be the gcj file.  So what's the fix for RedHat?
I don't see anything obvious in the Makefile.

Bill


Re: JArray issue with PyLucene 2.9.2 on Fedora

Posted by Andi Vajda <va...@apache.org>.
On Wed, 30 Jun 2010, Bill Janssen wrote:

> I'm trying to build Lucene 2.9.2 on Fedora with gcc 4.3 and Python 2.5.1
> and OpenJDK 6, but hit this issue with JArray:
>
> [...]
> building 'lucene._lucene' extension
> creating build/temp.linux-i686-2.5
> creating build/temp.linux-i686-2.5/build
> creating build/temp.linux-i686-2.5/build/_lucene
> gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON=1 -D_jcc_shared=1 -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux -Ibuild/_lucene -I/usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources -I/usr/include/python2.5 -c build/_lucene/JArray.cpp -o build/temp.linux-i686-2.5/build/_lucene/JArray.o -fno-strict-aliasing -Wno-write-strings
> In file included from build/_lucene/JArray.cpp:21:
> /usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources/JArray.h:483: error: redefinition of ?class JArray<signed char>?
> /usr/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/sources/JArray.h:337: error: previous definition of ?class JArray<signed char>?
> build/_lucene/JArray.cpp:961: error: redefinition of ?PyObject* JArray<signed char>::wrap()?
> build/_lucene/JArray.cpp:945: error: ?PyObject* JArray<signed char>::wrap()? previously defined here
> error: command 'gcc' failed with exit status 1
> make: *** [compile] Error 1
> %
>
> Should I fall back to 2.9.1, or try building from SVN?

This error indicates that the C++ compiler thinks that jboolean and jbyte 
are the same types. Could it be that you're picking up gcj header files 
instead of the correct JDK ones as this tends to happen on redhat ?
What is the first jni.h file in your header include path (including the 
implicit locations like /usr/include, etc...) ?

Andi..