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 Felix Schwarz <fe...@web.de> on 2012/06/12 12:08:09 UTC

building JCC on Python 2.4

Hey,

I'm trying to build JCC on Python 2.4.3 (CentOS 5). However during the
compilation I get this error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
-D_java_generics -DJCC_VER="2.13" -I/usr/lib/jvm/java-openjdk/include
-I/usr/lib/jvm/java-openjdk/include/linux -I_jcc -Ijcc/sources
-I/usr/include/python2.4 -c jcc/sources/JArray.cpp -o
build/temp.linux-x86_64-2.4/jcc/sources/JArray.o -DPYTHON -O0
jcc/sources/JArray.h:44: error: 'Py_ssize_t' does not name a type
jcc/sources/JArray.h:75: error: expected ';' before '(' token
jcc/sources/JArray.cpp:1213: error: expected `;' at end of input
jcc/sources/JArray.cpp:1213: error: expected `}' at end of input
jcc/sources/JArray.h: In constructor 'JArray<T>::JArray(_jobject*)':

Well, I could work around that one with a patch (see attached) but afterwards
compilation still fails:
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
-D_java_generics -DJCC_VER="2.13" -I/usr/lib/jvm/java-openjdk/include
-I/usr/lib/jvm/java-openjdk/include/linux -I_jcc -Ijcc/sources
-I/usr/include/python2.4 -c jcc/sources/JArray.cpp -o
build/temp.linux-x86_64-2.4/jcc/sources/JArray.o -DPYTHON -O0
_jcc/java/lang/Class.h:48: error: ISO C++ forbids declaration of 'JArray' with
no type
_jcc/java/lang/Class.h:48: error: expected ';' before '<' token
_jcc/java/lang/Class.h:49: error: ISO C++ forbids declaration of 'JArray' with
no type
_jcc/java/lang/Class.h:49: error: expected ';' before '<' token

I'm using GCC 4.1.2:
gcc-4.1.2-52.el5_8.1
gcc-c++-4.1.2-52.el5_8.1

Any idea what I'm doing wrong? Do you need more info?

fs

Re: building JCC on Python 2.4

Posted by Felix Schwarz <fe...@web.de>.
Hi Andi,

Am 13.06.2012 02:30, schrieb Andi Vajda:
> In your patch, instead of including "functions.h", add this to JArray.h after
> the #include "macros.h" line:

That worked, thank you.

fs

Re: Editing the PyLucene web site

Posted by Andi Vajda <va...@apache.org>.
  Hi Petrus,

On Thu, 28 Jun 2012, Petrus Hyvönen wrote:

> Hi,
>
> Attached is a patch for content/pylucene/jcc/features.mdtext, tested with build_site script.

Thank you for your patch !

I integrated it after indenting a few more things and published the site.
http://lucene.apache.org/pylucene/jcc/features.html

It would be nice to figure out how to get the JCC subsite to inherit the 
style sheet used by the rest of the entire site.

Andi..

Re: Editing the PyLucene web site

Posted by Petrus Hyvönen <pe...@gmail.com>.
Hi,

Attached is a patch for content/pylucene/jcc/features.mdtext, tested with build_site script.


Re: Editing the PyLucene web site

Posted by Andi Vajda <va...@apache.org>.
  Hi Petrus,

On Tue, 19 Jun 2012, Petrus Hyvönen wrote:

> Attached is an diff update to the mdtext files with jcc documentation.
>
> I didn't manage to get the site build system to work, I think a perl 
> markdown module is needed, which I get build error when installing.

If you don't tell me what error, it's that much harder to help you.

> However there are some mdtext editors around, so I just updated some of 
> the text in there, please check that it looks ok before activating.

I took a quick look and your changes did not have much effect.
Please test your changes using the CMS build system.
For example, it seems that your addition of ``` line 23 in features.mdtext 
had no effect.

It's going to be very difficult to do this blind.

Did you follow all the steps listed in in LUCENE-2748 comment I sent you a 
link to, in particular, what's described at 
http://www.apache.org/dev/cmsref.html#local-build, especially these steps 
listed there ?
$ cd /path/to/cms/build/tree
$ export MARKDOWN_SOCKET=`pwd`/markdown.socket PYTHONPATH=`pwd`
$ python markdownd.py

Thanks for trying but if I end up spending more time debugging what you send 
me than doing it myself, the situation is even worse and going nowhere :-(

Cheers !

Andi..

>
> Best Regards
> /Petrus
>
>
>
> On 18 jun 2012, at 01:17, Andi Vajda wrote:
>

Re: Editing the PyLucene web site

Posted by Petrus Hyvönen <pe...@gmail.com>.
Hi,

Attached is an diff update to the mdtext files with jcc documentation.

I didn't manage to get the site build system to work, I think a perl markdown module is needed, which I get build error when installing.

However there are some mdtext editors around, so I just updated some of the text in there, please check that it looks ok before activating.

Best Regards
/Petrus



On 18 jun 2012, at 01:17, Andi Vajda wrote:

Editing the PyLucene web site

Posted by Andi Vajda <va...@apache.org>.
  Hi Petrus,

On Sun, 17 Jun 2012, Petrus Hyvönen wrote:

> Thanks for your response.
>
> Sorry about the topic, my intention was not to hijack the thread, used an 
> old message to get the list address...
>
> Send me instructions and I'll clean up the page.

The new site's source is checked into svn:
   http://svn.apache.org/repos/asf/lucene/cms/trunk

Check this out into a directory of yours.
The pylucene directory is under content/pylucene.

To build a copy of the site to review and debug your edits, please refer to 
this comment in the Lucene issue tracking the transition, LUCENE-2748:
https://issues.apache.org/jira/browse/LUCENE-2748?focusedCommentId=13080471&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13080471

Once you're satisfied with your changes, send a patch to the pylucene-dev 
mailing list and I'll apply them.

Thanks !

Andi..

>
> Regards
> /Petrus
>
>
> On 17 jun 2012, at 18:39, Andi Vajda wrote:
>
>> Please, don't hijack a thread, start a new one when switching topics. Your questions below have nothing to do with building on Python 2.4.
>>
>> On Jun 17, 2012, at 5:39, "Petrus Hyvönen" <pe...@gmail.com> wrote:
>>
>>> I am trying to clean up my wrap script and comes to some questions.
>>>
>>> Is there a way to see if a method or constructor is now wrapped due to that any of its inputs/outputs are not wrapped? (to make sure that I haven't missed any --package)
>>
>> Use dir() on the wrapper class to see what got wrapped. But to get a definite answer you need to look at the generated source code to know about all the overloads of a Java method that got wrapped.
>>
>>> If i "--package java.io" does that mean that all classes in that package such as "java.io.InputStream" is automatically packaged?
>>
>> No, only if it is used by any of the classes or jars you explicitely asked be wrapped.
>>
>>> BTW, it seems like the formatting of the docs has become a bit corrupted at: http://lucene.apache.org/pylucene/jcc/readme.html
>>
>> Yes, the software behind the site was switched and a bunch of work is needed to fix the content up. Volunteers are welcome to help out with this. If you'd like to contribute I can send you instructions.
>>
>> Andi..
>>
>>>
>>> Many thanks
>>> /Petrus
>>>
>>>
>
>

Re: building JCC on Python 2.4

Posted by Andi Vajda <va...@apache.org>.
Please, don't hijack a thread, start a new one when switching topics. Your questions below have nothing to do with building on Python 2.4.

On Jun 17, 2012, at 5:39, "Petrus Hyvönen" <pe...@gmail.com> wrote:

> I am trying to clean up my wrap script and comes to some questions. 
> 
> Is there a way to see if a method or constructor is now wrapped due to that any of its inputs/outputs are not wrapped? (to make sure that I haven't missed any --package)

Use dir() on the wrapper class to see what got wrapped. But to get a definite answer you need to look at the generated source code to know about all the overloads of a Java method that got wrapped.

> If i "--package java.io" does that mean that all classes in that package such as "java.io.InputStream" is automatically packaged?

No, only if it is used by any of the classes or jars you explicitely asked be wrapped.

> BTW, it seems like the formatting of the docs has become a bit corrupted at: http://lucene.apache.org/pylucene/jcc/readme.html 

Yes, the software behind the site was switched and a bunch of work is needed to fix the content up. Volunteers are welcome to help out with this. If you'd like to contribute I can send you instructions.

Andi..

> 
> Many thanks
> /Petrus
> 
> 

Re: building JCC on Python 2.4

Posted by Petrus Hyvönen <pe...@gmail.com>.
Dear Andi,

I am trying to clean up my wrap script and comes to some questions. 

Is there a way to see if a method or constructor is now wrapped due to that any of its inputs/outputs are not wrapped? (to make sure that I haven't missed any --package)

If i "--package java.io" does that mean that all classes in that package such as "java.io.InputStream" is automatically packaged?

BTW, it seems like the formatting of the docs has become a bit corrupted at: http://lucene.apache.org/pylucene/jcc/readme.html 

Many thanks
/Petrus



Re: building JCC on Python 2.4

Posted by Andi Vajda <va...@apache.org>.
  Hi Felix,

On Tue, 12 Jun 2012, Felix Schwarz wrote:

> I'm trying to build JCC on Python 2.4.3 (CentOS 5). However during the
> compilation I get this error:
> gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
> -D_java_generics -DJCC_VER="2.13" -I/usr/lib/jvm/java-openjdk/include
> -I/usr/lib/jvm/java-openjdk/include/linux -I_jcc -Ijcc/sources
> -I/usr/include/python2.4 -c jcc/sources/JArray.cpp -o
> build/temp.linux-x86_64-2.4/jcc/sources/JArray.o -DPYTHON -O0
> jcc/sources/JArray.h:44: error: 'Py_ssize_t' does not name a type
> jcc/sources/JArray.h:75: error: expected ';' before '(' token
> jcc/sources/JArray.cpp:1213: error: expected `;' at end of input
> jcc/sources/JArray.cpp:1213: error: expected `}' at end of input
> jcc/sources/JArray.h: In constructor 'JArray<T>::JArray(_jobject*)':
>
> Well, I could work around that one with a patch (see attached) but afterwards
> compilation still fails:
> gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
> -D_java_generics -DJCC_VER="2.13" -I/usr/lib/jvm/java-openjdk/include
> -I/usr/lib/jvm/java-openjdk/include/linux -I_jcc -Ijcc/sources
> -I/usr/include/python2.4 -c jcc/sources/JArray.cpp -o
> build/temp.linux-x86_64-2.4/jcc/sources/JArray.o -DPYTHON -O0
> _jcc/java/lang/Class.h:48: error: ISO C++ forbids declaration of 'JArray' with
> no type
> _jcc/java/lang/Class.h:48: error: expected ';' before '<' token
> _jcc/java/lang/Class.h:49: error: ISO C++ forbids declaration of 'JArray' with
> no type
> _jcc/java/lang/Class.h:49: error: expected ';' before '<' token
>
> I'm using GCC 4.1.2:
> gcc-4.1.2-52.el5_8.1
> gcc-c++-4.1.2-52.el5_8.1
>
> Any idea what I'm doing wrong? Do you need more info?

In your patch, instead of including "functions.h", add this to JArray.h 
after the #include "macros.h" line:

#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#endif

I don't have a Python 2.4 install readily available to test this so I hope 
this just works.

Andi..

Re: building JCC on Python 2.4

Posted by Felix Schwarz <fe...@web.de>.
I should add that I'm using OpenJDK 1.6:
java-1.6.0-openjdk-1.6.0.0-1.25.1.10.6.el5_8
java-1.6.0-openjdk-devel-1.6.0.0-1.25.1.10.6.el5_8

fs