On Mon, 10 Aug 2009, KK wrote:
For "open-jdk" my setup.py file is like this:
import os, sys
from distutils.core import setup, Extension
# Add or edit the entry corresponding to your system in the INCLUDES and
# LFLAGS dictionaries below. These entries are used to build JCC _and_ are
# used by JCC to drive compiling and linking via distutils the extensions it
# generated code for.
# The key for your system is determined by sys.platform.
INCLUDES = {
'darwin':
['/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers'],
'linux2': ['/usr/lib/jvm/java-6-openjdk/include/',
'/usr/lib/jvm/java-6-openjdk/include/linux'],
'win32': ['o:/Java/jdk1.6.0_02/include',
'o:/Java/jdk1.6.0_02/include/win32'],
}
LFLAGS = {
'darwin': ['-framework', 'JavaVM'],
'linux2': ['-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/', '-ljava'],
'win32': ['/LIBPATH:o:/Java/jdk1.6.0_02/lib', 'jvm.lib']
}
and running the build gave me the following error,
kk-laptop:~/softies/socs/PyLucene-2.2.0-1/jcc$ python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/jcc
copying jcc/cpp.py -> build/lib.linux-i686-2.6/jcc
copying jcc/config.py -> build/lib.linux-i686-2.6/jcc
copying jcc/python.py -> build/lib.linux-i686-2.6/jcc
copying jcc/__init__.py -> build/lib.linux-i686-2.6/jcc
creating build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/jcc.cpp -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/JCCEnv.cpp -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/functions.cpp -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/JObject.cpp -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/functions.h -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/macros.h -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/JObject.h -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/JArray.h -> build/lib.linux-i686-2.6/jcc/sources
copying jcc/sources/JCCEnv.h -> build/lib.linux-i686-2.6/jcc/sources
running build_ext
building 'jcc._jcc' extension
creating build/temp.linux-i686-2.6
creating build/temp.linux-i686-2.6/jcc
creating build/temp.linux-i686-2.6/jcc/sources
creating build/temp.linux-i686-2.6/_jcc
creating build/temp.linux-i686-2.6/_jcc/java
creating build/temp.linux-i686-2.6/_jcc/java/util
creating build/temp.linux-i686-2.6/_jcc/java/lang
creating build/temp.linux-i686-2.6/_jcc/java/lang/reflect
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -I/usr/lib/jvm/java-6-openjdk/include/
-I/usr/lib/jvm/java-6-openjdk/include/linux -I_jcc -Ijcc/sources
-I/usr/include/python2.6 -c jcc/sources/jcc.cpp -o
build/temp.linux-i686-2.6/jcc/sources/jcc.o -DPYTHON
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
jcc/sources/jcc.cpp:29:20: error: Python.h: No such file or directory
You're missing Python.h, the main Python header file.
To build Python extensions, you need to install the relevant linux package.
On some distros it is called python-dev.
Andi..
jcc/sources/jcc.cpp:30:26: error: structmember.h: No such file or directory
In file included from jcc/sources/jcc.cpp:32:
jcc/sources/JCCEnv.h:215: error: ?PyObject? has not been declared
jcc/sources/JCCEnv.h:216: error: ISO C++ forbids declaration of ?PyObject?
with no type
jcc/sources/JCCEnv.h:216: error: ?PyObject? declared as a ?virtual? field
jcc/sources/JCCEnv.h:216: error: expected ?;? before ?*? token
jcc/sources/JCCEnv.h:217: error: ?PyObject? has not been declared
In file included from _jcc/java/lang/Object.h:28,
from jcc/sources/JArray.h:32,
from _jcc/java/lang/Class.h:28,
from jcc/sources/jcc.cpp:33:
jcc/sources/JObject.h:78: error: ?PyObject_HEAD? does not name a type
jcc/sources/JObject.h:82: error: ?PyTypeObject? does not name a type
In file included from jcc/sources/JArray.h:32,
from _jcc/java/lang/Class.h:28,
from jcc/sources/jcc.cpp:33:
_jcc/java/lang/Object.h:51: error: ?PyTypeObject? does not name a type
_jcc/java/lang/Object.h:55: error: ?PyObject_HEAD? does not name a type
_jcc/java/lang/Object.h:57: error: ISO C++ forbids declaration of ?PyObject?
with no type
_jcc/java/lang/Object.h:57: error: expected ?;? before ?*? token
In file included from _jcc/java/lang/Class.h:28,
from jcc/sources/jcc.cpp:33:
jcc/sources/JArray.h:46: error: expected `)' before ?*? token
jcc/sources/JArray.h:50: error: ?PyObject? has not been declared
jcc/sources/JArray.h:54: error: ISO C++ forbids declaration of ?PyObject?
with no type
jcc/sources/JArray.h:54: error: expected ?;? before ?*? token
jcc/sources/JArray.h:68: error: expected `;' before ?T?
jcc/sources/JArray.h:108: error: expected `)' before ?*? token
jcc/sources/jcc.cpp:599: error: expected `}' at end of input
jcc/sources/JArray.h:105: error: expected unqualified-id at end of input
error: command 'gcc' failed with exit status 1
does this imply i should better install sun-jdk and redo the steps?
Thanks,
KK.
On Mon, Aug 10, 2009 at 3:04 PM, KK <dioxide.softw...@gmail.com> wrote:
Thank you Andi.
I'm going through the link you mentioned.
One question: i already have open-jdk, do i still need to install
sun-java5-jdk ?
or open-jdk will do the job as well? if yes do i need to make some
changes/tweaks before following those steps?
Thanks,
KK
On Mon, Aug 10, 2009 at 2:50 PM, Andi Vajda <va...@apache.org> wrote:
On Aug 10, 2009, at 10:54, KK <dioxide.softw...@gmail.com> wrote:
hi all,
Can someone please help me fixing the issue. before that these are the
vesion of tools i'm using,
pylucene version: PyLucene-2.2.0-1
python: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
gcc: gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
I've been trying to install pylucene on linux for last couple of days,
and
i must say its a horrible exp...after googling a lot i'm kinda lost...no
specific information is available to fix the issue. I followed the basic
installation instruction, which in esssence boils down to copying some
files
from the python subdirectory of pylucene to the site-specific sub
directory
under /usr/loca/lib/python2.6...but after copying the contents of gcj/
and
doing a ldconfig gives error even for apt-get like this
kk-laptop$ sudo apt-get update
[sudo] password for kk:
apt-get: /usr/local/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(required by apt-get)
apt-get: /usr/local/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(required by /usr/lib/libapt-pkg-libc6.9-6.so.4.7)
then i tried removing the those two .so files copied to the
/usr/local/lib
directory as mentioned in the README and after running sudo ldconfig,
apt-get issue was got resolved,
i also refered to this ubuntu thread for installation but of no help,
http://ubuntuforums.org/showthread.php?t=593327
starting python and then trying to import the module gives this error:
kk-laptop$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import PyLucene
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyLucene
and the output of sys.path is this:
import sys
print sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/var/lib/python-support/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/var/lib/python-support/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages']
can someone please help me fixing this issue. i'm completely lost/stuck
at
this issue. seems like i'm an idiot, not able to install pylucne (which
is
essentially copying some files)
thank you very much.
PyLucene with gcj was discontinued last year. Use PyLucene with jcc
instead.
http://lucene.apache.org/pylucene
has installation instructions and docs.
Andi..
--kk