Radovan Garabik | 9 Dec 2005 11:50
Picon

QueryParser and utf-8 strings

Hi all,
I am rather new to xapian, I just recently tried to include it in
my application, so bear with me if this has already been discussed.

I was playing with QueryParser and noticed that it expects
input to be in ISO8859_1 encoding - characters above 0x80 are
transliterated, and are not considered letters. For example,
using single word (in utf-8 encoding) "bože" as input for 
parse_query, the resulting query is something like:
Xapian::Query((boaa:(pos=1) OR e:(pos=2)))
which makes the parse_query quite unusable for UTF-8 strings (or 
indeed, for any encoding other than ISO8859_1).

I tried to disable the transliteration in 
accentnormalisingitor.h and modified common/utils.h to contain:

inline bool C_isalpha(char ch) {
    using namespace Xapian::Internal;
    return (static_cast<unsigned char>(ch)>=0x80) ||
(is_tab[static_cast<unsigned char>(ch)] & (IS_UPPER|IS_LOWER));
}

inline bool C_isalnum(char ch) {
    using namespace Xapian::Internal;
    return (static_cast<unsigned char>(ch)>=0x80) ||
(is_tab[static_cast<unsigned char>(ch)] & (IS_UPPER|IS_LOWER|IS_DIGIT));
}

since most of the characters above 0x80 are meant as letters, only with 
very few exceptions (non breaking spaces and punctuation, and 
(Continue reading)

Olly Betts | 9 Dec 2005 18:17
Favicon
Gravatar

Re: QueryParser and utf-8 strings

On Fri, Dec 09, 2005 at 11:50:35AM +0100, Radovan Garabik wrote:
> since most of the characters above 0x80 are meant as letters, only with 
> very few exceptions (non breaking spaces and punctuation, and 
> people generally do not write queries using these characters).

Users typically won't type them, but pasted text can easily include
non-ASCII apostrophes and hyphens, even for English queries.

> Of course, the same effect can be achieved by modifying is_tab.

The gmane index is utf-8 - here's the patch I use for the queryparser
there:

http://thread.gmane.org/gmane.comp.search.xapian.general/1925

I'm intending to integrate this patch, but it really needs utf-8
stemming which means I need to upgrade the version of snowball we
use (the gmane index currently doesn't use stemming so this isn't
a problem there).  Upgrading snowball is worth doing anyway, but means
there's more to do.

I'm currently working on producing 0.9.3 which is mainly a bug-fix
release.  I suspect after that we'll go for 1.0.0 with this in.

> I would suggest to make transliteration optional (or if not, remove it,
> since it makes more harm than benefit)

That seems to be the consensus (and any transliterations which are
worthwhile should be folded into the stemmers).

(Continue reading)

Koum | 22 Dec 2005 16:20
Picon

Xapian Binding compile error in Windows XP using CygWin

Hello 
I'm new with the Xapian and I'm trying to install it in Windows XP SP2.
I'm using CygWin (the full version). 
Have already compiled the xapian-core, using a change found in gmane for the 
file safewindows.h 
In cygwin path usr/local/ have the xapian lib etc. 

For the binding the ./configure command passes ok.
when the make starts I get the folowing :
....
MANY ERRORS at xapian_wrap.cc
.....
.....
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1661: undefined reference to `_PyInt_AsLong'
.libs/xapian_wrap.o: In function `swig_varlink_repr':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:20297: undefined reference to `_PyString_FromString'
Info: resolving vtable for Xapian::TradWeightby linking to __imp___ZTVN6Xapian10
TradWeightE (auto-import)
Info: resolving vtable for Xapian::BM25Weightby linking to __imp___ZTVN6Xapian10
BM25WeightE (auto-import)
collect2: ld returned 1 exit status
make[4]: *** [_xapian.la] Error 1
make[4]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python'
make[2]: *** [all] Error 2
(Continue reading)

Olly Betts | 22 Dec 2005 16:43
Favicon
Gravatar

Re: Xapian Binding compile error in Windows XP using CygWin

On Thu, Dec 22, 2005 at 03:20:25PM +0000, Koum wrote:
> I'm new with the Xapian and I'm trying to install it in Windows XP SP2.
> I'm using CygWin (the full version). 
> Have already compiled the xapian-core, using a change found in gmane for the 
> file safewindows.h 

So you're using version 0.9.2 I take it?

> In cygwin path usr/local/ have the xapian lib etc. 
> 
> For the binding the ./configure command passes ok.
> when the make starts I get the folowing :
> ....
> MANY ERRORS at xapian_wrap.cc
> .....
> .....
> /cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
> rap.cc:1661: undefined reference to `_PyInt_AsLong'
> .libs/xapian_wrap.o: In function `swig_varlink_repr':

Generally it's the *first* errors which are the most interesting.  Later
ones are often caused by a cascade effect from the compiler failing to
recover so are often red herrings.

Can you send the full output, or at least the top part?

Cheers,
    Olly
Lefteris Koumakis | 22 Dec 2005 17:02
Picon

Re: Xapian Binding compile error in Windows XP using CygWin

Yes the version is 0.9.2
Ok the first errors (a part of it).

make  all-recursive
make[1]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings'
Making all in python
make[2]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python'
make  all-recursive
make[3]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python'
Making all in docs
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/docs'
Making all in examples
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/docs/examples'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bin
dings/python/docs/examples'
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python/docs'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bin
dings/python/docs'
make[4]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python/docs'
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python'
/bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -Wno-unused -Wno-uninitialize
d -g -O2 -I/usr/local/include   -o _xapian.la -rpath /usr/lib/python2.4/site-pac
kages -avoid-version -module -no-undefined xapian_wrap.lo -Wl,--enable-runtime-p
seudo-reloc /usr/local/lib/libxapian.la
rm -fr  .libs/_xapian.dll.a
g++ -shared -nostdlib   .libs/xapian_wrap.o  /usr/local/lib/libxapian.dll.a -L/u
sr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. -ls
tdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc   -Wl,--enab
le-runtime-pseudo-reloc -o .libs/_xapian.dll -Wl,--image-base=0x10000000 -Wl,--o
ut-implib,.libs/_xapian.dll.a
Creating library file: .libs/_xapian.dll.a
.libs/xapian_wrap.o: In function `PySwigObject_repr':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:663: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigObject_str':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:671: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_oct':
/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:690: undefined reference to `_PyString_FromString'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:689: undefined reference to `_PyOS_snprintf'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:690: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_hex':
/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:697: undefined reference to `_PyOS_snprintf'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:698: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_GetType':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:797: undefined reference to `__imp__PyType_Type'
.libs/xapian_wrap.o: In function `PySwigPacked_repr':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:864: undefined reference to `_PyString_FromFormat'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:866: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigPacked_str':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:875: undefined reference to `_PyString_FromFormat'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:877: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigPacked_GetType':
/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:949: undefined reference to `__imp__PyType_Type'
.libs/xapian_wrap.o: In function `SWIG_Python_TypeError':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1023: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1023: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1032: undefined reference to `_PyObject_Str'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1033: undefined reference to `_PyString_AsString'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1035: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1035: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1045: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1045: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1047: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1047: undefined reference to `_PyErr_Format'

Olly Betts <olly <at> survex.com> writes:

>
> On Thu, Dec 22, 2005 at 03:20:25PM +0000, Koum wrote:
> > I'm new with the Xapian and I'm trying to install it in Windows XP SP2.
> > I'm using CygWin (the full version).
> > Have already compiled the xapian-core, using a change found in gmane for
the
> > file safewindows.h
>
> So you're using version 0.9.2 I take it?
>
> > In cygwin path usr/local/ have the xapian lib etc.
> >
> > For the binding the ./configure command passes ok.
> > when the make starts I get the folowing :
> > ....
> > MANY ERRORS at xapian_wrap.cc
> > .....
> > .....
> > /cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-
bindings/python/modern/xapian_w
> > rap.cc:1661: undefined reference to `_PyInt_AsLong'
> > .libs/xapian_wrap.o: In function `swig_varlink_repr':
>
> Generally it's the *first* errors which are the most interesting.  Later
> ones are often caused by a cascade effect from the compiler failing to
> recover so are often red herrings.
>
> Can you send the full output, or at least the top part?
>
> Cheers,
>     Olly
>


 



On 12/22/05, Olly Betts <olly <at> survex.com> wrote:
On Thu, Dec 22, 2005 at 03:20:25PM +0000, Koum wrote:
> I'm new with the Xapian and I'm trying to install it in Windows XP SP2.
> I'm using CygWin (the full version).
> Have already compiled the xapian-core, using a change found in gmane for the
> file safewindows.h

So you're using version 0.9.2 I take it?

> In cygwin path usr/local/ have the xapian lib etc.
>
> For the binding the ./configure command passes ok.
> when the make starts I get the folowing :
> ....
> MANY ERRORS at xapian_wrap.cc
> .....
> .....
> /cygdrive/d/AutomaticTextAnalysis- 1.3-rc1/xapian-bindings/python/modern/xapian_w
> rap.cc:1661: undefined reference to `_PyInt_AsLong'
> .libs/xapian_wrap.o: In function `swig_varlink_repr':

Generally it's the *first* errors which are the most interesting.  Later
ones are often caused by a cascade effect from the compiler failing to
recover so are often red herrings.

Can you send the full output, or at least the top part?

Cheers,
   Olly



--
Lefteris.
_______________________________________________
Xapian-devel mailing list
Xapian-devel <at> lists.xapian.org
http://lists.xapian.org/mailman/listinfo/xapian-devel
Koum | 22 Dec 2005 17:07
Picon

Re: Xapian Binding compile error in Windows XP using CygWin


Olly Betts <olly <at> survex.com> writes:

> 
> On Thu, Dec 22, 2005 at 03:20:25PM +0000, Koum wrote:
> > I'm new with the Xapian and I'm trying to install it in Windows XP SP2.
> > I'm using CygWin (the full version). 
> > Have already compiled the xapian-core, using a change found in gmane for 
the 
> > file safewindows.h 
> 
> So you're using version 0.9.2 I take it?
> 
> > In cygwin path usr/local/ have the xapian lib etc. 
> > 
> > For the binding the ./configure command passes ok.
> > when the make starts I get the folowing :
> > ....
> > MANY ERRORS at xapian_wrap.cc
> > .....
> > .....
> > /cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-
bindings/python/modern/xapian_w
> > rap.cc:1661: undefined reference to `_PyInt_AsLong'
> > .libs/xapian_wrap.o: In function `swig_varlink_repr':
> 
> Generally it's the *first* errors which are the most interesting.  Later
> ones are often caused by a cascade effect from the compiler failing to
> recover so are often red herrings.
> 
> Can you send the full output, or at least the top part?
> 
> Cheers,
>     Olly
> 

Yes the version is 0.9.2
Ok the first errors (a part of it).

make  all-recursive
make[1]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings'
Making all in python
make[2]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python'
make  all-recursive
make[3]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python'
Making all in docs
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python/docs'
Making all in examples
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python/docs/examples'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python/docs/examples'
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python/docs'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python/docs'
make[4]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings/python/docs'
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings/python'
/bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -Wno-unused -Wno-uninitialize
d -g -O2 -I/usr/local/include   -o _xapian.la -rpath /usr/lib/python2.4/site-pac
kages -avoid-version -module -no-undefined xapian_wrap.lo -Wl,--enable-runtime-p
seudo-reloc /usr/local/lib/libxapian.la
rm -fr  .libs/_xapian.dll.a
g++ -shared -nostdlib   .libs/xapian_wrap.o  /usr/local/lib/libxapian.dll.a -L/u
sr/lib/gcc/i686-pc-cygwin/3.4.4 -L/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../.. -ls
tdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc   -Wl,--enab
le-runtime-pseudo-reloc -o .libs/_xapian.dll -Wl,--image-base=0x10000000 -Wl,--o
ut-implib,.libs/_xapian.dll.a
Creating library file: .libs/_xapian.dll.a
.libs/xapian_wrap.o: In function `PySwigObject_repr':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:663: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigObject_str':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:671: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_oct':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:690: undefined reference to `_PyString_FromString'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:689: undefined reference to `_PyOS_snprintf'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:690: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_hex':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:697: undefined reference to `_PyOS_snprintf'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:698: undefined reference to `_PyString_FromString'
.libs/xapian_wrap.o: In function `PySwigObject_GetType':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:797: undefined reference to `__imp__PyType_Type'
.libs/xapian_wrap.o: In function `PySwigPacked_repr':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:864: undefined reference to `_PyString_FromFormat'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:866: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigPacked_str':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:875: undefined reference to `_PyString_FromFormat'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:877: undefined reference to `_PyString_FromFormat'
.libs/xapian_wrap.o: In function `PySwigPacked_GetType':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:949: undefined reference to `__imp__PyType_Type'
.libs/xapian_wrap.o: In function `SWIG_Python_TypeError':
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1023: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1023: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1032: undefined reference to `_PyObject_Str'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1033: undefined reference to `_PyString_AsString'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1035: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1035: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1045: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1045: undefined reference to `_PyErr_Format'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1047: undefined reference to `__imp__PyExc_TypeError'
/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings/python/modern/xapian_w
rap.cc:1047: undefined reference to `_PyErr_Format'
Olly Betts | 22 Dec 2005 19:23
Favicon
Gravatar

Re: Re: Xapian Binding compile error in Windows XP using CygWin

OK, there are two problems in the configure script.  You should be able to get
it to work if you edit xapian-bindings' configure script as follows...

Search for "libs" (including the quotes), and change this:

        case $host_os in
        mingw* | pw32*)
          PYTHON_LIBS=`$PYTHON -c 'import os,sys;print
"-L"+os.path.join(sys.prefix,"libs").replace(os.sep,"/"),"-lpython"+sys.version[:3].replace(".","")'`
;;         *)
          PYTHON_LIBS=
        esac

to this (add "cygwin* |" and change "libs" to "lib"):

        case $host_os in
        cygwin* | mingw* | pw32*)
          PYTHON_LIBS=`$PYTHON -c 'import os,sys;print
"-L"+os.path.join(sys.prefix,"lib").replace(os.sep,"/"),"-lpython"+sys.version[:3].replace(".","")'`
;;         *)
          PYTHON_LIBS=
        esac

Then "make distclean", rerun configure and make.  Let me know whether that
fixes it or not (if it does, I'll apply the change, if not we'll see if we
can work out what else is going wrong...)

Cheers,
    Olly
Koum | 23 Dec 2005 10:44
Picon

Re: Xapian Binding compile error in Windows XP using CygWin

Olly Betts <olly <at> survex.com> writes:

> 
> OK, there are two problems in the configure script.  You should be able to get
> it to work if you edit xapian-bindings' configure script as follows...
> 
> Search for "libs" (including the quotes), and change this:
> 
>         case $host_os in
>         mingw* | pw32*)
>           PYTHON_LIBS=`$PYTHON -c 'import os,sys;print
> "-L"+os.path.join(sys.prefix,"libs").replace(os.sep,"/"),"-
lpython"+sys.version[:3].replace(".","")'`
> ;;         *)
>           PYTHON_LIBS=
>         esac
> 
> to this (add "cygwin* |" and change "libs" to "lib"):
> 
>         case $host_os in
>         cygwin* | mingw* | pw32*)
>           PYTHON_LIBS=`$PYTHON -c 'import os,sys;print
> "-L"+os.path.join(sys.prefix,"lib").replace(os.sep,"/"),"-lpython"+sys.version
[:3].replace(".","")'`
> ;;         *)
>           PYTHON_LIBS=
>         esac
> 
> Then "make distclean", rerun configure and make.  Let me know whether that
> fixes it or not (if it does, I'll apply the change, if not we'll see if we
> can work out what else is going wrong...)
> 
> Cheers,
>     Olly
> 

We passed the first errors with the update at the script, but I have a new 
problem ...

import _xapian
ImportError: No module named _xapian
I send again the error message.

make  all-recursive
make[1]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2'
Making all in python
make[2]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python'
make  all-recursive
make[3]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python'
Making all in docs
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python/docs'
Making all in examples
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python/docs/examples'
make[5]: Nothing to be done for `all'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python/docs/examples'
make[5]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python/docs'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python/docs'
make[4]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python/docs'
make[4]: Entering directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bi
ndings-0.9.2/python'
if /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I..
 -I/usr/include/python2.4  -Wall -Wno-unused -Wno-uninitialized -g -O2 -I/usr/lo
cal/include -MT xapian_wrap.lo -MD -MP -MF ".deps/xapian_wrap.Tpo" -c -o xapian_
wrap.lo `test -f 'modern/xapian_wrap.cc' || echo './'`modern/xapian_wrap.cc; \
then mv -f ".deps/xapian_wrap.Tpo" ".deps/xapian_wrap.Plo"; else rm -f ".deps/xa
pian_wrap.Tpo"; exit 1; fi
mkdir .libs
 g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.4 -Wall -Wno-unused -Wn
o-uninitialized -g -O2 -I/usr/local/include -MT xapian_wrap.lo -MD -MP -MF .deps
/xapian_wrap.Tpo -c modern/xapian_wrap.cc  -DPIC -o .libs/xapian_wrap.o
/bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -Wno-unused -Wno-uninitialize
d -g -O2 -I/usr/local/include   -o _xapian.la -rpath /usr/lib/python2.4/site-pac
kages -avoid-version -module -no-undefined xapian_wrap.lo -Wl,--enable-runtime-p
seudo-reloc /usr/local/lib/libxapian.la -L/usr/lib -lpython24

*** Warning: linker path does not have real file for library -lpython24.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libpython24 but no candidates were found. (...for file magic test)

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module _xapian.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.
ar cru .libs/_xapian.a .libs/xapian_wrap.o
ranlib .libs/_xapian.a
creating _xapian.la
(cd .libs && rm -f _xapian.la && ln -s ../_xapian.la _xapian.la)
cp `test -f modern/xapian.py || echo './'`modern/xapian.py xapian.py
PYTHONPATH=".:.libs" /usr/bin/python -c "import xapian"
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bindings-0.9.2/python/x
apian.py", line 4, in ?
    import _xapian
ImportError: No module named _xapian
make[4]: *** [xapian.pyc] Error 1
make[4]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/AutomaticTextAnalysis-1.3-rc1/xapian-bin
dings-0.9.2'
make: *** [all] Error 2

Thank you.
Lefteris.
Olly Betts | 23 Dec 2005 11:49
Favicon
Gravatar

Re: Re: Xapian Binding compile error in Windows XP using CygWin

On Fri, Dec 23, 2005 at 09:44:59AM +0000, Koum wrote:
>  g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.4 -Wall -Wno-unused -Wn
> o-uninitialized -g -O2 -I/usr/local/include -MT xapian_wrap.lo -MD -MP -MF .deps
> /xapian_wrap.Tpo -c modern/xapian_wrap.cc  -DPIC -o .libs/xapian_wrap.o
> /bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -Wno-unused -Wno-uninitialize
> d -g -O2 -I/usr/local/include   -o _xapian.la -rpath /usr/lib/python2.4/site-pac
> kages -avoid-version -module -no-undefined xapian_wrap.lo -Wl,--enable-runtime-p
> seudo-reloc /usr/local/lib/libxapian.la -L/usr/lib -lpython24
> 
> *** Warning: linker path does not have real file for library -lpython24.

Do you have a libpython24.dll (or libpython24.<something>)?  If so,
what directory is it in?

Cheers,
    Olly
Koum | 23 Dec 2005 11:59
Picon

Re: Xapian Binding compile error in Windows XP using CygWin

Olly Betts <olly <at> survex.com> writes:

> > seudo-reloc /usr/local/lib/libxapian.la -L/usr/lib -lpython24
> > 
> > *** Warning: linker path does not have real file for library -lpython24.
> 
> Do you have a libpython24.dll (or libpython24.<something>)?  If so,
> what directory is it in?
> 
> Cheers,
>     Olly
> 

I have libpython24.a at C:\Program Files\Python24\libs

Lefteris.

Gmane