[Xapian-discuss] Python or PHP hangs when loading a cygwin Xapian module

Patrick Mézard pmezard at gmail.com
Thu Feb 23 18:30:09 GMT 2006


Thomas Deniau wrote:
> Thomas Deniau <thomas at deniau.org> a écrit :
>
>> Has anyone successfully ran any bindings on Win 2000 ?
>
> I've tried again on Windows XP.
> The result is... the same.
>
> So I guess the apphelp.dll thing wasn't the problem.
>
> Here is exactly what I've done. Patrick, can you see what I'm doing 
> wrong ?
>
> - Installed Cygwin (NOT mingw, which complains about missing headers when
> compiling)
> - Installed the binary distribution of Python 2.4 for Windows
I use the ActivePython distribution. They are likely to provide 
different binaries, headers should be the same.
> - Copied python24.dll to libpython24.dll (I've also tried generating 
> the .a file
> with pexports / dlltool and got the same result)
> - Inside the Cygwin shell
> * Installed Python 2.4 from the source distribution
> * configure, make, make install inside xapian-core
> * Installed the latest SWIG from source with Kevin Ruland's patches to 
> get the
> PHP bindings to compile
I did not do that (but you already know).
> * ./configure --enable-maintainer-mode inside xapian-bindings ;
I did not set this flag, I just selected only the python bindings to be 
built.
> * make CXXFLAGS="" PYTHON_LIBS="-L/cygdrive/c/Python24 -lpython24" 
> (CXXFLAGS is
> needed because otherwise gcc runs out of memory when optimizing)
I did not have the issue with GCC.
>
> make failed when testing (it can't find the xapian module)
>
> * cp python/.libs/_xapian.dll /cygdrive/c/Python24/DLLs
> * copied cygxapian-10.dll to /cygdrive/c/Python24/DLLs
> * copied the Cygwin DLL to the same place
I put _xapian.pyd, cygxapian-8.dll in lib/site-packages directly. I do 
not think it will make much difference.
>
> - Opened c:\Python24\python.exe
> - Ran "import _xapian;"
>
> And then Python froze.
>
>
> I've also tried to compile it using the Windows headers 
> (c:\Python24\include), but I get errors about __int64 (which could be 
> fixed with Olly's compile-time
> flag to translate that to long long, but I don't have the PHP Windows 
> headers
> anyway and the goal is to get Python to work and then to compile PHP 
> in the
> same way - anyway Patrick didn't report having messed with long long).
I did not have any problem with long long but somebody else did in 
another mailing-list thread which I think I quoted. I managed to build 
the xapian python bindings on at least 2 different WinXP hosts, both had 
development environment setup which makes configuration side-effects 
harder to track.
Your issue may be related to your python distribution (which is probably 
what Olly was referring to when talking about runtime discrepancies and 
what I did not get at first sight). Maybe you could give a try to a pure 
Windows ActiveState distribution with mingw, just to know whether my 
how-to is actually relevant to other people.

Hope this helps.

--
Patrick Mézard





More information about the Xapian-discuss mailing list